Changeset 154861 in webkit


Ignore:
Timestamp:
Aug 29, 2013 5:55:34 PM (11 years ago)
Author:
oliver@apple.com
Message:

Implement ES6 Map object
https://bugs.webkit.org/show_bug.cgi?id=120333

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Implement support for the ES6 Map type and related classes.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • heap/CopyToken.h: Add a new token to track copying the backing store
  • runtime/CommonIdentifiers.h: Add new identifiers
  • runtime/JSGlobalObject.cpp:
  • runtime/JSGlobalObject.h:

Add new structures and prototypes

  • runtime/JSMap.cpp: Added.
  • runtime/JSMap.h: Added.

New JSMap class to represent a Map instance

  • runtime/MapConstructor.cpp: Added.
  • runtime/MapConstructor.h: Added.

The Map constructor

  • runtime/MapData.cpp: Added.
  • runtime/MapData.h: Added.

The most interesting data structure. The roughly corresponds
to the ES6 notion of MapData. It provides the core JSValue->JSValue
map implementation. We implement it using 2 hashtables and a flat
table. Due to the different semantics of string comparisons vs.
all others we need have one map keyed by String and the other by
generic JSValue. The actual table is represented more or less
exactly as described in the ES6 draft - a single contiguous list of
key/value pairs. The entire map could be achieved with just this
table, however we need the HashMaps in order to maintain O(1) lookup.

Deleted values are simply cleared as the draft says, however the
implementation compacts the storage on copy as long as the are no
active iterators.

  • runtime/MapPrototype.cpp: Added.
  • runtime/MapPrototype.h: Added.

Implement Map prototype functions

  • runtime/VM.cpp:

Add new structures.

LayoutTests:

Tests

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r154860 r154861  
     12013-08-29  Oliver Hunt  <oliver@apple.com>
     2
     3        Implement ES6 Map object
     4        https://bugs.webkit.org/show_bug.cgi?id=120333
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Tests
     9
     10        * fast/js/basic-map-expected.txt: Added.
     11        * fast/js/basic-map.html: Added.
     12        * fast/js/script-tests/basic-map.js: Added.
     13
    1142013-08-29  Joseph Pecoraro  <pecoraro@apple.com>
    215
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r154854 r154861  
    335335    runtime/JSGlobalObjectFunctions.cpp
    336336    runtime/JSLock.cpp
     337    runtime/JSMap.cpp
     338    runtime/JSMapConstructor.cpp
     339    runtime/JSMapPrototype.cpp
    337340    runtime/JSNameScope.cpp
    338341    runtime/JSNotAnObject.cpp
     
    362365    runtime/LiteralParser.cpp
    363366    runtime/Lookup.cpp
     367    runtime/MapData.cpp
    364368    runtime/MathObject.cpp
    365369    runtime/MemoryStatistics.cpp
  • trunk/Source/JavaScriptCore/ChangeLog

    r154854 r154861  
     12013-08-29  Oliver Hunt  <oliver@apple.com>
     2
     3
     4        Implement ES6 Map object
     5        https://bugs.webkit.org/show_bug.cgi?id=120333
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Implement support for the ES6 Map type and related classes.
     10
     11        * JavaScriptCore.xcodeproj/project.pbxproj:
     12        * heap/CopyToken.h: Add a new token to track copying the backing store
     13        * runtime/CommonIdentifiers.h: Add new identifiers
     14        * runtime/JSGlobalObject.cpp:
     15        * runtime/JSGlobalObject.h:
     16            Add new structures and prototypes
     17
     18        * runtime/JSMap.cpp: Added.
     19        * runtime/JSMap.h: Added.
     20            New JSMap class to represent a Map instance
     21
     22        * runtime/MapConstructor.cpp: Added.
     23        * runtime/MapConstructor.h: Added.
     24            The Map constructor
     25
     26        * runtime/MapData.cpp: Added.
     27        * runtime/MapData.h: Added.
     28            The most interesting data structure.  The roughly corresponds
     29            to the ES6 notion of MapData.  It provides the core JSValue->JSValue
     30            map implementation.  We implement it using 2 hashtables and a flat
     31            table.  Due to the different semantics of string comparisons vs.
     32            all others we need have one map keyed by String and the other by
     33            generic JSValue.  The actual table is represented more or less
     34            exactly as described in the ES6 draft - a single contiguous list of
     35            key/value pairs.  The entire map could be achieved with just this
     36            table, however we need the HashMaps in order to maintain O(1) lookup.
     37
     38            Deleted values are simply cleared as the draft says, however the
     39            implementation compacts the storage on copy as long as the are no
     40            active iterators.
     41
     42        * runtime/MapPrototype.cpp: Added.
     43        * runtime/MapPrototype.h: Added.
     44            Implement Map prototype functions
     45
     46        * runtime/VM.cpp:
     47            Add new structures.
     48
    1492013-08-29  Filip Pizlo  <fpizlo@apple.com>
    250
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r154854 r154861  
    873873        Source/JavaScriptCore/runtime/JSLock.cpp \
    874874        Source/JavaScriptCore/runtime/JSLock.h \
     875        Source/JavaScriptCore/runtime/JSMap.cpp \
     876        Source/JavaScriptCore/runtime/JSMapConstructor.cpp \
     877        Source/JavaScriptCore/runtime/JSMapPrototype.cpp \
    875878        Source/JavaScriptCore/runtime/JSNotAnObject.cpp \
    876879        Source/JavaScriptCore/runtime/JSNotAnObject.h \
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj

    r154854 r154861  
    470470    <ClCompile Include="..\runtime\JSGlobalObjectFunctions.cpp" />
    471471    <ClCompile Include="..\runtime\JSLock.cpp" />
     472    <ClCompile Include="..\runtime\JSMap.cpp" />
     473    <ClCompile Include="..\runtime\JSMapConstructor.cpp" />
     474    <ClCompile Include="..\runtime\JSMapPrototype.cpp" />
    472475    <ClCompile Include="..\runtime\JSNameScope.cpp" />
    473476    <ClCompile Include="..\runtime\JSNotAnObject.cpp" />
     
    496499    <ClCompile Include="..\runtime\LiteralParser.cpp" />
    497500    <ClCompile Include="..\runtime\Lookup.cpp" />
     501    <ClCompile Include="..\runtime\MapData.cpp" />
    498502    <ClCompile Include="..\runtime\MathObject.cpp" />
    499503    <ClCompile Include="..\runtime\NameConstructor.cpp" />
     
    896900    <ClInclude Include="..\runtime\JSInt8Array.h" />
    897901    <ClInclude Include="..\runtime\JSLock.h" />
     902    <ClInclude Include="..\runtime\JSMap.h" />
     903    <ClInclude Include="..\runtime\JSMapConstructor.h" />
     904    <ClInclude Include="..\runtime\JSMapPrototype.h" />
    898905    <ClInclude Include="..\runtime\JSNameScope.h" />
    899906    <ClInclude Include="..\runtime\JSNotAnObject.h" />
     
    929936    <ClInclude Include="..\runtime\LiteralParser.h" />
    930937    <ClInclude Include="..\runtime\Lookup.h" />
     938    <ClInclude Include="..\runtime\MapData.h" />
    931939    <ClInclude Include="..\runtime\MatchResult.h" />
    932940    <ClInclude Include="..\runtime\MathObject.h" />
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters

    r154821 r154861  
    574574      <Filter>runtime</Filter>
    575575    </ClCompile>
     576    <ClCompile Include="..\runtime\JSMap.cpp">
     577      <Filter>runtime</Filter>
     578    </ClCompile>
     579    <ClCompile Include="..\runtime\JSMapPrototype.cpp">
     580      <Filter>runtime</Filter>
     581    </ClCompile>
     582    <ClCompile Include="..\runtime\JSMapConstructor.cpp">
     583      <Filter>runtime</Filter>
     584    </ClCompile>
    576585    <ClCompile Include="..\runtime\JSNameScope.cpp">
    577586      <Filter>runtime</Filter>
     
    620629    </ClCompile>
    621630    <ClCompile Include="..\runtime\Lookup.cpp">
     631      <Filter>runtime</Filter>
     632    </ClCompile>
     633    <ClCompile Include="..\runtime\MapData.cpp">
    622634      <Filter>runtime</Filter>
    623635    </ClCompile>
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r154854 r154861  
    811811                A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B3E11C7B228007A5315 /* RegExpCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
    812812                A1712B4111C7B235007A5315 /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
     813                A700873917CBE85300C3E643 /* MapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873717CBE85300C3E643 /* MapConstructor.cpp */; };
     814                A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873817CBE85300C3E643 /* MapConstructor.h */; };
     815                A700873D17CBE8D300C3E643 /* MapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873B17CBE8D300C3E643 /* MapPrototype.cpp */; };
     816                A700873E17CBE8D300C3E643 /* MapPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873C17CBE8D300C3E643 /* MapPrototype.h */; };
     817                A700874117CBE8EB00C3E643 /* JSMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873F17CBE8EB00C3E643 /* JSMap.cpp */; };
     818                A700874217CBE8EB00C3E643 /* JSMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A700874017CBE8EB00C3E643 /* JSMap.h */; };
    813819                A70447EA17A0BD4600F5898E /* OperandsInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A70447E917A0BD4600F5898E /* OperandsInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
    814820                A70447ED17A0BD7000F5898E /* DumpContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A70447EB17A0BD7000F5898E /* DumpContext.cpp */; };
     
    870876                A784A26111D16622005776AC /* ASTBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
    871877                A784A26411D16622005776AC /* SyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
     878                A78507D617CBC6FD0011F6E7 /* MapData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78507D417CBC6FD0011F6E7 /* MapData.cpp */; };
     879                A78507D717CBC6FD0011F6E7 /* MapData.h in Headers */ = {isa = PBXBuildFile; fileRef = A78507D517CBC6FD0011F6E7 /* MapData.h */; };
    872880                A78853F917972629001440E4 /* IntendedStructureChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78853F717972629001440E4 /* IntendedStructureChain.cpp */; };
    873881                A78853FA17972629001440E4 /* IntendedStructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = A78853F817972629001440E4 /* IntendedStructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    19871995                A1712B3E11C7B228007A5315 /* RegExpCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCache.h; sourceTree = "<group>"; };
    19881996                A1712B4011C7B235007A5315 /* RegExpKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpKey.h; sourceTree = "<group>"; };
     1997                A700873717CBE85300C3E643 /* MapConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapConstructor.cpp; sourceTree = "<group>"; };
     1998                A700873817CBE85300C3E643 /* MapConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapConstructor.h; sourceTree = "<group>"; };
     1999                A700873B17CBE8D300C3E643 /* MapPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapPrototype.cpp; sourceTree = "<group>"; };
     2000                A700873C17CBE8D300C3E643 /* MapPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapPrototype.h; sourceTree = "<group>"; };
     2001                A700873F17CBE8EB00C3E643 /* JSMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMap.cpp; sourceTree = "<group>"; };
     2002                A700874017CBE8EB00C3E643 /* JSMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMap.h; sourceTree = "<group>"; };
    19892003                A70447E917A0BD4600F5898E /* OperandsInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OperandsInlines.h; sourceTree = "<group>"; };
    19902004                A70447EB17A0BD7000F5898E /* DumpContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DumpContext.cpp; sourceTree = "<group>"; };
     
    20432057                A77F1820164088B200640A47 /* CodeCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeCache.h; sourceTree = "<group>"; };
    20442058                A77F18241641925400640A47 /* ParserModes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ParserModes.h; sourceTree = "<group>"; };
     2059                A78507D417CBC6FD0011F6E7 /* MapData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapData.cpp; sourceTree = "<group>"; };
     2060                A78507D517CBC6FD0011F6E7 /* MapData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapData.h; sourceTree = "<group>"; };
    20452061                A78853F717972629001440E4 /* IntendedStructureChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntendedStructureChain.cpp; sourceTree = "<group>"; };
    20462062                A78853F817972629001440E4 /* IntendedStructureChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntendedStructureChain.h; sourceTree = "<group>"; };
     
    23882404                        isa = PBXGroup;
    23892405                        children = (
    2390                                 932F5BE10822A1C700736975 /* jsc */,
    23912406                                0FF922CF14F46B130041A24E /* JSCLLIntOffsetsExtractor */,
    23922407                                932F5BD90822A1C700736975 /* JavaScriptCore.framework */,
     2408                                932F5BE10822A1C700736975 /* jsc */,
    23932409                                141211200A48793C00480255 /* minidom */,
    23942410                                14BD59BF0A3E8F9000BAF59C /* testapi */,
     
    29022918                        isa = PBXGroup;
    29032919                        children = (
    2904                                 7C3BA29A17C03BE10072DDC9 /* JSPromiseResolverPrototype.lut.h */,
    29052920                                BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */,
    29062921                                BCD203E70E1718F4002C7E82 /* DatePrototype.lut.h */,
     
    29082923                                7C184E2417BFFA36007CB63A /* JSPromiseConstructor.lut.h */,
    29092924                                7C184E2517BFFA36007CB63A /* JSPromisePrototype.lut.h */,
     2925                                7C3BA29A17C03BE10072DDC9 /* JSPromiseResolverPrototype.lut.h */,
    29102926                                A7C225CD1399849C00FF1662 /* KeywordLookup.h */,
    29112927                                BC18C52D0E16FCE100B34460 /* Lexer.lut.h */,
     
    31303146                                65EA4C99092AF9E20093D800 /* JSLock.cpp */,
    31313147                                65EA4C9A092AF9E20093D800 /* JSLock.h */,
     3148                                A700873F17CBE8EB00C3E643 /* JSMap.cpp */,
     3149                                A700874017CBE8EB00C3E643 /* JSMap.h */,
    31323150                                14874ADF15EBDE4A002E3587 /* JSNameScope.cpp */,
    31333151                                14874AE015EBDE4A002E3587 /* JSNameScope.h */,
     
    31893207                                F692A8680255597D01FF60F7 /* Lookup.cpp */,
    31903208                                F692A8690255597D01FF60F7 /* Lookup.h */,
     3209                                A700873717CBE85300C3E643 /* MapConstructor.cpp */,
     3210                                A700873817CBE85300C3E643 /* MapConstructor.h */,
     3211                                A78507D417CBC6FD0011F6E7 /* MapData.cpp */,
     3212                                A78507D517CBC6FD0011F6E7 /* MapData.h */,
     3213                                A700873B17CBE8D300C3E643 /* MapPrototype.cpp */,
     3214                                A700873C17CBE8D300C3E643 /* MapPrototype.h */,
    31913215                                8612E4CB1522918400C836BE /* MatchResult.h */,
    31923216                                F692A86A0255597D01FF60F7 /* MathObject.cpp */,
     
    38123836                                0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */,
    38133837                                0F2B66DF17B6B5AB00A7AE3F /* DataView.h in Headers */,
    3814                                 0FC712DF17CD877C008CC93C /* DeferredCompilationCallback.h in Headers */,
    38153838                                BCD2034A0E17135E002C7E82 /* DateConstructor.h in Headers */,
    38163839                                41359CF30FDD89AD00206180 /* DateConversion.h in Headers */,
     
    38233846                                BC18C3FB0E16F5CD00B34460 /* DebuggerCallFrame.h in Headers */,
    38243847                                0F136D4D174AD69E0075B354 /* DeferGC.h in Headers */,
     3848                                0FC712DF17CD877C008CC93C /* DeferredCompilationCallback.h in Headers */,
    38253849                                A77A423E17A0BBFD00A8DB81 /* DFGAbstractHeap.h in Headers */,
    3826                                 7C15F65E17C199CE00794D40 /* JSPromiseCallback.h in Headers */,
    38273850                                A704D90317A0BAA8006BA554 /* DFGAbstractInterpreter.h in Headers */,
    38283851                                A704D90417A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h in Headers */,
     
    38923915                                A7D89CFC17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.h in Headers */,
    38933916                                0FF0F19B16B729FA005DF95B /* DFGLongLivedState.h in Headers */,
    3894                                 7C184E1F17BEE22E007CB63A /* JSPromisePrototype.h in Headers */,
    38953917                                A767B5B617A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h in Headers */,
    38963918                                A704D90717A0BAA8006BA554 /* DFGMergeMode.h in Headers */,
     
    39543976                                A766B44F0EE8DCD1009518CA /* ExecutableAllocator.h in Headers */,
    39553977                                0F56A1D315000F35002992B1 /* ExecutionCounter.h in Headers */,
    3956                                 0F38B01217CF078300B144D3 /* LLIntEntrypoint.h in Headers */,
    39573978                                0FB105861675481200F8AB6E /* ExitKind.h in Headers */,
    39583979                                0F0B83AB14BCF5BB00885B4F /* ExpressionRangeInfo.h in Headers */,
     
    39703991                                0F235BD617178E1C00690C7F /* FTLExitArgumentForOperand.h in Headers */,
    39713992                                0F235BD717178E1C00690C7F /* FTLExitArgumentList.h in Headers */,
    3972                                 7C3BA29917C039560072DDC9 /* JSPromiseResolverPrototype.h in Headers */,
    39733993                                0F235BD917178E1C00690C7F /* FTLExitThunkGenerator.h in Headers */,
    39743994                                0F235BDB17178E1C00690C7F /* FTLExitValue.h in Headers */,
     
    40354055                                1429D77C0ED20D7300B89619 /* Interpreter.h in Headers */,
    40364056                                860BD801148EA6F200112B2F /* Intrinsic.h in Headers */,
    4037                                 7C3BA29517C039560072DDC9 /* JSPromiseResolver.h in Headers */,
    40384057                                BC18C4130E16F5CD00B34460 /* JavaScript.h in Headers */,
    40394058                                BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */,
     
    40574076                                A7A4AE1017973B4D005612B1 /* JITStubsX86Common.h in Headers */,
    40584077                                0F5EF91F16878F7D003E5C25 /* JITThunks.h in Headers */,
     4078                                0FC712E317CD8793008CC93C /* JITToDFGDeferredCompilationCallback.h in Headers */,
    40594079                                A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */,
    40604080                                BC18C4160E16F5CD00B34460 /* JSActivation.h in Headers */,
     
    40974117                                0F2B66F117B6B5AB00A7AE3F /* JSGenericTypedArrayView.h in Headers */,
    40984118                                0F2B66F217B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h in Headers */,
     4119                                0F2B66F217B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h in Headers */,
    40994120                                0F2B66F317B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructorInlines.h in Headers */,
    41004121                                0F2B66F417B6B5AB00A7AE3F /* JSGenericTypedArrayViewInlines.h in Headers */,
     
    41094130                                BC18C4230E16F5CD00B34460 /* JSLock.h in Headers */,
    41104131                                C25D709C16DE99F400FCA6BC /* JSManagedValue.h in Headers */,
     4132                                A700874217CBE8EB00C3E643 /* JSMap.h in Headers */,
    41114133                                14874AE415EBDE4A002E3587 /* JSNameScope.h in Headers */,
    41124134                                BC18C4240E16F5CD00B34460 /* JSObject.h in Headers */,
    41134135                                BC18C4250E16F5CD00B34460 /* JSObjectRef.h in Headers */,
    41144136                                A7280A2811557E3000D56957 /* JSObjectRefPrivate.h in Headers */,
    4115                                 0FC712E317CD8793008CC93C /* JITToDFGDeferredCompilationCallback.h in Headers */,
    41164137                                A7F9935F0FD7325100A0B2D0 /* JSONObject.h in Headers */,
    41174138                                BC87CDB910712AD4000614CF /* JSONObject.lut.h in Headers */,
    41184139                                9534AAFB0E5B7A9600B8A45B /* JSProfilerPrivate.h in Headers */,
     4140                                7C184E1B17BEDBD3007CB63A /* JSPromise.h in Headers */,
     4141                                7C15F65E17C199CE00794D40 /* JSPromiseCallback.h in Headers */,
     4142                                7C184E2317BEE240007CB63A /* JSPromiseConstructor.h in Headers */,
     4143                                7C184E1F17BEE22E007CB63A /* JSPromisePrototype.h in Headers */,
     4144                                7C3BA29517C039560072DDC9 /* JSPromiseResolver.h in Headers */,
     4145                                7C3BA29717C039560072DDC9 /* JSPromiseResolverConstructor.h in Headers */,
     4146                                7C3BA29917C039560072DDC9 /* JSPromiseResolverPrototype.h in Headers */,
    41194147                                862553D216136E1A009F17D0 /* JSProxy.h in Headers */,
    41204148                                BC18C4260E16F5CD00B34460 /* JSRetainPtr.h in Headers */,
     
    41684196                                0F4680CA14BBB16C00BFE272 /* LLIntCommon.h in Headers */,
    41694197                                0F4680D314BBD16700BFE272 /* LLIntData.h in Headers */,
     4198                                0F38B01217CF078300B144D3 /* LLIntEntrypoint.h in Headers */,
    41704199                                0F4680A314BA7F8D00BFE272 /* LLIntExceptions.h in Headers */,
    41714200                                0F4680CB14BBB17200BFE272 /* LLIntOfflineAsmConfig.h in Headers */,
     
    41884217                                860161E50F3A83C100F84710 /* MacroAssemblerX86_64.h in Headers */,
    41894218                                860161E60F3A83C100F84710 /* MacroAssemblerX86Common.h in Headers */,
     4219                                A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */,
     4220                                A78507D717CBC6FD0011F6E7 /* MapData.h in Headers */,
     4221                                A700873E17CBE8D300C3E643 /* MapPrototype.h in Headers */,
    41904222                                C2B916C214DA014E00CBAC86 /* MarkedAllocator.h in Headers */,
    41914223                                142D6F0913539A2800B02E86 /* MarkedBlock.h in Headers */,
     
    42614293                                0F9332A414CA7DD90085F3C6 /* PutByIdStatus.h in Headers */,
    42624294                                0F0CD4C215F1A6070032F1C0 /* PutDirectIndexMode.h in Headers */,
    4263                                 7C184E1B17BEDBD3007CB63A /* JSPromise.h in Headers */,
    4264                                 0F2B66F217B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h in Headers */,
    42654295                                0F9FC8C514E1B60400D52AE0 /* PutKind.h in Headers */,
    42664296                                147B84630E6DE6B1004775A4 /* PutPropertySlot.h in Headers */,
     
    42684298                                BC18C45A0E16F5CD00B34460 /* RegExp.h in Headers */,
    42694299                                A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */,
    4270                                 7C3BA29717C039560072DDC9 /* JSPromiseResolverConstructor.h in Headers */,
    42714300                                BCD202C20E1706A7002C7E82 /* RegExpConstructor.h in Headers */,
    42724301                                BCD202D60E170708002C7E82 /* RegExpConstructor.lut.h in Headers */,
     
    42794308                                969A072B0ED1CE6900F1F681 /* RegisterID.h in Headers */,
    42804309                                0FB7F39D15ED8E4600F167B2 /* Reject.h in Headers */,
    4281                                 7C184E2317BEE240007CB63A /* JSPromiseConstructor.h in Headers */,
    42824310                                86D3B3C410159D7F002865E7 /* RepatchBuffer.h in Headers */,
    42834311                                869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */,
     
    43174345                                BC9041480EB9250900FE26FA /* StructureTransitionTable.h in Headers */,
    43184346                                C2DF44301707AC0100A5CA96 /* SuperRegion.h in Headers */,
    4319                                 0F55989817C86C5800A1E543 /* ToNativeFromValue.h in Headers */,
    43204347                                BC18C46B0E16F5CD00B34460 /* SymbolTable.h in Headers */,
    43214348                                A784A26411D16622005776AC /* SyntaxChecker.h in Headers */,
     
    43234350                                A7386556118697B400540279 /* ThunkGenerators.h in Headers */,
    43244351                                141448CD13A1783700F5BA1A /* TinyBloomFilter.h in Headers */,
     4352                                0F55989817C86C5800A1E543 /* ToNativeFromValue.h in Headers */,
    43254353                                5D53726F0E1C54880021E549 /* Tracing.h in Headers */,
    43264354                                0F2B670617B6B5AB00A7AE3F /* TypedArrayAdaptors.h in Headers */,
     
    47614789                                BC3135650F302FA3003DFD3A /* DebuggerActivation.cpp in Sources */,
    47624790                                149559EE0DDCDDF700648087 /* DebuggerCallFrame.cpp in Sources */,
     4791                                0FC712DE17CD8779008CC93C /* DeferredCompilationCallback.cpp in Sources */,
    47634792                                A77A423D17A0BBFD00A8DB81 /* DFGAbstractHeap.cpp in Sources */,
    47644793                                0F55C19417276E4600CEABFD /* DFGAbstractValue.cpp in Sources */,
     
    47934822                                C2981FDC17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp in Sources */,
    47944823                                0FF427641591A1CC004CB9FF /* DFGDisassembler.cpp in Sources */,
    4795                                 7C3BA29817C039560072DDC9 /* JSPromiseResolverPrototype.cpp in Sources */,
    47964824                                0FD81AD2154FB4EE00983E72 /* DFGDominators.cpp in Sources */,
    47974825                                0FD3C82614115D4000FD81CB /* DFGDriver.cpp in Sources */,
     
    48154843                                0F2BDC4D1522818600CD8910 /* DFGMinifiedNode.cpp in Sources */,
    48164844                                A737810D1799EA2E00817533 /* DFGNaturalLoops.cpp in Sources */,
    4817                                 7C15F65D17C199CE00794D40 /* JSPromiseCallback.cpp in Sources */,
    48184845                                0FF0F19C16B72A03005DF95B /* DFGNode.cpp in Sources */,
    48194846                                0FA581BA150E952C00B9A2D9 /* DFGNodeFlags.cpp in Sources */,
     
    48354862                                86BB09C0138E381B0056702F /* DFGRepatch.cpp in Sources */,
    48364863                                86EC9DD21328DF82002B2AD7 /* DFGSpeculativeJIT.cpp in Sources */,
    4837                                 7C3BA29617C039560072DDC9 /* JSPromiseResolverConstructor.cpp in Sources */,
    48384864                                86880F1F14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp in Sources */,
    48394865                                86880F4D14353B2100B08D42 /* DFGSpeculativeJIT64.cpp in Sources */,
     
    48654891                                0FEA0A1E1708B00700BB722C /* FTLAbstractHeapRepository.cpp in Sources */,
    48664892                                0FEA0A09170513DB00BB722C /* FTLCapabilities.cpp in Sources */,
    4867                                 7C184E1E17BEE22E007CB63A /* JSPromisePrototype.cpp in Sources */,
    48684893                                0F235BD117178E1C00690C7F /* FTLCArgumentGetter.cpp in Sources */,
    48694894                                0FEA0A271709623B00BB722C /* FTLCommonValues.cpp in Sources */,
     
    49244949                                14A23D750F4E1ABB0023CDAD /* JITStubs.cpp in Sources */,
    49254950                                0F5EF91E16878F7A003E5C25 /* JITThunks.cpp in Sources */,
     4951                                0FC712E217CD8791008CC93C /* JITToDFGDeferredCompilationCallback.cpp in Sources */,
    49264952                                140B7D1D0DC69AF7009C42B8 /* JSActivation.cpp in Sources */,
    49274953                                140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */,
    49284954                                C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.mm in Sources */,
    4929                                 7C3BA29417C039560072DDC9 /* JSPromiseResolver.cpp in Sources */,
    49304955                                147F39D0107EC37600427A48 /* JSArray.cpp in Sources */,
    49314956                                0F2B66E217B6B5AB00A7AE3F /* JSArrayBuffer.cpp in Sources */,
     
    49524977                                14280875107EC13E0013E7B2 /* JSLock.cpp in Sources */,
    49534978                                C25D709B16DE99F400FCA6BC /* JSManagedValue.mm in Sources */,
     4979                                A700874117CBE8EB00C3E643 /* JSMap.cpp in Sources */,
    49544980                                14874AE315EBDE4A002E3587 /* JSNameScope.cpp in Sources */,
    49554981                                A72700900DAC6BBC00E548D7 /* JSNotAnObject.cpp in Sources */,
     
    49584984                                A7F993600FD7325100A0B2D0 /* JSONObject.cpp in Sources */,
    49594985                                95F6E6950E5B5F970091E860 /* JSProfilerPrivate.cpp in Sources */,
     4986                                7C184E1A17BEDBD3007CB63A /* JSPromise.cpp in Sources */,
     4987                                7C15F65D17C199CE00794D40 /* JSPromiseCallback.cpp in Sources */,
     4988                                7C184E2217BEE240007CB63A /* JSPromiseConstructor.cpp in Sources */,
     4989                                7C184E1E17BEE22E007CB63A /* JSPromisePrototype.cpp in Sources */,
     4990                                7C3BA29417C039560072DDC9 /* JSPromiseResolver.cpp in Sources */,
     4991                                7C3BA29617C039560072DDC9 /* JSPromiseResolverConstructor.cpp in Sources */,
     4992                                7C3BA29817C039560072DDC9 /* JSPromiseResolverPrototype.cpp in Sources */,
    49604993                                A727FF6B0DA3092200E548D7 /* JSPropertyNameIterator.cpp in Sources */,
    49614994                                862553D116136DA9009F17D0 /* JSProxy.cpp in Sources */,
     
    49895022                                FE20CE9D15F04A9500DF3430 /* LLIntCLoop.cpp in Sources */,
    49905023                                0F4680D214BBD16500BFE272 /* LLIntData.cpp in Sources */,
     5024                                0F38B01117CF078000B144D3 /* LLIntEntrypoint.cpp in Sources */,
    49915025                                0F4680A814BA7FAB00BFE272 /* LLIntExceptions.cpp in Sources */,
    49925026                                0F4680A414BA7F8D00BFE272 /* LLIntSlowPaths.cpp in Sources */,
     
    49965030                                0F4680CC14BBB17A00BFE272 /* LowLevelInterpreter.cpp in Sources */,
    49975031                                14B723B212D7DA46003BD5ED /* MachineStackMarker.cpp in Sources */,
    4998                                 7C184E1A17BEDBD3007CB63A /* JSPromise.cpp in Sources */,
    49995032                                0FEB3ECF16237F6C00AB67AD /* MacroAssembler.cpp in Sources */,
    50005033                                86C568E011A213EE0007F7F0 /* MacroAssemblerARM.cpp in Sources */,
    50015034                                A729009C17976C6000317298 /* MacroAssemblerARMv7.cpp in Sources */,
    50025035                                A7A4AE0817973B26005612B1 /* MacroAssemblerX86Common.cpp in Sources */,
     5036                                A700873917CBE85300C3E643 /* MapConstructor.cpp in Sources */,
     5037                                A78507D617CBC6FD0011F6E7 /* MapData.cpp in Sources */,
     5038                                A700873D17CBE8D300C3E643 /* MapPrototype.cpp in Sources */,
    50035039                                C2B916C514DA040C00CBAC86 /* MarkedAllocator.cpp in Sources */,
    50045040                                142D6F0813539A2800B02E86 /* MarkedBlock.cpp in Sources */,
     
    50275063                                148F21BC107EC54D0042EC2C /* Parser.cpp in Sources */,
    50285064                                93052C340FB792190048FDC3 /* ParserArena.cpp in Sources */,
    5029                                 0FC712E217CD8791008CC93C /* JITToDFGDeferredCompilationCallback.cpp in Sources */,
    50305065                                0F9FC8C314E1B5FE00D52AE0 /* PolymorphicPutByIdList.cpp in Sources */,
    50315066                                0F98206016BFE38100240D02 /* PreciseJumpTargets.cpp in Sources */,
     
    50475082                                A7FB60A4103F7DC20017A286 /* PropertyDescriptor.cpp in Sources */,
    50485083                                14469DE7107EC7E700650446 /* PropertyNameArray.cpp in Sources */,
    5049                                 0F38B01117CF078000B144D3 /* LLIntEntrypoint.cpp in Sources */,
    50505084                                14469DE8107EC7E700650446 /* PropertySlot.cpp in Sources */,
    50515085                                ADE39FFF16DD144B0003CD4A /* PropertyTable.cpp in Sources */,
     
    50535087                                0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */,
    50545088                                0FF60AC316740F8800029779 /* ReduceWhitespace.cpp in Sources */,
    5055                                 7C184E2217BEE240007CB63A /* JSPromiseConstructor.cpp in Sources */,
    50565089                                14280841107EC0930013E7B2 /* RegExp.cpp in Sources */,
    50575090                                A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */,
     
    51075140                                14F7256514EE265E00B1652B /* WeakHandleOwner.cpp in Sources */,
    51085141                                14E84FA014EE1ACC00D6D5D4 /* WeakSet.cpp in Sources */,
    5109                                 0FC712DE17CD8779008CC93C /* DeferredCompilationCallback.cpp in Sources */,
    51105142                                0F6E5C191724AF3D005C574F /* WebKitLLVMLibraryAnchor.cpp in Sources */,
    51115143                                0FC8150B14043C0E00CFA603 /* WriteBarrierSupport.cpp in Sources */,
  • trunk/Source/JavaScriptCore/Target.pri

    r154854 r154861  
    324324    runtime/JSGlobalObjectFunctions.cpp \
    325325    runtime/JSLock.cpp \
     326    runtime/JSMap.cpp \
     327    runtime/JSMapConstructor.cpp \
     328    runtime/JSPrototype.cpp \
     329    runtime/JSNameScope.cpp \
    326330    runtime/JSNameScope.cpp \
    327331    runtime/JSNotAnObject.cpp \
     
    350354    runtime/LiteralParser.cpp \
    351355    runtime/Lookup.cpp \
     356    runtime/MapData.cpp \
    352357    runtime/MathObject.cpp \
    353358    runtime/MemoryStatistics.cpp \
  • trunk/Source/JavaScriptCore/heap/CopyToken.h

    r154127 r154861  
    3131enum CopyToken {
    3232    ButterflyCopyToken,
    33     TypedArrayVectorCopyToken
     33    TypedArrayVectorCopyToken,
     34    MapBackingStoreCopyToken
    3435};
    3536
  • trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h

    r154629 r154861  
    137137    macro(valueOf) \
    138138    macro(window) \
    139     macro(writable)
     139    macro(writable) \
     140    macro(has) \
     141    macro(forEach) \
     142    macro(clear) \
     143    macro(size) \
     144    macro(Map)
    140145
    141146#define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r154853 r154861  
    6565#include "JSGlobalObjectFunctions.h"
    6666#include "JSLock.h"
     67#include "JSMap.h"
    6768#include "JSNameScope.h"
    6869#include "JSONObject.h"
     
    7374#include "LegacyProfiler.h"
    7475#include "Lookup.h"
     76#include "MapConstructor.h"
     77#include "MapData.h"
     78#include "MapPrototype.h"
    7579#include "MathObject.h"
    7680#include "NameConstructor.h"
     
    318322#endif // ENABLE(PROMISES)
    319323
     324
     325    m_mapDataStructure.set(exec->vm(), this, MapData::createStructure(exec->vm(), this, jsNull()));
     326    m_mapPrototype.set(exec->vm(), this, MapPrototype::create(exec, this, MapPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
     327    m_mapStructure.set(exec->vm(), this, JSMap::createStructure(exec->vm(), this, m_mapPrototype.get()));
     328
    320329    // Constructors
    321330
     
    332341    JSCell* promiseResolverConstructor = JSPromiseResolverConstructor::create(exec, this, JSPromiseResolverConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_promiseResolverPrototype.get());
    333342#endif // ENABLE(PROMISES)
     343    JSCell* mapConstructor = MapConstructor::create(exec, this, MapConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_mapPrototype.get());
    334344
    335345    m_regExpConstructor.set(exec->vm(), this, RegExpConstructor::create(exec, this, RegExpConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_regExpPrototype.get()));
     
    359369    m_promiseResolverPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, promiseResolverConstructor, DontEnum);
    360370#endif
     371    m_mapPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, mapConstructor, DontEnum);
    361372
    362373    putDirectWithoutTransition(exec->vm(), exec->propertyNames().Object, objectConstructor, DontEnum);
     
    379390    putDirectWithoutTransition(exec->vm(), exec->propertyNames().PromiseResolver, promiseResolverConstructor, DontEnum);
    380391#endif
     392    putDirectWithoutTransition(exec->vm(), exec->propertyNames().Map, mapConstructor, DontEnum);
    381393
    382394    m_evalFunction.set(exec->vm(), this, JSFunction::create(exec, this, 1, exec->propertyNames().eval.string(), globalFuncEval));
     
    639651    visitor.append(&thisObject->m_promiseWrapperCallbackStructure);
    640652#endif // ENABLE(PROMISES)
     653    visitor.append(&thisObject->m_mapPrototype);
     654    visitor.append(&thisObject->m_mapDataStructure);
     655    visitor.append(&thisObject->m_mapStructure);
    641656
    642657    visitor.append(&thisObject->m_arrayBufferPrototype);
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r154847 r154861  
    6464class JSStack;
    6565class LLIntOffsetsExtractor;
     66class MapPrototype;
    6667class NativeErrorConstructor;
    6768class ProgramCodeBlock;
     
    151152    WriteBarrier<JSPromisePrototype> m_promisePrototype;
    152153    WriteBarrier<JSPromiseResolverPrototype> m_promiseResolverPrototype;
     154    WriteBarrier<MapPrototype> m_mapPrototype;
    153155
    154156    WriteBarrier<Structure> m_withScopeStructure;
     
    192194#endif // ENABLE(PROMISES)
    193195
     196    WriteBarrier<Structure> m_mapDataStructure;
     197    WriteBarrier<Structure> m_mapStructure;
     198   
    194199    WriteBarrier<JSArrayBufferPrototype> m_arrayBufferPrototype;
    195200    WriteBarrier<Structure> m_arrayBufferStructure;
     
    382387    Structure* privateNameStructure() const { return m_privateNameStructure.get(); }
    383388    Structure* internalFunctionStructure() const { return m_internalFunctionStructure.get(); }
     389    Structure* mapStructure() const { return m_mapStructure.get(); }
     390    Structure* mapDataStructure() const { return m_mapDataStructure.get(); }
    384391    Structure* regExpMatchesArrayStructure() const { return m_regExpMatchesArrayStructure.get(); }
    385392    Structure* regExpStructure() const { return m_regExpStructure.get(); }
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r154853 r154861  
    5959#include "Lexer.h"
    6060#include "Lookup.h"
     61#include "MapData.h"
    6162#include "Nodes.h"
    6263#include "ParserArena.h"
Note: See TracChangeset for help on using the changeset viewer.