Changeset 185277 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Jun 5, 2015, 5:33:43 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.