Changeset 185277 in webkit
- Timestamp:
- Jun 5, 2015, 5:33:43 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r185268 r185277 1 2015-06-05 Mark Lam <mark.lam@apple.com> 2 3 Subclasses of JSNonFinalObject with gc'able children need to implement visitChildren(). 4 https://bugs.webkit.org/show_bug.cgi?id=145709 5 6 Reviewed by Geoffrey Garen. 7 8 * jsc.cpp: 9 (functionSetElementRoot): 10 - The Element class has a member of type Root which extends JSDestructibleObject. 11 It should be stored in a WriteBarrier, and visited by visitChildren(). 12 13 * runtime/ClonedArguments.cpp: 14 (JSC::ClonedArguments::materializeSpecialsIfNecessary): 15 (JSC::ClonedArguments::visitChildren): 16 * runtime/ClonedArguments.h: 17 - Add missing visitChildren(). 18 19 * tests/stress/cloned-arguments-should-visit-callee-during-gc.js: Added. 20 (makeTransientFunction.transientFunc): 21 (makeTransientFunction): 22 1 23 2015-06-05 Geoffrey Garen <ggaren@apple.com> 2 24 -
trunk/Source/JavaScriptCore/jsc.cpp
r185259 r185277 131 131 class Element : public JSNonFinalObject { 132 132 public: 133 Element(VM& vm, Structure* structure , Root* root)133 Element(VM& vm, Structure* structure) 134 134 : Base(vm, structure) 135 , m_root(root)136 135 { 137 136 } … … 140 139 static const bool needsDestruction = false; 141 140 142 Root* root() const { return m_root ; }143 void setRoot( Root* root) { m_root = root; }141 Root* root() const { return m_root.get(); } 142 void setRoot(VM& vm, Root* root) { m_root.set(vm, this, root); } 144 143 145 144 static Element* create(VM& vm, JSGlobalObject* globalObject, Root* root) 146 145 { 147 146 Structure* structure = createStructure(vm, globalObject, jsNull()); 148 Element* element = new (NotNull, allocateCell<Element>(vm.heap, sizeof(Element))) Element(vm, structure , root);149 element->finishCreation(vm );147 Element* element = new (NotNull, allocateCell<Element>(vm.heap, sizeof(Element))) Element(vm, structure); 148 element->finishCreation(vm, root); 150 149 return element; 151 150 } 152 151 153 void finishCreation(VM&); 152 void finishCreation(VM&, Root*); 153 154 static void visitChildren(JSCell* cell, SlotVisitor& visitor) 155 { 156 Element* thisObject = jsCast<Element*>(cell); 157 ASSERT_GC_OBJECT_INHERITS(thisObject, info()); 158 Base::visitChildren(thisObject, visitor); 159 visitor.append(&thisObject->m_root); 160 } 154 161 155 162 static ElementHandleOwner* handleOwner(); … … 163 170 164 171 private: 165 Root*m_root;172 WriteBarrier<Root> m_root; 166 173 }; 167 174 … … 422 429 } 423 430 424 void Element::finishCreation(VM& vm )431 void Element::finishCreation(VM& vm, Root* root) 425 432 { 426 433 Base::finishCreation(vm); 434 setRoot(vm, root); 427 435 m_root->setElement(this); 428 436 } … … 787 795 Element* element = jsCast<Element*>(exec->argument(0)); 788 796 Root* root = jsCast<Root*>(exec->argument(1)); 789 element->setRoot( root);797 element->setRoot(exec->vm(), root); 790 798 return JSValue::encode(jsUndefined()); 791 799 } -
trunk/Source/JavaScriptCore/runtime/ClonedArguments.cpp
r182911 r185277 219 219 } 220 220 221 void ClonedArguments::visitChildren(JSCell* cell, SlotVisitor& visitor) 222 { 223 ClonedArguments* thisObject = jsCast<ClonedArguments*>(cell); 224 ASSERT_GC_OBJECT_INHERITS(thisObject, info()); 225 Base::visitChildren(thisObject, visitor); 226 visitor.append(&thisObject->m_callee); 227 } 228 221 229 } // namespace JSC 222 230 -
trunk/Source/JavaScriptCore/runtime/ClonedArguments.h
r182911 r185277 56 56 static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype); 57 57 58 static void visitChildren(JSCell*, SlotVisitor&); 59 58 60 DECLARE_INFO; 59 61
Note:
See TracChangeset
for help on using the changeset viewer.