Ignore:
Timestamp:
Sep 11, 2013, 1:34:09 PM (12 years ago)
Author:
[email protected]
Message:

MapData and WeakMapData don't need to be objects
https://bugs.webkit.org/show_bug.cgi?id=121167

Patch by Sam Weinig <[email protected]> on 2013-09-11
Reviewed by Geoffrey Garen.

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::reset):
(JSC::JSGlobalObject::visitChildren):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::mapStructure):
Remove MapData and WeakMapData structures (they moved to VM with other non-object Structures).

  • runtime/JSMap.cpp:

(JSC::JSMap::finishCreation):

  • runtime/JSMap.h:

(JSC::JSMap::create):

  • runtime/JSSet.cpp:

(JSC::JSSet::finishCreation):

  • runtime/JSSet.h:

(JSC::JSSet::create):

  • runtime/JSWeakMap.cpp:

(JSC::JSWeakMap::finishCreation):

  • runtime/JSWeakMap.h:

(JSC::JSWeakMap::create):
Update to not pass a global object to the MapData or WeakMapData Structure.

  • runtime/MapData.cpp:

(JSC::MapData::MapData):

  • runtime/MapData.h:

(JSC::MapData::create):
(JSC::MapData::createStructure):

  • runtime/WeakMapData.cpp:

(JSC::WeakMapData::WeakMapData):
(JSC::WeakMapData::set): Change to take a VM rather than a CallFrame, as that it all it needs.

  • runtime/WeakMapData.h:

(JSC::WeakMapData::create):
(JSC::WeakMapData::createStructure):
Instead of inheriting from JSDestructibleObject, inherit from JSCell and mark self as needing destruction
and having an immortal structure.

  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/VM.h:

Add MapData and WeakMapData Structures.

  • runtime/WeakMapPrototype.cpp:

(JSC::protoFuncWeakMapSet):
Pass a VM rather than an ExecState.

File:
1 edited

Legend:

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

    r155473 r155558  
    201201#endif // ENABLE(PROMISES)
    202202
    203     WriteBarrier<Structure> m_mapDataStructure;
    204     WriteBarrier<Structure> m_weakMapDataStructure;
    205 
    206203#define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
    207204    WriteBarrier<capitalName ## Prototype> m_ ## lowerName ## Prototype; \
     
    400397    Structure* internalFunctionStructure() const { return m_internalFunctionStructure.get(); }
    401398    Structure* mapStructure() const { return m_mapStructure.get(); }
    402     Structure* mapDataStructure() const { return m_mapDataStructure.get(); }
    403     Structure* weakMapDataStructure() const { return m_weakMapDataStructure.get(); }
    404399    Structure* regExpMatchesArrayStructure() const { return m_regExpMatchesArrayStructure.get(); }
    405400    Structure* regExpStructure() const { return m_regExpStructure.get(); }
Note: See TracChangeset for help on using the changeset viewer.