Changeset 181248 in webkit
- Timestamp:
- Mar 8, 2015 4:47:25 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r181215 r181248 1 2015-03-08 Andreas Kling <akling@apple.com> 2 3 BuiltinExecutables keeps finalized Weaks around, pinning WeakBlocks. 4 <https://webkit.org/b/142460> 5 6 Reviewed by Geoffrey Garen. 7 8 Make BuiltinExecutables a WeakHandleOwner so it can clear out its respective Weak members 9 if and when their pointees get garbage collected. 10 11 This fixes an issue I've seen locally where a WeakBlock is pinned down by a single one of 12 these Weak<BuiltinExecutables>. 13 14 * builtins/BuiltinExecutables.h: Make BuiltinExecutables inherit from WeakHandleOwner. 15 16 * builtins/BuiltinExecutables.cpp: 17 (JSC::BuiltinExecutables::finalize): Clear out the relevant member pointer when it's been 18 garbage collected. We use the WeakImpl's "context" field to pass the address of the member. 19 1 20 2015-03-07 Geoffrey Garen <ggaren@apple.com> 2 21 -
trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
r180637 r181248 84 84 } 85 85 86 void BuiltinExecutables::finalize(Handle<Unknown>, void* context) 87 { 88 static_cast<Weak<UnlinkedFunctionExecutable>*>(context)->clear(); 89 } 90 86 91 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \ 87 92 UnlinkedFunctionExecutable* BuiltinExecutables::name##Executable() \ 88 93 {\ 89 94 if (!m_##name##Executable)\ 90 m_##name##Executable = createBuiltinExecutable(m_##name##Source, m_vm.propertyNames->builtinNames().functionName##PublicName());\95 m_##name##Executable = Weak<UnlinkedFunctionExecutable>(createBuiltinExecutable(m_##name##Source, m_vm.propertyNames->builtinNames().functionName##PublicName()), this, &m_##name##Executable);\ 91 96 return m_##name##Executable.get();\ 92 97 } -
trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.h
r177222 r181248 30 30 #include "SourceCode.h" 31 31 #include "Weak.h" 32 #include "WeakHandleOwner.h" 32 33 33 34 namespace JSC { … … 37 38 class VM; 38 39 39 class BuiltinExecutables {40 class BuiltinExecutables final: private WeakHandleOwner { 40 41 WTF_MAKE_FAST_ALLOCATED; 41 42 public: … … 50 51 51 52 private: 53 void finalize(Handle<Unknown>, void* context) override; 54 52 55 VM& m_vm; 53 56 UnlinkedFunctionExecutable* createBuiltinExecutable(const SourceCode&, const Identifier&);
Note: See TracChangeset
for help on using the changeset viewer.