Changeset 64684 in webkit
- Timestamp:
- Aug 4, 2010 3:21:13 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r64658 r64684 1 2010-08-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r64655. 4 http://trac.webkit.org/changeset/64655 5 https://bugs.webkit.org/show_bug.cgi?id=43496 6 7 JavaScriptCore references patch seems to have caused 8 regressions in QT and GTK builds (Requested by nlawrence on 9 #webkit). 10 11 * bytecode/CodeBlock.cpp: 12 (JSC::CodeBlock::markAggregate): 13 * runtime/Collector.cpp: 14 (JSC::Heap::markConservatively): 15 * runtime/JSCell.h: 16 (JSC::JSValue::asCell): 17 (JSC::MarkStack::append): 18 * runtime/JSGlobalObject.cpp: 19 (JSC::markIfNeeded): 20 * runtime/JSONObject.cpp: 21 (JSC::Stringifier::Holder::object): 22 * runtime/JSObject.h: 23 (JSC::JSObject::prototype): 24 * runtime/JSStaticScopeObject.cpp: 25 (JSC::JSStaticScopeObject::markChildren): 26 * runtime/JSValue.h: 27 (JSC::JSValue::): 28 (JSC::JSValue::JSValue): 29 (JSC::JSValue::asCell): 30 * runtime/MarkStack.h: 31 * runtime/NativeErrorConstructor.cpp: 32 * runtime/NativeErrorConstructor.h: 33 * runtime/Structure.h: 34 (JSC::Structure::storedPrototype): 35 1 36 2010-08-04 Gavin Barraclough <barraclough@apple.com> 2 37 -
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r64655 r64684 1514 1514 { 1515 1515 for (size_t i = 0; i < m_constantRegisters.size(); ++i) 1516 markStack.append(m_constantRegisters[i] );1516 markStack.append(m_constantRegisters[i].jsValue()); 1517 1517 for (size_t i = 0; i < m_functionExprs.size(); ++i) 1518 1518 m_functionExprs[i]->markAggregate(markStack); -
trunk/JavaScriptCore/runtime/Collector.cpp
r64655 r64684 692 692 if (m_heap.collectorBlock(block) != blockAddr) 693 693 continue; 694 // While markStack.append normally takes a reference to update, 695 // we don't actually want the heap to be updated since we don't 696 // know for sure that it's actually a pointer. In the future 697 // this will be replaced by some appendRoot function for this 698 // specific case. 699 JSCell* cell = reinterpret_cast<JSCell*>(xAsBits); 700 markStack.append(cell); 694 markStack.append(reinterpret_cast<JSCell*>(xAsBits)); 701 695 markStack.drain(); 702 696 } -
trunk/JavaScriptCore/runtime/JSCell.h
r64655 r64684 36 36 37 37 class JSCell : public NoncopyableCustomAllocated { 38 friend class CollectorHeap;39 38 friend class GetterSetter; 40 39 friend class Heap; … … 239 238 240 239 #if !USE(JSVALUE32_64) 241 ALWAYS_INLINE JSCell*& JSValue::asCell() 242 { 243 ASSERT(isCell()); 244 return m_ptr; 245 } 246 247 ALWAYS_INLINE JSCell* const& JSValue::asCell() const 240 ALWAYS_INLINE JSCell* JSValue::asCell() const 248 241 { 249 242 ASSERT(isCell()); … … 337 330 } 338 331 339 template<typename T> 340 ALWAYS_INLINE void MarkStack::append(T*& cell) 341 { 342 // References in C++ are not covariant. JSObject* being a subtype of JSCell* 343 // does not mean that JSObject*& can be used as a subtype of JSCell*& because 344 // treating a JSObject*& as a JSCell*& would allow us to change the pointer to 345 // point to something that is a JSCell but not a JSObject. 346 // 347 // In this case, we need to be able to change the pointer, and although we know 348 // it to be safe, C++ doesn't, requiring us to use templated functions that 349 // pass a casted version to an internal function. 350 // 351 // Currently we're not doing anything with the value of the pointer, so nothing 352 // unsafe will happen. In the future, when we have movable objects, we will be 353 // changing the value of the pointer to be the new location, in which case the 354 // type will be preserved. 355 JSCell*& ptr = *reinterpret_cast<JSCell**>(&cell); 356 appendInternal(ptr); 357 } 358 359 ALWAYS_INLINE void MarkStack::append(JSValue& value) 360 { 361 ASSERT(value); 362 if (value.isCell()) 363 appendInternal(value.asCell()); 364 } 365 366 ALWAYS_INLINE void MarkStack::append(Register& reg) 367 { 368 JSValue value = reg.jsValue(); 369 append(value); 370 reg = value; 371 } 372 373 inline void MarkStack::appendInternal(JSCell*& cell) 332 ALWAYS_INLINE void MarkStack::append(JSCell* cell) 374 333 { 375 334 ASSERT(!m_isCheckingForDefaultMarkViolation); … … 382 341 } 383 342 343 ALWAYS_INLINE void MarkStack::append(JSValue value) 344 { 345 ASSERT(value); 346 if (value.isCell()) 347 append(value.asCell()); 348 } 349 384 350 inline Heap* Heap::heap(JSValue v) 385 351 { -
trunk/JavaScriptCore/runtime/JSGlobalObject.cpp
r64655 r64684 81 81 static const int preferredScriptCheckTimeInterval = 1000; 82 82 83 template<typename T> static inline void markIfNeeded(MarkStack& markStack, T*&v)83 static inline void markIfNeeded(MarkStack& markStack, JSValue v) 84 84 { 85 85 if (v) … … 87 87 } 88 88 89 static inline void markIfNeeded(MarkStack& markStack, RefPtr<Structure>& s)89 static inline void markIfNeeded(MarkStack& markStack, const RefPtr<Structure>& s) 90 90 { 91 91 if (s) 92 mark Stack.append(s->storedPrototype());92 markIfNeeded(markStack, s->storedPrototype()); 93 93 } 94 94 -
trunk/JavaScriptCore/runtime/JSONObject.cpp
r64655 r64684 83 83 Holder(JSObject*); 84 84 85 JSObject*& object() { return m_object; } 86 JSObject* const& object() const { return m_object; } 85 JSObject* object() const { return m_object; } 87 86 88 87 bool appendNextProperty(Stringifier&, StringBuilder&); 89 88 90 89 private: 91 JSObject* m_object;90 JSObject* const m_object; 92 91 const bool m_isArray; 93 92 bool m_isJSArray; -
trunk/JavaScriptCore/runtime/JSObject.h
r64655 r64684 87 87 virtual ~JSObject(); 88 88 89 JSValue& prototype(); 90 const JSValue& prototype() const; 89 JSValue prototype() const; 91 90 void setPrototype(JSValue prototype); 92 91 bool setPrototypeWithCycleCheck(JSValue prototype); … … 314 313 } 315 314 316 inline JSValue& JSObject::prototype() 317 { 318 return m_structure->storedPrototype(); 319 } 320 321 inline const JSValue& JSObject::prototype() const 315 inline JSValue JSObject::prototype() const 322 316 { 323 317 return m_structure->storedPrototype(); -
trunk/JavaScriptCore/runtime/JSStaticScopeObject.cpp
r64655 r64684 35 35 { 36 36 JSVariableObject::markChildren(markStack); 37 markStack.append(d()->registerStore );37 markStack.append(d()->registerStore.jsValue()); 38 38 } 39 39 -
trunk/JavaScriptCore/runtime/JSValue.h
r64655 r64684 200 200 201 201 bool isCell() const; 202 JSCell*& asCell(); 203 JSCell* const& asCell() const; 202 JSCell* asCell() const; 204 203 bool isValidCallee(); 205 204 … … 242 241 int32_t payload; 243 242 } asBits; 244 struct {245 int32_t tag;246 JSCell* ptr;247 } asPtr;248 243 #else 249 244 struct { … … 251 246 int32_t tag; 252 247 } asBits; 253 struct {254 JSCell* ptr;255 int32_t tag;256 } asPtr;257 248 #endif 258 249 } u; … … 501 492 else 502 493 u.asBits.tag = EmptyValueTag; 503 u.as Ptr.ptr = ptr;494 u.asBits.payload = reinterpret_cast<int32_t>(ptr); 504 495 #if ENABLE(JSC_ZOMBIES) 505 496 ASSERT(!isZombie()); … … 513 504 else 514 505 u.asBits.tag = EmptyValueTag; 515 u.as Ptr.ptr = const_cast<JSCell*>(ptr);506 u.asBits.payload = reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr)); 516 507 #if ENABLE(JSC_ZOMBIES) 517 508 ASSERT(!isZombie()); … … 608 599 } 609 600 610 ALWAYS_INLINE JSCell* const&JSValue::asCell() const601 ALWAYS_INLINE JSCell* JSValue::asCell() const 611 602 { 612 603 ASSERT(isCell()); 613 return u.asPtr.ptr; 614 } 615 616 ALWAYS_INLINE JSCell*& JSValue::asCell() 617 { 618 ASSERT(isCell()); 619 return u.asPtr.ptr; 604 return reinterpret_cast<JSCell*>(u.asBits.payload); 620 605 } 621 606 -
trunk/JavaScriptCore/runtime/MarkStack.h
r64655 r64684 47 47 } 48 48 49 template<typename T> ALWAYS_INLINE void append(T*& cell); 50 ALWAYS_INLINE void append(JSValue&); 51 ALWAYS_INLINE void append(Register&); 49 ALWAYS_INLINE void append(JSValue); 50 void append(JSCell*); 52 51 53 52 ALWAYS_INLINE void appendValues(Register* values, size_t count, MarkSetProperties properties = NoNullValues) … … 72 71 73 72 private: 74 void appendInternal(JSCell*&);75 76 73 void markChildren(JSCell*); 77 74 -
trunk/JavaScriptCore/runtime/NativeErrorConstructor.cpp
r64655 r64684 69 69 } 70 70 71 PassRefPtr<Structure> NativeErrorConstructor::createStructure(JSObject* prototype)72 {73 return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);74 }75 76 void NativeErrorConstructor::markChildren(MarkStack& markStack)77 {78 InternalFunction::markChildren(markStack);79 80 markStack.append(m_errorStructure->storedPrototype());81 }82 83 71 } // namespace JSC -
trunk/JavaScriptCore/runtime/NativeErrorConstructor.h
r64655 r64684 37 37 38 38 Structure* errorStructure() { return m_errorStructure.get(); } 39 static PassRefPtr<Structure> createStructure(JSObject* prototype);40 41 protected:42 static const unsigned StructureFlags = InternalFunction::StructureFlags | OverridesMarkChildren;43 39 44 40 private: 45 41 virtual ConstructType getConstructData(ConstructData&); 46 42 virtual CallType getCallData(CallData&); 47 48 virtual void markChildren(MarkStack&);49 43 50 44 virtual const ClassInfo* classInfo() const { return &info; } -
trunk/JavaScriptCore/runtime/Structure.h
r64655 r64684 95 95 const TypeInfo& typeInfo() const { return m_typeInfo; } 96 96 97 const JSValue& storedPrototype() const { return m_prototype; } 98 JSValue& storedPrototype() { return m_prototype; } 97 JSValue storedPrototype() const { return m_prototype; } 99 98 JSValue prototypeForLookup(ExecState*) const; 100 99 StructureChain* prototypeChain(ExecState*) const; -
trunk/JavaScriptGlue/ChangeLog
r64655 r64684 1 2010-08-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r64655. 4 http://trac.webkit.org/changeset/64655 5 https://bugs.webkit.org/show_bug.cgi?id=43496 6 7 JavaScriptCore references patch seems to have caused 8 regressions in QT and GTK builds (Requested by nlawrence on 9 #webkit). 10 11 * JSValueWrapper.cpp: 12 (JSValueWrapper::JSObjectMark): 13 1 14 2010-08-04 Nathan Lawrence <nlawrence@apple.com> 2 15 -
trunk/JavaScriptGlue/JSValueWrapper.cpp
r64655 r64684 193 193 } 194 194 195 void JSValueWrapper::JSObjectMark(void*) 196 { 197 // The object doesn't need to be marked here because it is a protected 198 // object and should therefore be marked by 199 // JSC::Heap::markProtectedObjects. 200 201 // We are keeping the function around because the function is passed as a 202 // callback. 203 } 195 void JSValueWrapper::JSObjectMark(void *data) 196 { 197 JSValueWrapper* ptr = (JSValueWrapper*)data; 198 if (ptr) 199 { 200 // This results in recursive marking but will be otherwise safe and correct. 201 // We claim the array vptr is 0 because we don't have access to it here, and 202 // claiming 0 is functionally harmless -- it merely means that we can't 203 // devirtualise marking of arrays when recursing from this point. 204 MarkStack markStack(0); 205 markStack.append(ptr->fValue.get()); 206 markStack.drain(); 207 } 208 }
Note: See TracChangeset
for help on using the changeset viewer.