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.cpp

    r79240 r81086  
    3131
    3232StringObject::StringObject(ExecState* exec, NonNullPassRefPtr<Structure> structure)
    33     : JSWrapperObject(exec->globalData(), structure)
     33    : JSWrapperObject(structure)
    3434{
    3535    ASSERT(inherits(&s_info));
     
    3838
    3939StringObject::StringObject(JSGlobalData& globalData, NonNullPassRefPtr<Structure> structure, JSString* string)
    40     : JSWrapperObject(globalData, structure)
     40    : JSWrapperObject(structure)
    4141{
    4242    ASSERT(inherits(&s_info));
     
    4545
    4646StringObject::StringObject(ExecState* exec, NonNullPassRefPtr<Structure> structure, const UString& string)
    47     : JSWrapperObject(exec->globalData(), structure)
     47    : JSWrapperObject(structure)
    4848{
    4949    ASSERT(inherits(&s_info));
Note: See TracChangeset for help on using the changeset viewer.