Changeset 155473 in webkit


Ignore:
Timestamp:
Sep 10, 2013 2:16:42 PM (11 years ago)
Author:
oliver@apple.com
Message:

Support WeakMap
https://bugs.webkit.org/show_bug.cgi?id=120912

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Add support for ES6 WeakMap. Add the cluster of boilerplate
classes around the core WeakMapData class.

WeakMapData is a simple object->value hash table that uses a
combo of WeakReferenceHarvester to conditionally keep the weak
value reference live, and UnconditionalFinalizer to clean the
dead keys from the table post-GC.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
  • runtime/CommonIdentifiers.h:
  • runtime/JSGlobalObject.cpp:
  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::weakMapDataStructure):

  • runtime/JSWeakMap.cpp: Added.

(JSC::JSWeakMap::finishCreation):
(JSC::JSWeakMap::visitChildren):

  • runtime/JSWeakMap.h: Added.

(JSC::JSWeakMap::createStructure):
(JSC::JSWeakMap::create):
(JSC::JSWeakMap::weakMapData):
(JSC::JSWeakMap::JSWeakMap):

  • runtime/WeakMapConstructor.cpp: Added.

(JSC::WeakMapConstructor::finishCreation):
(JSC::constructWeakMap):
(JSC::WeakMapConstructor::getConstructData):
(JSC::WeakMapConstructor::getCallData):

  • runtime/WeakMapConstructor.h: Added.

(JSC::WeakMapConstructor::create):
(JSC::WeakMapConstructor::createStructure):
(JSC::WeakMapConstructor::WeakMapConstructor):

  • runtime/WeakMapData.cpp: Added.

(JSC::WeakMapData::WeakMapData):
(JSC::WeakMapData::finishCreation):
(JSC::WeakMapData::destroy):
(JSC::WeakMapData::visitChildren):
(JSC::WeakMapData::set):
(JSC::WeakMapData::get):
(JSC::WeakMapData::remove):
(JSC::WeakMapData::contains):
(JSC::WeakMapData::clear):
(JSC::WeakMapData::DeadKeyCleaner::visitWeakReferences):
(JSC::WeakMapData::DeadKeyCleaner::finalizeUnconditionally):

  • runtime/WeakMapData.h: Added.

(JSC::WeakMapData::create):
(JSC::WeakMapData::createStructure):
(JSC::WeakMapData::DeadKeyCleaner::DeadKeyCleaner):

  • runtime/WeakMapPrototype.cpp: Added.

(JSC::WeakMapPrototype::finishCreation):
(JSC::getWeakMapData):
(JSC::protoFuncWeakMapClear):
(JSC::protoFuncWeakMapDelete):
(JSC::protoFuncWeakMapGet):
(JSC::protoFuncWeakMapHas):
(JSC::protoFuncWeakMapSet):

  • runtime/WeakMapPrototype.h: Added.

(JSC::WeakMapPrototype::create):
(JSC::WeakMapPrototype::createStructure):
(JSC::WeakMapPrototype::WeakMapPrototype):

LayoutTests:

Basic tests.

  • js/basic-weakmap-expected.txt: Added.
  • js/basic-weakmap.html: Added.
  • js/script-tests/basic-weakmap.js: Added.
Location:
trunk
Files:
11 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r155472 r155473  
     12013-09-10  Oliver Hunt  <oliver@apple.com>
     2
     3        Support WeakMap
     4        https://bugs.webkit.org/show_bug.cgi?id=120912
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Basic tests.
     9
     10        * js/basic-weakmap-expected.txt: Added.
     11        * js/basic-weakmap.html: Added.
     12        * js/script-tests/basic-weakmap.js: Added.
     13
    1142013-09-10  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r155090 r155473  
    343343    runtime/JSTypedArrays.cpp
    344344    runtime/JSVariableObject.cpp
     345    runtime/JSWeakMap.cpp
    345346    runtime/JSWithScope.cpp
    346347    runtime/JSWrapperObject.cpp
     
    397398    runtime/Watchdog.cpp
    398399    runtime/WatchdogNone.cpp
     400    runtime/WeakMapConstructor.cpp
     401    runtime/WeakMapData.cpp
     402    runtime/WeakMapPrototype.cpp
    399403
    400404    tools/CodeProfile.cpp
  • trunk/Source/JavaScriptCore/ChangeLog

    r155471 r155473  
     12013-09-09  Oliver Hunt  <oliver@apple.com>
     2
     3        Support WeakMap
     4        https://bugs.webkit.org/show_bug.cgi?id=120912
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Add support for ES6 WeakMap.  Add the cluster of boilerplate
     9        classes around the core WeakMapData class.
     10
     11        WeakMapData is a simple object->value hash table that uses a
     12        combo of WeakReferenceHarvester to conditionally keep the weak
     13        value reference live, and UnconditionalFinalizer to clean the
     14        dead keys from the table post-GC.
     15
     16        * CMakeLists.txt:
     17        * GNUmakefile.list.am:
     18        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
     19        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
     20        * JavaScriptCore.xcodeproj/project.pbxproj:
     21        * Target.pri:
     22        * runtime/CommonIdentifiers.h:
     23        * runtime/JSGlobalObject.cpp:
     24        * runtime/JSGlobalObject.h:
     25        (JSC::JSGlobalObject::weakMapDataStructure):
     26        * runtime/JSWeakMap.cpp: Added.
     27        (JSC::JSWeakMap::finishCreation):
     28        (JSC::JSWeakMap::visitChildren):
     29        * runtime/JSWeakMap.h: Added.
     30        (JSC::JSWeakMap::createStructure):
     31        (JSC::JSWeakMap::create):
     32        (JSC::JSWeakMap::weakMapData):
     33        (JSC::JSWeakMap::JSWeakMap):
     34        * runtime/WeakMapConstructor.cpp: Added.
     35        (JSC::WeakMapConstructor::finishCreation):
     36        (JSC::constructWeakMap):
     37        (JSC::WeakMapConstructor::getConstructData):
     38        (JSC::WeakMapConstructor::getCallData):
     39        * runtime/WeakMapConstructor.h: Added.
     40        (JSC::WeakMapConstructor::create):
     41        (JSC::WeakMapConstructor::createStructure):
     42        (JSC::WeakMapConstructor::WeakMapConstructor):
     43        * runtime/WeakMapData.cpp: Added.
     44        (JSC::WeakMapData::WeakMapData):
     45        (JSC::WeakMapData::finishCreation):
     46        (JSC::WeakMapData::destroy):
     47        (JSC::WeakMapData::visitChildren):
     48        (JSC::WeakMapData::set):
     49        (JSC::WeakMapData::get):
     50        (JSC::WeakMapData::remove):
     51        (JSC::WeakMapData::contains):
     52        (JSC::WeakMapData::clear):
     53        (JSC::WeakMapData::DeadKeyCleaner::visitWeakReferences):
     54        (JSC::WeakMapData::DeadKeyCleaner::finalizeUnconditionally):
     55        * runtime/WeakMapData.h: Added.
     56        (JSC::WeakMapData::create):
     57        (JSC::WeakMapData::createStructure):
     58        (JSC::WeakMapData::DeadKeyCleaner::DeadKeyCleaner):
     59        * runtime/WeakMapPrototype.cpp: Added.
     60        (JSC::WeakMapPrototype::finishCreation):
     61        (JSC::getWeakMapData):
     62        (JSC::protoFuncWeakMapClear):
     63        (JSC::protoFuncWeakMapDelete):
     64        (JSC::protoFuncWeakMapGet):
     65        (JSC::protoFuncWeakMapHas):
     66        (JSC::protoFuncWeakMapSet):
     67        * runtime/WeakMapPrototype.h: Added.
     68        (JSC::WeakMapPrototype::create):
     69        (JSC::WeakMapPrototype::createStructure):
     70        (JSC::WeakMapPrototype::WeakMapPrototype):
     71
    1722013-09-10  Joseph Pecoraro  <pecoraro@apple.com>
    273
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r155180 r155473  
    922922        Source/JavaScriptCore/runtime/JSUint8Array.h \
    923923        Source/JavaScriptCore/runtime/JSUint8ClampedArray.h \
     924        Source/JavaScriptCore/runtime/JSWeakMap.cpp \
     925        Source/JavaScriptCore/runtime/JSWeakMap.h \
    924926        Source/JavaScriptCore/runtime/JSWithScope.cpp \
    925927        Source/JavaScriptCore/runtime/JSNameScope.cpp \
     
    10711073        Source/JavaScriptCore/runtime/WatchdogNone.cpp \
    10721074        Source/JavaScriptCore/runtime/WeakGCMap.h \
     1075        Source/JavaScriptCore/runtime/WeakMapConstructor.cpp \
     1076        Source/JavaScriptCore/runtime/WeakMapConstructor.h \
     1077        Source/JavaScriptCore/runtime/WeakMapData.cpp \
     1078        Source/JavaScriptCore/runtime/WeakMapData.h \
     1079        Source/JavaScriptCore/runtime/WeakMapPrototype.cpp \
     1080        Source/JavaScriptCore/runtime/WeakMapPrototype.h \
    10731081        Source/JavaScriptCore/runtime/WeakRandom.h \
    10741082        Source/JavaScriptCore/runtime/WriteBarrier.h \
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj

    r155090 r155473  
    494494    <ClCompile Include="..\runtime\JSTypedArrays.cpp" />
    495495    <ClCompile Include="..\runtime\JSVariableObject.cpp" />
     496    <ClCompile Include="..\runtime\JSWeakMap.cpp" />
    496497    <ClCompile Include="..\runtime\JSWithScope.cpp" />
    497498    <ClCompile Include="..\runtime\JSWrapperObject.cpp" />
     
    547548    <ClCompile Include="..\runtime\Watchdog.cpp" />
    548549    <ClCompile Include="..\runtime\WatchdogNone.cpp" />
     550    <ClCompile Include="..\runtime\WeakMapConstructor.cpp" />
     551    <ClCompile Include="..\runtime\WeakMapData.cpp" />
     552    <ClCompile Include="..\runtime\WeakMapPrototype.cpp" />
    549553    <ClCompile Include="..\tools\CodeProfile.cpp" />
    550554    <ClCompile Include="..\tools\CodeProfiling.cpp" />
     
    935939    <ClInclude Include="..\runtime\JSUint8ClampedArray.h" />
    936940    <ClInclude Include="..\runtime\JSVariableObject.h" />
     941    <ClInclude Include="..\runtime\JSWeakMap.h" />
    937942    <ClInclude Include="..\runtime\JSWithScope.h" />
    938943    <ClInclude Include="..\runtime\JSWrapperObject.h" />
     
    10101015    <ClInclude Include="..\runtime\Watchdog.h" />
    10111016    <ClInclude Include="..\runtime\WeakGCMap.h" />
     1017    <ClInclude Include="..\runtime\WeakMapConstructor.h" />
     1018    <ClInclude Include="..\runtime\WeakMapData.h" />
     1019    <ClInclude Include="..\runtime\WeakMapPrototype.h" />
    10121020    <ClInclude Include="..\runtime\WeakRandom.h" />
    10131021    <ClInclude Include="..\runtime\WriteBarrier.h" />
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters

    r155123 r155473  
    613613      <Filter>runtime</Filter>
    614614    </ClCompile>
     615    <ClCompile Include="..\runtime\JSWeakMap.cpp">
     616      <Filter>runtime</Filter>
     617    </ClCompile>
    615618    <ClCompile Include="..\runtime\JSWrapperObject.cpp">
    616619      <Filter>runtime</Filter>
     
    857860    </ClCompile>
    858861    <ClCompile Include="..\runtime\JSPromise.cpp">
     862      <Filter>runtime</Filter>
     863    </ClCompile>
     864    <ClCompile Include="..\runtime\WeakMapConstructor.cpp">
     865      <Filter>runtime</Filter>
     866    </ClCompile>
     867    <ClCompile Include="..\runtime\WeakMapData.cpp">
     868      <Filter>runtime</Filter>
     869    </ClCompile>
     870    <ClCompile Include="..\runtime\WeakMapPrototype.cpp">
    859871      <Filter>runtime</Filter>
    860872    </ClCompile>
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r155090 r155473  
    940940                A7C1EAF117987AB600299DB2 /* StackVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1EAEC17987AB600299DB2 /* StackVisitor.cpp */; };
    941941                A7C1EAF217987AB600299DB2 /* StackVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAED17987AB600299DB2 /* StackVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
     942                A7CA3AE317DA41AE006538AF /* WeakMapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3ADD17DA41AE006538AF /* WeakMapConstructor.cpp */; };
     943                A7CA3AE417DA41AE006538AF /* WeakMapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3ADE17DA41AE006538AF /* WeakMapConstructor.h */; };
     944                A7CA3AE517DA41AE006538AF /* WeakMapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3ADF17DA41AE006538AF /* WeakMapPrototype.cpp */; };
     945                A7CA3AE617DA41AE006538AF /* WeakMapPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3AE017DA41AE006538AF /* WeakMapPrototype.h */; };
     946                A7CA3AE717DA41AE006538AF /* JSWeakMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3AE117DA41AE006538AF /* JSWeakMap.cpp */; };
     947                A7CA3AE817DA41AE006538AF /* JSWeakMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3AE217DA41AE006538AF /* JSWeakMap.h */; };
     948                A7CA3AEB17DA5168006538AF /* WeakMapData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3AE917DA5168006538AF /* WeakMapData.cpp */; };
     949                A7CA3AEC17DA5168006538AF /* WeakMapData.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3AEA17DA5168006538AF /* WeakMapData.h */; };
    942950                A7D89CF217A0B8CC00773AD8 /* DFGBasicBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CE317A0B8CC00773AD8 /* DFGBasicBlock.cpp */; };
    943951                A7D89CF317A0B8CC00773AD8 /* DFGBlockInsertionSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CE417A0B8CC00773AD8 /* DFGBlockInsertionSet.cpp */; };
     
    21482156                A7C225CC139981F100FF1662 /* KeywordLookupGenerator.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = KeywordLookupGenerator.py; sourceTree = "<group>"; };
    21492157                A7C225CD1399849C00FF1662 /* KeywordLookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeywordLookup.h; sourceTree = "<group>"; };
     2158                A7CA3ADD17DA41AE006538AF /* WeakMapConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakMapConstructor.cpp; sourceTree = "<group>"; };
     2159                A7CA3ADE17DA41AE006538AF /* WeakMapConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakMapConstructor.h; sourceTree = "<group>"; };
     2160                A7CA3ADF17DA41AE006538AF /* WeakMapPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakMapPrototype.cpp; sourceTree = "<group>"; };
     2161                A7CA3AE017DA41AE006538AF /* WeakMapPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakMapPrototype.h; sourceTree = "<group>"; };
     2162                A7CA3AE117DA41AE006538AF /* JSWeakMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWeakMap.cpp; sourceTree = "<group>"; };
     2163                A7CA3AE217DA41AE006538AF /* JSWeakMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWeakMap.h; sourceTree = "<group>"; };
     2164                A7CA3AE917DA5168006538AF /* WeakMapData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakMapData.cpp; sourceTree = "<group>"; };
     2165                A7CA3AEA17DA5168006538AF /* WeakMapData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakMapData.h; sourceTree = "<group>"; };
    21502166                A7D89CE317A0B8CC00773AD8 /* DFGBasicBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGBasicBlock.cpp; path = dfg/DFGBasicBlock.cpp; sourceTree = "<group>"; };
    21512167                A7D89CE417A0B8CC00773AD8 /* DFGBlockInsertionSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGBlockInsertionSet.cpp; path = dfg/DFGBlockInsertionSet.cpp; sourceTree = "<group>"; };
     
    33813397                                1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */,
    33823398                                A7DCB77912E3D90500911940 /* WriteBarrier.h */,
     3399                                A7CA3ADD17DA41AE006538AF /* WeakMapConstructor.cpp */,
     3400                                A7CA3ADE17DA41AE006538AF /* WeakMapConstructor.h */,
     3401                                A7CA3ADF17DA41AE006538AF /* WeakMapPrototype.cpp */,
     3402                                A7CA3AE017DA41AE006538AF /* WeakMapPrototype.h */,
     3403                                A7CA3AE117DA41AE006538AF /* JSWeakMap.cpp */,
     3404                                A7CA3AE217DA41AE006538AF /* JSWeakMap.h */,
     3405                                A7CA3AE917DA5168006538AF /* WeakMapData.cpp */,
     3406                                A7CA3AEA17DA5168006538AF /* WeakMapData.h */,
    33833407                        );
    33843408                        path = runtime;
     
    39934017                                0F235BEC17178E7300690C7F /* DFGOSRExitBase.h in Headers */,
    39944018                                0FFB921C16D02F110055A5DB /* DFGOSRExitCompilationInfo.h in Headers */,
     4019                                A7CA3AEC17DA5168006538AF /* WeakMapData.h in Headers */,
    39954020                                0FC0977114693AF500CF2442 /* DFGOSRExitCompiler.h in Headers */,
    39964021                                0F7025AA1714B0FC00382C0E /* DFGOSRExitCompilerCommon.h in Headers */,
     
    42134238                                A7C0C4AC168103020017011D /* JSScriptRefPrivate.h in Headers */,
    42144239                                0F919D11157F332C004A4E7D /* JSSegmentedVariableObject.h in Headers */,
     4240                                A7CA3AE817DA41AE006538AF /* JSWeakMap.h in Headers */,
    42154241                                A7299D9E17D12837005F5FF9 /* JSSet.h in Headers */,
    42164242                                BC18C45E0E16F5CD00B34460 /* JSStack.h in Headers */,
     
    43384364                                0FF729BB166AD360000F5BA3 /* ProfilerCompilationKind.h in Headers */,
    43394365                                0FD8A32617D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.h in Headers */,
     4366                                A7CA3AE417DA41AE006538AF /* WeakMapConstructor.h in Headers */,
    43404367                                0FF729BC166AD360000F5BA3 /* ProfilerCompiledBytecode.h in Headers */,
    43414368                                0FF729BD166AD360000F5BA3 /* ProfilerDatabase.h in Headers */,
     
    44034430                                142E313B134FF0A600AFADB5 /* Strong.h in Headers */,
    44044431                                145722861437E140005FDE26 /* StrongInlines.h in Headers */,
     4432                                A7CA3AE617DA41AE006538AF /* WeakMapPrototype.h in Headers */,
    44054433                                BCDE3AB80E6C82F5001453A7 /* Structure.h in Headers */,
    44064434                                7E4EE7090EBB7963005934AA /* StructureChain.h in Headers */,
     
    49875015                                C2D58C3415912FEE0021A844 /* GCActivityCallback.cpp in Sources */,
    49885016                                0F766D2F15A8DCE0008F363E /* GCAwareJITStubRoutine.cpp in Sources */,
     5017                                A7CA3AEB17DA5168006538AF /* WeakMapData.cpp in Sources */,
    49895018                                C2239D1A16262BDD005AC5FD /* GCThread.cpp in Sources */,
    49905019                                C21122E115DD9AB300790E3A /* GCThreadSharedData.cpp in Sources */,
     
    51285157                                14469DE3107EC7E700650446 /* NumberObject.cpp in Sources */,
    51295158                                14469DE4107EC7E700650446 /* NumberPrototype.cpp in Sources */,
     5159                                A7CA3AE317DA41AE006538AF /* WeakMapConstructor.cpp in Sources */,
    51305160                                86F3EEBE168CDE930077B92A /* ObjCCallbackFunction.mm in Sources */,
    51315161                                14469DE5107EC7E700650446 /* ObjectConstructor.cpp in Sources */,
     
    51615191                                1474C33C16AA2D9B0062F01D /* PrototypeMap.cpp in Sources */,
    51625192                                0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */,
     5193                                A7CA3AE517DA41AE006538AF /* WeakMapPrototype.cpp in Sources */,
    51635194                                0FF60AC316740F8800029779 /* ReduceWhitespace.cpp in Sources */,
    51645195                                14280841107EC0930013E7B2 /* RegExp.cpp in Sources */,
    51655196                                A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */,
     5197                                A7CA3AE717DA41AE006538AF /* JSWeakMap.cpp in Sources */,
    51665198                                8642C510151C06A90046D4EF /* RegExpCachedResult.cpp in Sources */,
    51675199                                0FD8A32B17D51F5700CA2C40 /* DFGToFTLForOSREntryDeferredCompilationCallback.cpp in Sources */,
  • trunk/Source/JavaScriptCore/Target.pri

    r155090 r155473  
    351351    runtime/JSTypedArrays.cpp \
    352352    runtime/JSVariableObject.cpp \
     353    runtime/JSWeakMap.cpp \
    353354    runtime/JSWithScope.cpp \
    354355    runtime/JSWrapperObject.cpp \
     
    405406    runtime/Watchdog.cpp \
    406407    runtime/WatchdogNone.cpp \
     408    runtime/WeakMapConstructor.cpp \
     409    runtime/WeakMapData.cpp \
     410    runtime/WeakMapPrototype.cpp \
    407411    tools/CodeProfile.cpp \
    408412    tools/CodeProfiling.cpp \
  • trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h

    r154916 r155473  
    144144    macro(Map)\
    145145    macro(Set)\
     146    macro(WeakMap)\
    146147    macro(add)
    147148
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r155177 r155473  
    7272#include "JSTypedArrayPrototypes.h"
    7373#include "JSTypedArrays.h"
     74#include "JSWeakMap.h"
    7475#include "JSWithScope.h"
    7576#include "LegacyProfiler.h"
     
    100101#include "StringConstructor.h"
    101102#include "StringPrototype.h"
     103#include "WeakMapConstructor.h"
     104#include "WeakMapData.h"
     105#include "WeakMapPrototype.h"
    102106
    103107#if ENABLE(PROMISES)
     
    310314
    311315    m_mapDataStructure.set(exec->vm(), this, MapData::createStructure(exec->vm(), this, jsNull()));
     316    m_weakMapDataStructure.set(exec->vm(), this, WeakMapData::createStructure(exec->vm(), this, jsNull()));
    312317
    313318#define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
     
    641646
    642647    visitor.append(&thisObject->m_mapDataStructure);
     648    visitor.append(&thisObject->m_weakMapDataStructure);
    643649
    644650    for (unsigned i = NUMBER_OF_TYPED_ARRAY_TYPES; i--;) {
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r155177 r155473  
    8181    macro(Error, error, error, ErrorInstance, Error) \
    8282    macro(JSArrayBuffer, arrayBuffer, arrayBuffer, JSArrayBuffer, ArrayBuffer) \
     83    macro(WeakMap, weakMap, weakMap, JSWeakMap, WeakMap) \
    8384
    8485#define DECLARE_SIMPLE_BUILTIN_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
     
    201202
    202203    WriteBarrier<Structure> m_mapDataStructure;
     204    WriteBarrier<Structure> m_weakMapDataStructure;
    203205
    204206#define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
     
    399401    Structure* mapStructure() const { return m_mapStructure.get(); }
    400402    Structure* mapDataStructure() const { return m_mapDataStructure.get(); }
     403    Structure* weakMapDataStructure() const { return m_weakMapDataStructure.get(); }
    401404    Structure* regExpMatchesArrayStructure() const { return m_regExpMatchesArrayStructure.get(); }
    402405    Structure* regExpStructure() const { return m_regExpStructure.get(); }
Note: See TracChangeset for help on using the changeset viewer.