Ignore:
Timestamp:
Aug 4, 2010, 10:18:07 AM (15 years ago)
Author:
[email protected]
Message:

2010-08-04 Nathan Lawrence <[email protected]>

Reviewed by Darin Adler.

Refactoring MarkStack::append to take a reference. This is in
preparation for movable objects when we will need to update pointers.
http://bugs.webkit.org/show_bug.cgi?id=41177

Unless otherwise noted, all changes are to either return by reference
or pass a reference to MarkStack::append.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::markAggregate):
  • runtime/Collector.cpp: (JSC::Heap::markConservatively):

Added a temporary variable to prevent marking from changing an
unknown value on the stack

  • runtime/JSCell.h: (JSC::JSValue::asCell): (JSC::MarkStack::append): (JSC::MarkStack::appendInternal):
  • runtime/JSGlobalObject.cpp: (JSC::markIfNeeded):
  • runtime/JSONObject.cpp: (JSC::Stringifier::Holder::object):
  • runtime/JSObject.h: (JSC::JSObject::prototype):
  • runtime/JSStaticScopeObject.cpp: (JSC::JSStaticScopeObject::markChildren):
  • runtime/JSValue.h: (JSC::JSValue::JSValue): (JSC::JSValue::asCell):
  • runtime/MarkStack.h:
  • runtime/NativeErrorConstructor.cpp: (JSC::NativeErrorConstructor::createStructure):

Changed the structure flags to include a custom markChildren.

(JSC::NativeErrorConstructor::markChildren):

Update the prototype of the stored structure.

  • runtime/NativeErrorConstructor.h:

Added structure flags.

  • runtime/Structure.h: (JSC::Structure::storedPrototype):

2010-08-04 Nathan Lawrence <[email protected]>

Reviewed by Darin Adler.

Removed unneeded marking. We need to remove this marking in order to have
MarkStack::append take references for updating movable objects.

https://bugs.webkit.org/show_bug.cgi?id=41177

  • JSValueWrapper.cpp: (JSValueWrapper::JSObjectMark):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSValue.h

    r62896 r64655  
    200200
    201201        bool isCell() const;
    202         JSCell* asCell() const;
     202        JSCell*& asCell();
     203        JSCell* const& asCell() const;
    203204        bool isValidCallee();
    204205
     
    241242                int32_t payload;
    242243            } asBits;
     244            struct {
     245                int32_t tag;
     246                JSCell* ptr;
     247            } asPtr;
    243248#else
    244249            struct {
     
    246251                int32_t tag;
    247252            } asBits;
     253            struct {
     254                JSCell* ptr;
     255                int32_t tag;
     256            } asPtr;
    248257#endif
    249258        } u;
     
    492501        else
    493502            u.asBits.tag = EmptyValueTag;
    494         u.asBits.payload = reinterpret_cast<int32_t>(ptr);
     503        u.asPtr.ptr = ptr;
    495504#if ENABLE(JSC_ZOMBIES)
    496505        ASSERT(!isZombie());
     
    504513        else
    505514            u.asBits.tag = EmptyValueTag;
    506         u.asBits.payload = reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr));
     515        u.asPtr.ptr = const_cast<JSCell*>(ptr);
    507516#if ENABLE(JSC_ZOMBIES)
    508517        ASSERT(!isZombie());
     
    599608    }
    600609   
    601     ALWAYS_INLINE JSCell* JSValue::asCell() const
     610    ALWAYS_INLINE JSCell* const& JSValue::asCell() const
    602611    {
    603612        ASSERT(isCell());
    604         return reinterpret_cast<JSCell*>(u.asBits.payload);
     613        return u.asPtr.ptr;
     614    }
     615
     616    ALWAYS_INLINE JSCell*& JSValue::asCell()
     617    {
     618        ASSERT(isCell());
     619        return u.asPtr.ptr;
    605620    }
    606621
Note: See TracChangeset for help on using the changeset viewer.