Ignore:
Timestamp:
Mar 14, 2011, 5:39:56 PM (14 years ago)
Author:
[email protected]
Message:

2011-03-14 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

Made JSWrapperObject and subclasses moving-GC-safe
https://bugs.webkit.org/show_bug.cgi?id=56346


SunSpider reports no change.

  • runtime/BooleanObject.cpp: (JSC::BooleanObject::BooleanObject):
  • runtime/DateInstance.cpp: (JSC::DateInstance::DateInstance): No more need for JSGlobalData, since we don't initialize the wrapped value in our constructor.
  • runtime/DateInstance.h: Don't set the OverridesMarkChildren flag because we do not in fact override markChildren.
  • runtime/DatePrototype.h: Declare an anonymous slot, since wrapper object no longer does so for us. Also added an ASSERT to catch a latent bug, where DatePrototype stomped on its base class's anonymous slot. Hard-coded anonymous slots are a plague on our code. This doesn't cause any problems in our existing code since the base class never reads the anonymous slot it declares, but it caused crashes when I tried to start using the slot in an initial version of this patch.
  • runtime/JSWrapperObject.h: (JSC::JSWrapperObject::JSWrapperObject): (JSC::JSWrapperObject::internalValue): (JSC::JSWrapperObject::setInternalValue): Resolved a problem where our internal value was stored in two places: an anonymous slot, and a data member which was not always visited during GC. Now, we only use the data member, and we always visit it. (Instead of relying on certain subclasses to set the OverridesMarkChildren bit, we set it ourselves.)
  • runtime/NumberObject.cpp: (JSC::NumberObject::NumberObject): No more need for JSGlobalData, since we don't initialize the wrapped value in our constructor.
  • runtime/NumberObject.h: Removed meaningless declaration.
  • runtime/StringObject.cpp: (JSC::StringObject::StringObject): No more need for JSGlobalData, since we don't initialize the wrapped value in our constructor.
  • runtime/StringObject.h: Don't set the OverridesMarkChildren flag because we do not in fact override markChildren.
  • runtime/StringPrototype.h: Declare an anonymous slot, since wrapper object no longer does so for us. Also added an ASSERT to catch a latent bug, where DatePrototype stomped on its base class's anonymous slot. Hard-coded anonymous slots are a plague on our code.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/StringObject.h

    r79132 r81086  
    5252
    5353    protected:
    54         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSWrapperObject::StructureFlags;
     54        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSWrapperObject::StructureFlags;
    5555        StringObject(JSGlobalData&, NonNullPassRefPtr<Structure>, JSString*);
    56   };
     56    };
    5757
    5858    StringObject* asStringObject(JSValue);
Note: See TracChangeset for help on using the changeset viewer.