Changeset 201494 in webkit
- Timestamp:
- May 28, 2016 9:47:41 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r201488 r201494 1 2016-05-28 Andreas Kling <akling@apple.com> 2 3 JSGlobalLexicalEnvironment leaks SegmentedVector due to lack of destructor. 4 <https://webkit.org/b/158186> 5 6 Reviewed by Saam Barati. 7 8 Give JSGlobalLexicalEnvironment a destroy() and set up a finalizer for it 9 like we do with JSGlobalObject. (This is needed because they don't inherit 10 from JSDestructibleObjects and thus can't use JSCell::needsDestruction to 11 ask for allocation in destructor space.) 12 13 This stops us from leaking all the SegmentedVector backing stores. 14 15 * runtime/JSGlobalLexicalEnvironment.cpp: 16 (JSC::JSGlobalLexicalEnvironment::destroy): 17 * runtime/JSGlobalLexicalEnvironment.h: 18 (JSC::JSGlobalLexicalEnvironment::create): 19 1 20 2016-05-28 Skachkov Oleksandr <gskachkov@gmail.com> 2 21 [ESNext] Trailing commas in function parameters. -
trunk/Source/JavaScriptCore/runtime/JSGlobalLexicalEnvironment.cpp
r200121 r201494 33 33 const ClassInfo JSGlobalLexicalEnvironment::s_info = { "JSGlobalLexicalEnvironment", &Base::s_info, 0, CREATE_METHOD_TABLE(JSGlobalLexicalEnvironment) }; 34 34 35 void JSGlobalLexicalEnvironment::destroy(JSCell* cell) 36 { 37 static_cast<JSGlobalLexicalEnvironment*>(cell)->JSGlobalLexicalEnvironment::~JSGlobalLexicalEnvironment(); 38 } 39 35 40 bool JSGlobalLexicalEnvironment::getOwnPropertySlot(JSObject* object, ExecState*, PropertyName propertyName, PropertySlot& slot) 36 41 { -
trunk/Source/JavaScriptCore/runtime/JSGlobalLexicalEnvironment.h
r200121 r201494 44 44 result->finishCreation(vm); 45 45 result->symbolTable()->setScopeType(SymbolTable::ScopeType::GlobalLexicalScope); 46 vm.heap.addFinalizer(result, destroy); 46 47 return result; 47 48 } … … 49 50 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 50 51 static bool put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); 52 53 static void destroy(JSCell*); 54 // We don't need a destructor because we use a finalizer instead. 55 static const bool needsDestruction = false; 51 56 52 57 bool isEmpty() const { return !symbolTable()->size(); }
Note: See TracChangeset
for help on using the changeset viewer.