Changeset 154629 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Aug 26, 2013, 12:19:50 PM (12 years ago)
Author:
[email protected]
Message:

Add support for Promises
https://bugs.webkit.org/show_bug.cgi?id=120260

Reviewed by Darin Adler.

Source/JavaScriptCore:

Add an initial implementation of Promises - http://dom.spec.whatwg.org/#promises.

  • Despite Promises being defined in the DOM, the implementation is being put in JSC in preparation for the Promises eventually being defined in ECMAScript.
  • CMakeLists.txt:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:

Add new files.

  • jsc.cpp:

Update jsc's GlobalObjectMethodTable to stub out the new QueueTaskToEventLoop callback. This mean's
you can't quite use Promises with with the command line tool yet.

  • interpreter/CallFrame.h:

(JSC::ExecState::promisePrototypeTable):
(JSC::ExecState::promiseConstructorTable):
(JSC::ExecState::promiseResolverPrototypeTable):

  • runtime/VM.cpp:

(JSC::VM::VM):
(JSC::VM::~VM):

  • runtime/VM.h:

Add supporting code for the new static lookup tables.

  • runtime/CommonIdentifiers.h:

Add 3 new identifiers, "Promise", "PromiseResolver", and "then".

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::reset):
(JSC::JSGlobalObject::visitChildren):
Add supporting code Promise and PromiseResolver's constructors and structures.

  • runtime/JSGlobalObject.h:

(JSC::TaskContext::~TaskContext):
Add a new callback to the GlobalObjectMethodTable to post a task on the embedder's runloop.

(JSC::JSGlobalObject::promisePrototype):
(JSC::JSGlobalObject::promiseResolverPrototype):
(JSC::JSGlobalObject::promiseStructure):
(JSC::JSGlobalObject::promiseResolverStructure):
(JSC::JSGlobalObject::promiseCallbackStructure):
(JSC::JSGlobalObject::promiseWrapperCallbackStructure):
Add supporting code Promise and PromiseResolver's constructors and structures.

  • runtime/JSPromise.cpp: Added.
  • runtime/JSPromise.h: Added.
  • runtime/JSPromiseCallback.cpp: Added.
  • runtime/JSPromiseCallback.h: Added.
  • runtime/JSPromiseConstructor.cpp: Added.
  • runtime/JSPromiseConstructor.h: Added.
  • runtime/JSPromisePrototype.cpp: Added.
  • runtime/JSPromisePrototype.h: Added.
  • runtime/JSPromiseResolver.cpp: Added.
  • runtime/JSPromiseResolver.h: Added.
  • runtime/JSPromiseResolverConstructor.cpp: Added.
  • runtime/JSPromiseResolverConstructor.h: Added.
  • runtime/JSPromiseResolverPrototype.cpp: Added.
  • runtime/JSPromiseResolverPrototype.h: Added.

Add Promise implementation.

Source/WebCore:

Add an initial implementation of Promises - http://dom.spec.whatwg.org/#promises.

  • Despite Promises being defined in the DOM, the implementation is being put in JSC in preparation for the Promises eventually being defined in ECMAScript.

Tests: fast/js/Promise-already-fulfilled.html

fast/js/Promise-already-rejected.html
fast/js/Promise-already-resolved.html
fast/js/Promise-catch-in-workers.html
fast/js/Promise-catch.html
fast/js/Promise-chain.html
fast/js/Promise-exception.html
fast/js/Promise-fulfill-in-workers.html
fast/js/Promise-fulfill.html
fast/js/Promise-init-in-workers.html
fast/js/Promise-init.html
fast/js/Promise-reject-in-workers.html
fast/js/Promise-reject.html
fast/js/Promise-resolve-chain.html
fast/js/Promise-resolve-in-workers.html
fast/js/Promise-resolve-with-then-exception.html
fast/js/Promise-resolve-with-then-fulfill.html
fast/js/Promise-resolve-with-then-reject.html
fast/js/Promise-resolve.html
fast/js/Promise-simple-fulfill-inside-callback.html
fast/js/Promise-simple-fulfill.html
fast/js/Promise-simple-in-workers.html
fast/js/Promise-simple.html
fast/js/Promise-static-fulfill.html
fast/js/Promise-static-reject.html
fast/js/Promise-static-resolve.html
fast/js/Promise-then-in-workers.html
fast/js/Promise-then-without-callbacks-in-workers.html
fast/js/Promise-then-without-callbacks.html
fast/js/Promise-then.html
fast/js/Promise-types.html
fast/js/Promise.html

  • GNUmakefile.list.am:
  • Target.pri:
  • UseJSC.cmake:
  • WebCore.vcxproj/WebCore.vcxproj:
  • WebCore.vcxproj/WebCore.vcxproj.filters:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSBindingsAllInOne.cpp:

Add new files.

  • bindings/js/JSDOMGlobalObjectTask.cpp: Added.

(WebCore::JSGlobalObjectCallback::create):
(WebCore::JSGlobalObjectCallback::~JSGlobalObjectCallback):
(WebCore::JSGlobalObjectCallback::call):
(WebCore::JSGlobalObjectCallback::JSGlobalObjectCallback):
(WebCore::JSGlobalObjectTask::JSGlobalObjectTask):
(WebCore::JSGlobalObjectTask::~JSGlobalObjectTask):
(WebCore::JSGlobalObjectTask::performTask):

  • bindings/js/JSDOMGlobalObjectTask.h: Added.

(WebCore::JSGlobalObjectTask::create):
Add a new task type to be used with the GlobalObjectMethodTable's new QueueTaskToEventLoop callback.

  • bindings/js/JSDOMWindowBase.cpp:

(WebCore::JSDOMWindowBase::queueTaskToEventLoop):

  • bindings/js/JSDOMWindowBase.h:

Implement the GlobalObjectMethodTable callback, QueueTaskToEventLoop.

  • bindings/js/JSMainThreadExecState.h:

All using JSMainThreadExecState as a simple RAII object.

  • bindings/js/JSWorkerGlobalScopeBase.cpp:

(WebCore::JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase):
(WebCore::JSWorkerGlobalScopeBase::allowsAccessFrom):
(WebCore::JSWorkerGlobalScopeBase::supportsProfiling):
(WebCore::JSWorkerGlobalScopeBase::supportsRichSourceInfo):
(WebCore::JSWorkerGlobalScopeBase::shouldInterruptScript):
(WebCore::JSWorkerGlobalScopeBase::javaScriptExperimentsEnabled):
(WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):

  • bindings/js/JSWorkerGlobalScopeBase.h:

Add a GlobalObjectMethodTable and implement QueueTaskToEventLoop. Forward the other callbacks
to JSGlobalObject so they retain their existing behavior.

LayoutTests:

Add tests adapted from the Mozilla and Blink projects.

  • fast/js/Promise-already-fulfilled-expected.txt: Added.
  • fast/js/Promise-already-fulfilled.html: Added.
  • fast/js/Promise-already-rejected-expected.txt: Added.
  • fast/js/Promise-already-rejected.html: Added.
  • fast/js/Promise-already-resolved-expected.txt: Added.
  • fast/js/Promise-already-resolved.html: Added.
  • fast/js/Promise-catch-expected.txt: Added.
  • fast/js/Promise-catch-in-workers-expected.txt: Added.
  • fast/js/Promise-catch-in-workers.html: Added.
  • fast/js/Promise-catch.html: Added.
  • fast/js/Promise-chain-expected.txt: Added.
  • fast/js/Promise-chain.html: Added.
  • fast/js/Promise-exception-expected.txt: Added.
  • fast/js/Promise-exception.html: Added.
  • fast/js/Promise-expected.txt: Added.
  • fast/js/Promise-fulfill-expected.txt: Added.
  • fast/js/Promise-fulfill-in-workers-expected.txt: Added.
  • fast/js/Promise-fulfill-in-workers.html: Added.
  • fast/js/Promise-fulfill.html: Added.
  • fast/js/Promise-init-expected.txt: Added.
  • fast/js/Promise-init-in-workers-expected.txt: Added.
  • fast/js/Promise-init-in-workers.html: Added.
  • fast/js/Promise-init.html: Added.
  • fast/js/Promise-reject-expected.txt: Added.
  • fast/js/Promise-reject-in-workers-expected.txt: Added.
  • fast/js/Promise-reject-in-workers.html: Added.
  • fast/js/Promise-reject.html: Added.
  • fast/js/Promise-resolve-chain-expected.txt: Added.
  • fast/js/Promise-resolve-chain.html: Added.
  • fast/js/Promise-resolve-expected.txt: Added.
  • fast/js/Promise-resolve-in-workers-expected.txt: Added.
  • fast/js/Promise-resolve-in-workers.html: Added.
  • fast/js/Promise-resolve-with-then-exception-expected.txt: Added.
  • fast/js/Promise-resolve-with-then-exception.html: Added.
  • fast/js/Promise-resolve-with-then-fulfill-expected.txt: Added.
  • fast/js/Promise-resolve-with-then-fulfill.html: Added.
  • fast/js/Promise-resolve-with-then-reject-expected.txt: Added.
  • fast/js/Promise-resolve-with-then-reject.html: Added.
  • fast/js/Promise-resolve.html: Added.
  • fast/js/Promise-simple-expected.txt: Added.
  • fast/js/Promise-simple-fulfill-expected.txt: Added.
  • fast/js/Promise-simple-fulfill-inside-callback-expected.txt: Added.
  • fast/js/Promise-simple-fulfill-inside-callback.html: Added.
  • fast/js/Promise-simple-fulfill.html: Added.
  • fast/js/Promise-simple-in-workers-expected.txt: Added.
  • fast/js/Promise-simple-in-workers.html: Added.
  • fast/js/Promise-simple.html: Added.
  • fast/js/Promise-static-fulfill-expected.txt: Added.
  • fast/js/Promise-static-fulfill.html: Added.
  • fast/js/Promise-static-reject-expected.txt: Added.
  • fast/js/Promise-static-reject.html: Added.
  • fast/js/Promise-static-resolve-expected.txt: Added.
  • fast/js/Promise-static-resolve.html: Added.
  • fast/js/Promise-then-expected.txt: Added.
  • fast/js/Promise-then-in-workers-expected.txt: Added.
  • fast/js/Promise-then-in-workers.html: Added.
  • fast/js/Promise-then-without-callbacks-expected.txt: Added.
  • fast/js/Promise-then-without-callbacks-in-workers-expected.txt: Added.
  • fast/js/Promise-then-without-callbacks-in-workers.html: Added.
  • fast/js/Promise-then-without-callbacks.html: Added.
  • fast/js/Promise-then.html: Added.
  • fast/js/Promise-types-expected.txt: Added.
  • fast/js/Promise-types.html: Added.
  • fast/js/Promise.html: Added.
  • fast/js/resources/Promise-catch-in-workers.js: Added.
  • fast/js/resources/Promise-fulfill-in-workers.js: Added.
  • fast/js/resources/Promise-init-in-workers.js: Added.
  • fast/js/resources/Promise-reject-in-workers.js: Added.
  • fast/js/resources/Promise-resolve-in-workers.js: Added.
  • fast/js/resources/Promise-simple-in-workers.js: Added.
  • fast/js/resources/Promise-then-in-workers.js: Added.
  • fast/js/resources/Promise-then-without-callbacks-in-workers.js: Added.
Location:
trunk/Source/JavaScriptCore
Files:
14 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r154162 r154629  
    335335    runtime/JSONObject.cpp
    336336    runtime/JSObject.cpp
     337    runtime/JSPromise.cpp
     338    runtime/JSPromiseCallback.cpp
     339    runtime/JSPromiseConstructor.cpp
     340    runtime/JSPromisePrototype.cpp
     341    runtime/JSPromiseResolver.cpp
     342    runtime/JSPromiseResolverConstructor.cpp
     343    runtime/JSPromiseResolverPrototype.cpp
    337344    runtime/JSPropertyNameIterator.cpp
    338345    runtime/JSProxy.cpp
     
    416423    runtime/JSGlobalObject.cpp
    417424    runtime/JSONObject.cpp
     425    runtime/JSPromiseConstructor.cpp
     426    runtime/JSPromisePrototype.cpp
     427    runtime/JSPromiseResolverPrototype.cpp
    418428    runtime/NamePrototype.cpp
    419429    runtime/NumberConstructor.cpp
  • trunk/Source/JavaScriptCore/ChangeLog

    r154626 r154629  
     12013-08-24  Sam Weinig  <[email protected]>
     2
     3        Add support for Promises
     4        https://bugs.webkit.org/show_bug.cgi?id=120260
     5
     6        Reviewed by Darin Adler.
     7
     8        Add an initial implementation of Promises - http://dom.spec.whatwg.org/#promises.
     9        - Despite Promises being defined in the DOM, the implementation is being put in JSC
     10          in preparation for the Promises eventually being defined in ECMAScript.
     11
     12        * CMakeLists.txt:
     13        * DerivedSources.make:
     14        * DerivedSources.pri:
     15        * GNUmakefile.list.am:
     16        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
     17        * JavaScriptCore.xcodeproj/project.pbxproj:
     18        * Target.pri:
     19        Add new files.
     20
     21        * jsc.cpp:
     22        Update jsc's GlobalObjectMethodTable to stub out the new QueueTaskToEventLoop callback. This mean's
     23        you can't quite use Promises with with the command line tool yet.
     24   
     25        * interpreter/CallFrame.h:
     26        (JSC::ExecState::promisePrototypeTable):
     27        (JSC::ExecState::promiseConstructorTable):
     28        (JSC::ExecState::promiseResolverPrototypeTable):
     29        * runtime/VM.cpp:
     30        (JSC::VM::VM):
     31        (JSC::VM::~VM):
     32        * runtime/VM.h:
     33        Add supporting code for the new static lookup tables.
     34
     35        * runtime/CommonIdentifiers.h:
     36        Add 3 new identifiers, "Promise", "PromiseResolver", and "then".
     37
     38        * runtime/JSGlobalObject.cpp:
     39        (JSC::JSGlobalObject::reset):
     40        (JSC::JSGlobalObject::visitChildren):
     41        Add supporting code Promise and PromiseResolver's constructors and structures.
     42
     43        * runtime/JSGlobalObject.h:
     44        (JSC::TaskContext::~TaskContext):
     45        Add a new callback to the GlobalObjectMethodTable to post a task on the embedder's runloop.
     46
     47        (JSC::JSGlobalObject::promisePrototype):
     48        (JSC::JSGlobalObject::promiseResolverPrototype):
     49        (JSC::JSGlobalObject::promiseStructure):
     50        (JSC::JSGlobalObject::promiseResolverStructure):
     51        (JSC::JSGlobalObject::promiseCallbackStructure):
     52        (JSC::JSGlobalObject::promiseWrapperCallbackStructure):
     53        Add supporting code Promise and PromiseResolver's constructors and structures.
     54
     55        * runtime/JSPromise.cpp: Added.
     56        * runtime/JSPromise.h: Added.
     57        * runtime/JSPromiseCallback.cpp: Added.
     58        * runtime/JSPromiseCallback.h: Added.
     59        * runtime/JSPromiseConstructor.cpp: Added.
     60        * runtime/JSPromiseConstructor.h: Added.
     61        * runtime/JSPromisePrototype.cpp: Added.
     62        * runtime/JSPromisePrototype.h: Added.
     63        * runtime/JSPromiseResolver.cpp: Added.
     64        * runtime/JSPromiseResolver.h: Added.
     65        * runtime/JSPromiseResolverConstructor.cpp: Added.
     66        * runtime/JSPromiseResolverConstructor.h: Added.
     67        * runtime/JSPromiseResolverPrototype.cpp: Added.
     68        * runtime/JSPromiseResolverPrototype.h: Added.
     69        Add Promise implementation.
     70
    1712013-08-26  Zan Dobersek  <[email protected]>
    272
  • trunk/Source/JavaScriptCore/DerivedSources.make

    r154127 r154629  
    4545    JSONObject.lut.h \
    4646    JSGlobalObject.lut.h \
     47    JSPromisePrototype.lut.h \
     48    JSPromiseConstructor.lut.h \
     49    JSPromiseResolverPrototype.lut.h \
    4750    KeywordLookup.h \
    4851    Lexer.lut.h \
  • trunk/Source/JavaScriptCore/DerivedSources.pri

    r154127 r154629  
    1717    runtime/JSGlobalObject.cpp \
    1818    runtime/JSONObject.cpp \
     19    runtime/JSPromiseConstructor.cpp \
     20    runtime/JSPromisePrototype.cpp \
     21    runtime/JSPromiseResolverPrototype.cpp \
    1922    runtime/MathObject.cpp \
    2023    runtime/NamePrototype.cpp \
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r154569 r154629  
    2121        DerivedSources/JavaScriptCore/JSGlobalObject.lut.h \
    2222        DerivedSources/JavaScriptCore/JSONObject.lut.h \
     23        DerivedSources/JavaScriptCore/JSPromiseConstructor.lut.h \
     24        DerivedSources/JavaScriptCore/JSPromisePrototype.lut.h \
     25        DerivedSources/JavaScriptCore/JSPromiseResolverPrototype.lut.h \
    2326        DerivedSources/JavaScriptCore/MathObject.lut.h \
    2427        DerivedSources/JavaScriptCore/NamePrototype.lut.h \
     
    812815        Source/JavaScriptCore/runtime/JSONObject.cpp \
    813816        Source/JavaScriptCore/runtime/JSONObject.h \
     817        Source/JavaScriptCore/runtime/JSPromise.cpp \
     818        Source/JavaScriptCore/runtime/JSPromise.h \
     819        Source/JavaScriptCore/runtime/JSPromiseCallback.cpp \
     820        Source/JavaScriptCore/runtime/JSPromiseCallback.h \
     821        Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp \
     822        Source/JavaScriptCore/runtime/JSPromiseConstructor.h \
     823        Source/JavaScriptCore/runtime/JSPromisePrototype.cpp \
     824        Source/JavaScriptCore/runtime/JSPromisePrototype.h \
     825        Source/JavaScriptCore/runtime/JSPromiseResolver.cpp \
     826        Source/JavaScriptCore/runtime/JSPromiseResolver.h \
     827        Source/JavaScriptCore/runtime/JSPromiseResolverConstructor.cpp \
     828        Source/JavaScriptCore/runtime/JSPromiseResolverConstructor.h \
     829        Source/JavaScriptCore/runtime/JSPromiseResolverPrototype.cpp \
     830        Source/JavaScriptCore/runtime/JSPromiseResolverPrototype.h \
    814831        Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp \
    815832        Source/JavaScriptCore/runtime/JSPropertyNameIterator.h \
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj

    r154569 r154629  
    469469    <ClCompile Include="..\runtime\JSONObject.cpp" />
    470470    <ClCompile Include="..\runtime\JSObject.cpp" />
     471    <ClInclude Include="..\runtime\JSPromise.cpp" />
     472    <ClInclude Include="..\runtime\JSPromiseCallback.cpp" />
     473    <ClInclude Include="..\runtime\JSPromiseConstructor.cpp" />
     474    <ClInclude Include="..\runtime\JSPromisePrototype.cpp" />
     475    <ClInclude Include="..\runtime\JSPromiseResolver.cpp" />
     476    <ClInclude Include="..\runtime\JSPromiseResolverConstructor.cpp" />
     477    <ClInclude Include="..\runtime\JSPromiseResolverPrototype.cpp" />
    471478    <ClCompile Include="..\runtime\JSPropertyNameIterator.cpp" />
    472479    <ClCompile Include="..\runtime\JSProxy.cpp" />
     
    544551    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSGlobalObject.lut.h" />
    545552    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSONObject.lut.h" />
     553    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSPromiseConstructor.lut.h" />
     554    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSPromisePrototype.lut.h" />
     555    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSPromiseResolverPrototype.lut.h" />
    546556    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\Lexer.lut.h" />
    547557    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\LLIntAssembly.h" />
     
    881891    <ClInclude Include="..\runtime\JSONObject.h" />
    882892    <ClInclude Include="..\runtime\JSObject.h" />
     893    <ClInclude Include="..\runtime\JSPromise.h" />
     894    <ClInclude Include="..\runtime\JSPromiseCallback.h" />
     895    <ClInclude Include="..\runtime\JSPromiseConstructor.h" />
     896    <ClInclude Include="..\runtime\JSPromisePrototype.h" />
     897    <ClInclude Include="..\runtime\JSPromiseResolver.h" />
     898    <ClInclude Include="..\runtime\JSPromiseResolverConstructor.h" />
     899    <ClInclude Include="..\runtime\JSPromiseResolverPrototype.h" />
    883900    <ClInclude Include="..\runtime\JSPropertyNameIterator.h" />
    884901    <ClInclude Include="..\runtime\JSProxy.h" />
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r154569 r154629  
    650650                65C0285C1717966800351E35 /* ARMv7DOpcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C0285A1717966800351E35 /* ARMv7DOpcode.cpp */; };
    651651                65C0285D1717966800351E35 /* ARMv7DOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C0285B1717966800351E35 /* ARMv7DOpcode.h */; };
     652                7C15F65D17C199CE00794D40 /* JSPromiseCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C15F65B17C199CE00794D40 /* JSPromiseCallback.cpp */; };
     653                7C15F65E17C199CE00794D40 /* JSPromiseCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C15F65C17C199CE00794D40 /* JSPromiseCallback.h */; };
     654                7C184E1A17BEDBD3007CB63A /* JSPromise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C184E1817BEDBD3007CB63A /* JSPromise.cpp */; };
     655                7C184E1B17BEDBD3007CB63A /* JSPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C184E1917BEDBD3007CB63A /* JSPromise.h */; };
     656                7C184E1E17BEE22E007CB63A /* JSPromisePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C184E1C17BEE22E007CB63A /* JSPromisePrototype.cpp */; };
     657                7C184E1F17BEE22E007CB63A /* JSPromisePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C184E1D17BEE22E007CB63A /* JSPromisePrototype.h */; };
     658                7C184E2217BEE240007CB63A /* JSPromiseConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C184E2017BEE240007CB63A /* JSPromiseConstructor.cpp */; };
     659                7C184E2317BEE240007CB63A /* JSPromiseConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C184E2117BEE240007CB63A /* JSPromiseConstructor.h */; };
     660                7C3BA29417C039560072DDC9 /* JSPromiseResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3BA28E17C039560072DDC9 /* JSPromiseResolver.cpp */; };
     661                7C3BA29517C039560072DDC9 /* JSPromiseResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3BA28F17C039560072DDC9 /* JSPromiseResolver.h */; };
     662                7C3BA29617C039560072DDC9 /* JSPromiseResolverConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3BA29017C039560072DDC9 /* JSPromiseResolverConstructor.cpp */; };
     663                7C3BA29717C039560072DDC9 /* JSPromiseResolverConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3BA29117C039560072DDC9 /* JSPromiseResolverConstructor.h */; };
     664                7C3BA29817C039560072DDC9 /* JSPromiseResolverPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3BA29217C039560072DDC9 /* JSPromiseResolverPrototype.cpp */; };
     665                7C3BA29917C039560072DDC9 /* JSPromiseResolverPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3BA29317C039560072DDC9 /* JSPromiseResolverPrototype.h */; };
    652666                7E4EE7090EBB7963005934AA /* StructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4EE7080EBB7963005934AA /* StructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; };
    653667                7E4EE70F0EBB7A5B005934AA /* StructureChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */; };
     
    10131027                BC18C47A0E16F5CD00B34460 /* WebKitAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; };
    10141028                BC18C5240E16FC8A00B34460 /* ArrayPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */; };
    1015                 BC18C5260E16FCA700B34460 /* StringPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C5250E16FCA700B34460 /* StringPrototype.lut.h */; };
    1016                 BC18C52A0E16FCC200B34460 /* MathObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C5290E16FCC200B34460 /* MathObject.lut.h */; };
    10171029                BC18C52C0E16FCD200B34460 /* RegExpObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */; };
    10181030                BC18C52E0E16FCE100B34460 /* Lexer.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52D0E16FCE100B34460 /* Lexer.lut.h */; };
     
    17801792                65EA73630BAE35D1001BB560 /* CommonIdentifiers.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CommonIdentifiers.h; sourceTree = "<group>"; };
    17811793                704FD35305697E6D003DBED9 /* BooleanObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = BooleanObject.h; sourceTree = "<group>"; tabWidth = 8; };
     1794                7C15F65B17C199CE00794D40 /* JSPromiseCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPromiseCallback.cpp; sourceTree = "<group>"; };
     1795                7C15F65C17C199CE00794D40 /* JSPromiseCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPromiseCallback.h; sourceTree = "<group>"; };
     1796                7C184E1817BEDBD3007CB63A /* JSPromise.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPromise.cpp; sourceTree = "<group>"; };
     1797                7C184E1917BEDBD3007CB63A /* JSPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPromise.h; sourceTree = "<group>"; };
     1798                7C184E1C17BEE22E007CB63A /* JSPromisePrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPromisePrototype.cpp; sourceTree = "<group>"; };
     1799                7C184E1D17BEE22E007CB63A /* JSPromisePrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPromisePrototype.h; sourceTree = "<group>"; };
     1800                7C184E2017BEE240007CB63A /* JSPromiseConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPromiseConstructor.cpp; sourceTree = "<group>"; };
     1801                7C184E2117BEE240007CB63A /* JSPromiseConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPromiseConstructor.h; sourceTree = "<group>"; };
     1802                7C184E2417BFFA36007CB63A /* JSPromiseConstructor.lut.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSPromiseConstructor.lut.h; sourceTree = "<group>"; };
     1803                7C184E2517BFFA36007CB63A /* JSPromisePrototype.lut.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSPromisePrototype.lut.h; sourceTree = "<group>"; };
     1804                7C3BA28E17C039560072DDC9 /* JSPromiseResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPromiseResolver.cpp; sourceTree = "<group>"; };
     1805                7C3BA28F17C039560072DDC9 /* JSPromiseResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPromiseResolver.h; sourceTree = "<group>"; };
     1806                7C3BA29017C039560072DDC9 /* JSPromiseResolverConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPromiseResolverConstructor.cpp; sourceTree = "<group>"; };
     1807                7C3BA29117C039560072DDC9 /* JSPromiseResolverConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPromiseResolverConstructor.h; sourceTree = "<group>"; };
     1808                7C3BA29217C039560072DDC9 /* JSPromiseResolverPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPromiseResolverPrototype.cpp; sourceTree = "<group>"; };
     1809                7C3BA29317C039560072DDC9 /* JSPromiseResolverPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPromiseResolverPrototype.h; sourceTree = "<group>"; };
     1810                7C3BA29A17C03BE10072DDC9 /* JSPromiseResolverPrototype.lut.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSPromiseResolverPrototype.lut.h; sourceTree = "<group>"; };
    17821811                7E4EE7080EBB7963005934AA /* StructureChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureChain.h; sourceTree = "<group>"; };
    17831812                7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructureChain.cpp; sourceTree = "<group>"; };
     
    21222151                BC18C3C60E16EE3300B34460 /* StringPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringPrototype.h; sourceTree = "<group>"; };
    21232152                BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayPrototype.lut.h; sourceTree = "<group>"; };
    2124                 BC18C5250E16FCA700B34460 /* StringPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringPrototype.lut.h; sourceTree = "<group>"; };
    2125                 BC18C5290E16FCC200B34460 /* MathObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathObject.lut.h; sourceTree = "<group>"; };
    21262153                BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpObject.lut.h; sourceTree = "<group>"; };
    21272154                BC18C52D0E16FCE100B34460 /* Lexer.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lexer.lut.h; sourceTree = "<group>"; };
     
    21572184                BC7952350E15EB5600A898AB /* BooleanPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BooleanPrototype.h; sourceTree = "<group>"; };
    21582185                BC7F8FBA0E19D1EF008632C0 /* JSCell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCell.cpp; sourceTree = "<group>"; };
    2159                 BC8149AF12F89F53007B2C32 /* HeaderDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderDetection.h; sourceTree = "<group>"; };
    21602186                BC87CDB810712ACA000614CF /* JSONObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONObject.lut.h; sourceTree = "<group>"; };
    21612187                BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstructData.h; sourceTree = "<group>"; };
     
    28662892                        isa = PBXGroup;
    28672893                        children = (
     2894                                7C3BA29A17C03BE10072DDC9 /* JSPromiseResolverPrototype.lut.h */,
    28682895                                BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */,
    28692896                                BCD203E70E1718F4002C7E82 /* DatePrototype.lut.h */,
    2870                                 BC8149AF12F89F53007B2C32 /* HeaderDetection.h */,
    28712897                                BC87CDB810712ACA000614CF /* JSONObject.lut.h */,
     2898                                7C184E2417BFFA36007CB63A /* JSPromiseConstructor.lut.h */,
     2899                                7C184E2517BFFA36007CB63A /* JSPromisePrototype.lut.h */,
    28722900                                A7C225CD1399849C00FF1662 /* KeywordLookup.h */,
    28732901                                BC18C52D0E16FCE100B34460 /* Lexer.lut.h */,
    2874                                 BC18C5290E16FCC200B34460 /* MathObject.lut.h */,
    28752902                                BC2680E60E16D52300A06E92 /* NumberConstructor.lut.h */,
    28762903                                BCD202D50E170708002C7E82 /* RegExpConstructor.lut.h */,
    28772904                                A718F61A11754A21002465A7 /* RegExpJitTables.h */,
    28782905                                BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */,
    2879                                 BC18C5250E16FCA700B34460 /* StringPrototype.lut.h */,
    28802906                                5D53727D0E1C55EC0021E549 /* TracingDtrace.h */,
    28812907                        );
     
    31033129                                A7F9935E0FD7325100A0B2D0 /* JSONObject.cpp */,
    31043130                                A7F9935D0FD7325100A0B2D0 /* JSONObject.h */,
     3131                                7C184E1817BEDBD3007CB63A /* JSPromise.cpp */,
     3132                                7C184E1917BEDBD3007CB63A /* JSPromise.h */,
     3133                                7C15F65B17C199CE00794D40 /* JSPromiseCallback.cpp */,
     3134                                7C15F65C17C199CE00794D40 /* JSPromiseCallback.h */,
     3135                                7C184E2017BEE240007CB63A /* JSPromiseConstructor.cpp */,
     3136                                7C184E2117BEE240007CB63A /* JSPromiseConstructor.h */,
     3137                                7C184E1C17BEE22E007CB63A /* JSPromisePrototype.cpp */,
     3138                                7C184E1D17BEE22E007CB63A /* JSPromisePrototype.h */,
     3139                                7C3BA28E17C039560072DDC9 /* JSPromiseResolver.cpp */,
     3140                                7C3BA28F17C039560072DDC9 /* JSPromiseResolver.h */,
     3141                                7C3BA29017C039560072DDC9 /* JSPromiseResolverConstructor.cpp */,
     3142                                7C3BA29117C039560072DDC9 /* JSPromiseResolverConstructor.h */,
     3143                                7C3BA29217C039560072DDC9 /* JSPromiseResolverPrototype.cpp */,
     3144                                7C3BA29317C039560072DDC9 /* JSPromiseResolverPrototype.h */,
    31053145                                A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */,
    31063146                                A727FF650DA3053B00E548D7 /* JSPropertyNameIterator.h */,
     
    37683808                                0F136D4D174AD69E0075B354 /* DeferGC.h in Headers */,
    37693809                                A77A423E17A0BBFD00A8DB81 /* DFGAbstractHeap.h in Headers */,
     3810                                7C15F65E17C199CE00794D40 /* JSPromiseCallback.h in Headers */,
    37703811                                A704D90317A0BAA8006BA554 /* DFGAbstractInterpreter.h in Headers */,
    37713812                                A704D90417A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h in Headers */,
     
    38353876                                A7D89CFC17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.h in Headers */,
    38363877                                0FF0F19B16B729FA005DF95B /* DFGLongLivedState.h in Headers */,
     3878                                7C184E1F17BEE22E007CB63A /* JSPromisePrototype.h in Headers */,
    38373879                                A767B5B617A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h in Headers */,
    38383880                                A704D90717A0BAA8006BA554 /* DFGMergeMode.h in Headers */,
     
    39123954                                0F235BD617178E1C00690C7F /* FTLExitArgumentForOperand.h in Headers */,
    39133955                                0F235BD717178E1C00690C7F /* FTLExitArgumentList.h in Headers */,
     3956                                7C3BA29917C039560072DDC9 /* JSPromiseResolverPrototype.h in Headers */,
    39143957                                0F235BD917178E1C00690C7F /* FTLExitThunkGenerator.h in Headers */,
    39153958                                0F235BDB17178E1C00690C7F /* FTLExitValue.h in Headers */,
     
    39764019                                1429D77C0ED20D7300B89619 /* Interpreter.h in Headers */,
    39774020                                860BD801148EA6F200112B2F /* Intrinsic.h in Headers */,
     4021                                7C3BA29517C039560072DDC9 /* JSPromiseResolver.h in Headers */,
    39784022                                BC18C4130E16F5CD00B34460 /* JavaScript.h in Headers */,
    39794023                                BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */,
     
    41364180                                8612E4CD152389EC00C836BE /* MatchResult.h in Headers */,
    41374181                                BC18C43C0E16F5CD00B34460 /* MathObject.h in Headers */,
    4138                                 BC18C52A0E16FCC200B34460 /* MathObject.lut.h in Headers */,
    41394182                                90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */,
    41404183                                0FB5467B14F5C7E1002C2989 /* MethodOfGettingAValueProfile.h in Headers */,
     
    42014244                                0F9332A414CA7DD90085F3C6 /* PutByIdStatus.h in Headers */,
    42024245                                0F0CD4C215F1A6070032F1C0 /* PutDirectIndexMode.h in Headers */,
     4246                                7C184E1B17BEDBD3007CB63A /* JSPromise.h in Headers */,
     4247                                0F2B66F217B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h in Headers */,
    42034248                                0F9FC8C514E1B60400D52AE0 /* PutKind.h in Headers */,
    42044249                                147B84630E6DE6B1004775A4 /* PutPropertySlot.h in Headers */,
     
    42064251                                BC18C45A0E16F5CD00B34460 /* RegExp.h in Headers */,
    42074252                                A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */,
     4253                                7C3BA29717C039560072DDC9 /* JSPromiseResolverConstructor.h in Headers */,
    42084254                                BCD202C20E1706A7002C7E82 /* RegExpConstructor.h in Headers */,
    42094255                                BCD202D60E170708002C7E82 /* RegExpConstructor.lut.h in Headers */,
     
    42164262                                969A072B0ED1CE6900F1F681 /* RegisterID.h in Headers */,
    42174263                                0FB7F39D15ED8E4600F167B2 /* Reject.h in Headers */,
     4264                                7C184E2317BEE240007CB63A /* JSPromiseConstructor.h in Headers */,
    42184265                                86D3B3C410159D7F002865E7 /* RepatchBuffer.h in Headers */,
    42194266                                869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */,
     
    42424289                                BC18C4680E16F5CD00B34460 /* StringObject.h in Headers */,
    42434290                                BC18C46A0E16F5CD00B34460 /* StringPrototype.h in Headers */,
    4244                                 BC18C5260E16FCA700B34460 /* StringPrototype.lut.h in Headers */,
    42454291                                142E313B134FF0A600AFADB5 /* Strong.h in Headers */,
    42464292                                145722861437E140005FDE26 /* StrongInlines.h in Headers */,
     
    47294775                                C2981FDC17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp in Sources */,
    47304776                                0FF427641591A1CC004CB9FF /* DFGDisassembler.cpp in Sources */,
     4777                                7C3BA29817C039560072DDC9 /* JSPromiseResolverPrototype.cpp in Sources */,
    47314778                                0FD81AD2154FB4EE00983E72 /* DFGDominators.cpp in Sources */,
    47324779                                0FD3C82614115D4000FD81CB /* DFGDriver.cpp in Sources */,
     
    47504797                                0F2BDC4D1522818600CD8910 /* DFGMinifiedNode.cpp in Sources */,
    47514798                                A737810D1799EA2E00817533 /* DFGNaturalLoops.cpp in Sources */,
     4799                                7C15F65D17C199CE00794D40 /* JSPromiseCallback.cpp in Sources */,
    47524800                                0FF0F19C16B72A03005DF95B /* DFGNode.cpp in Sources */,
    47534801                                0FA581BA150E952C00B9A2D9 /* DFGNodeFlags.cpp in Sources */,
     
    47694817                                86BB09C0138E381B0056702F /* DFGRepatch.cpp in Sources */,
    47704818                                86EC9DD21328DF82002B2AD7 /* DFGSpeculativeJIT.cpp in Sources */,
     4819                                7C3BA29617C039560072DDC9 /* JSPromiseResolverConstructor.cpp in Sources */,
    47714820                                86880F1F14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp in Sources */,
    47724821                                86880F4D14353B2100B08D42 /* DFGSpeculativeJIT64.cpp in Sources */,
     
    47984847                                0FEA0A1E1708B00700BB722C /* FTLAbstractHeapRepository.cpp in Sources */,
    47994848                                0FEA0A09170513DB00BB722C /* FTLCapabilities.cpp in Sources */,
     4849                                7C184E1E17BEE22E007CB63A /* JSPromisePrototype.cpp in Sources */,
    48004850                                0F235BD117178E1C00690C7F /* FTLCArgumentGetter.cpp in Sources */,
    48014851                                0FEA0A271709623B00BB722C /* FTLCommonValues.cpp in Sources */,
     
    48594909                                140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */,
    48604910                                C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.mm in Sources */,
     4911                                7C3BA29417C039560072DDC9 /* JSPromiseResolver.cpp in Sources */,
    48614912                                147F39D0107EC37600427A48 /* JSArray.cpp in Sources */,
    48624913                                0F2B66E217B6B5AB00A7AE3F /* JSArrayBuffer.cpp in Sources */,
     
    49284979                                0F4680CC14BBB17A00BFE272 /* LowLevelInterpreter.cpp in Sources */,
    49294980                                14B723B212D7DA46003BD5ED /* MachineStackMarker.cpp in Sources */,
     4981                                7C184E1A17BEDBD3007CB63A /* JSPromise.cpp in Sources */,
    49304982                                0FEB3ECF16237F6C00AB67AD /* MacroAssembler.cpp in Sources */,
    49314983                                86C568E011A213EE0007F7F0 /* MacroAssemblerARM.cpp in Sources */,
     
    49825034                                0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */,
    49835035                                0FF60AC316740F8800029779 /* ReduceWhitespace.cpp in Sources */,
     5036                                7C184E2217BEE240007CB63A /* JSPromiseConstructor.cpp in Sources */,
    49845037                                14280841107EC0930013E7B2 /* RegExp.cpp in Sources */,
    49855038                                A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */,
  • trunk/Source/JavaScriptCore/Target.pri

    r154162 r154629  
    324324    runtime/JSONObject.cpp \
    325325    runtime/JSObject.cpp \
     326    runtime/JSPromise.cpp \
     327    runtime/JSPromiseCallback.cpp \
     328    runtime/JSPromiseConstructor.cpp \
     329    runtime/JSPromisePrototype.cpp \
     330    runtime/JSPromiseResolver.cpp \
     331    runtime/JSPromiseResolverConstructor.cpp \
     332    runtime/JSPromiseResolverPrototype.cpp \
    326333    runtime/JSPropertyNameIterator.cpp \
    327334    runtime/JSProxy.cpp \
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r154127 r154629  
    102102        static const HashTable* regExpPrototypeTable(CallFrame* callFrame) { return callFrame->vm().regExpPrototypeTable; }
    103103        static const HashTable* stringConstructorTable(CallFrame* callFrame) { return callFrame->vm().stringConstructorTable; }
     104        static const HashTable* promisePrototypeTable(CallFrame* callFrame) { return callFrame->vm().promisePrototypeTable; }
     105        static const HashTable* promiseConstructorTable(CallFrame* callFrame) { return callFrame->vm().promiseConstructorTable; }
     106        static const HashTable* promiseResolverPrototypeTable(CallFrame* callFrame) { return callFrame->vm().promiseResolverPrototypeTable; }
    104107
    105108        static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); }
  • trunk/Source/JavaScriptCore/jsc.cpp

    r154127 r154629  
    260260
    261261const ClassInfo GlobalObject::s_info = { "global", &JSGlobalObject::s_info, 0, ExecState::globalObjectTable, CREATE_METHOD_TABLE(GlobalObject) };
    262 const GlobalObjectMethodTable GlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled };
     262const GlobalObjectMethodTable GlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled, 0 };
    263263
    264264
  • trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h

    r154127 r154629  
    4242    macro(Number) \
    4343    macro(Object) \
     44    macro(Promise) \
     45    macro(PromiseResolver) \
    4446    macro(RangeError) \
    4547    macro(ReferenceError) \
     
    124126    macro(subarray) \
    125127    macro(test) \
     128    macro(then) \
    126129    macro(toExponential) \
    127130    macro(toFixed) \
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r154466 r154629  
    6767#include "JSNameScope.h"
    6868#include "JSONObject.h"
     69#include "JSPromise.h"
     70#include "JSPromiseCallback.h"
     71#include "JSPromiseConstructor.h"
     72#include "JSPromisePrototype.h"
     73#include "JSPromiseResolver.h"
     74#include "JSPromiseResolverConstructor.h"
     75#include "JSPromiseResolverPrototype.h"
    6976#include "JSTypedArrayConstructors.h"
    7077#include "JSTypedArrayPrototypes.h"
     
    100107const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &Base::s_info, 0, ExecState::globalObjectTable, CREATE_METHOD_TABLE(JSGlobalObject) };
    101108
    102 const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled };
     109const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled, 0 };
    103110
    104111/* Source for JSGlobalObject.lut.h
     
    298305    m_errorStructure.set(exec->vm(), this, ErrorInstance::createStructure(exec->vm(), this, m_errorPrototype.get()));
    299306
     307    m_promisePrototype.set(exec->vm(), this, JSPromisePrototype::create(exec, this, JSPromisePrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
     308    m_promiseStructure.set(exec->vm(), this, JSPromise::createStructure(exec->vm(), this, m_promisePrototype.get()));
     309
     310    m_promiseResolverPrototype.set(exec->vm(), this, JSPromiseResolverPrototype::create(exec, this, JSPromiseResolverPrototype::createStructure(exec->vm(), this, m_objectPrototype.get())));
     311    m_promiseResolverStructure.set(exec->vm(), this, JSPromiseResolver::createStructure(exec->vm(), this, m_promiseResolverPrototype.get()));
     312    m_promiseCallbackStructure.set(exec->vm(), this, JSPromiseCallback::createStructure(exec->vm(), this, m_functionPrototype.get()));
     313    m_promiseWrapperCallbackStructure.set(exec->vm(), this, JSPromiseWrapperCallback::createStructure(exec->vm(), this, m_functionPrototype.get()));
     314   
    300315    // Constructors
    301316
     
    307322    JSCell* numberConstructor = NumberConstructor::create(exec, this, NumberConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_numberPrototype.get());
    308323    JSCell* dateConstructor = DateConstructor::create(exec, this, DateConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_datePrototype.get());
     324    JSCell* promiseConstructor = JSPromiseConstructor::create(exec, this, JSPromiseConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_promisePrototype.get());
     325    JSCell* promiseResolverConstructor = JSPromiseResolverConstructor::create(exec, this, JSPromiseResolverConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_promiseResolverPrototype.get());
    309326
    310327    m_regExpConstructor.set(exec->vm(), this, RegExpConstructor::create(exec, this, RegExpConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_regExpPrototype.get()));
     
    330347    m_regExpPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, m_regExpConstructor.get(), DontEnum);
    331348    m_errorPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, m_errorConstructor.get(), DontEnum);
     349    m_promisePrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, promiseConstructor, DontEnum);
     350    m_promiseResolverPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, promiseResolverConstructor, DontEnum);
    332351
    333352    putDirectWithoutTransition(exec->vm(), exec->propertyNames().Object, objectConstructor, DontEnum);
     
    346365    putDirectWithoutTransition(exec->vm(), exec->propertyNames().TypeError, m_typeErrorConstructor.get(), DontEnum);
    347366    putDirectWithoutTransition(exec->vm(), exec->propertyNames().URIError, m_URIErrorConstructor.get(), DontEnum);
     367    putDirectWithoutTransition(exec->vm(), exec->propertyNames().Promise, promiseConstructor, DontEnum);
     368    putDirectWithoutTransition(exec->vm(), exec->propertyNames().PromiseResolver, promiseResolverConstructor, DontEnum);
    348369
    349370    m_evalFunction.set(exec->vm(), this, JSFunction::create(exec, this, 1, exec->propertyNames().eval.string(), globalFuncEval));
     
    565586    visitor.append(&thisObject->m_regExpPrototype);
    566587    visitor.append(&thisObject->m_errorPrototype);
     588    visitor.append(&thisObject->m_promisePrototype);
     589    visitor.append(&thisObject->m_promiseResolverPrototype);
    567590
    568591    visitor.append(&thisObject->m_withScopeStructure);
     
    595618    visitor.append(&thisObject->m_stringObjectStructure);
    596619    visitor.append(&thisObject->m_internalFunctionStructure);
    597    
     620    visitor.append(&thisObject->m_promiseStructure);
     621    visitor.append(&thisObject->m_promiseResolverStructure);
     622    visitor.append(&thisObject->m_promiseCallbackStructure);
     623    visitor.append(&thisObject->m_promiseWrapperCallbackStructure);
     624
    598625    visitor.append(&thisObject->m_arrayBufferPrototype);
    599626    visitor.append(&thisObject->m_arrayBufferStructure);
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r154459 r154629  
    2525#include "ArrayAllocationProfile.h"
    2626#include "JSArray.h"
     27#include "JSArrayBufferPrototype.h"
    2728#include "JSClassRef.h"
    28 #include "JSArrayBufferPrototype.h"
    2929#include "JSSegmentedVariableObject.h"
    3030#include "JSWeakObjectMapRefInternal.h"
     
    3939#include <wtf/HashSet.h>
    4040#include <wtf/OwnPtr.h>
     41#include <wtf/PassRefPtr.h>
    4142#include <wtf/RandomNumber.h>
    4243
     
    5960class GetterSetter;
    6061class GlobalCodeBlock;
     62class JSPromisePrototype;
     63class JSPromiseResolverPrototype;
    6164class JSStack;
    6265class LLIntOffsetsExtractor;
     
    7174
    7275typedef Vector<ExecState*, 16> ExecStateStack;
    73    
     76
     77class TaskContext : public RefCounted<TaskContext> {
     78public:
     79    virtual ~TaskContext()
     80    {
     81    }
     82};
     83
    7484struct GlobalObjectMethodTable {
    7585    typedef bool (*AllowsAccessFromFunctionPtr)(const JSGlobalObject*, ExecState*);
     
    8797    typedef bool (*JavaScriptExperimentsEnabledFunctionPtr)(const JSGlobalObject*);
    8898    JavaScriptExperimentsEnabledFunctionPtr javaScriptExperimentsEnabled;
     99
     100    typedef void (*QueueTaskToEventLoopCallbackFunctionPtr)(ExecState*, TaskContext*);
     101    typedef void (*QueueTaskToEventLoopFunctionPtr)(const JSGlobalObject*, QueueTaskToEventLoopCallbackFunctionPtr, PassRefPtr<TaskContext>);
     102    QueueTaskToEventLoopFunctionPtr queueTaskToEventLoop;
    89103};
    90104
     
    135149    WriteBarrier<RegExpPrototype> m_regExpPrototype;
    136150    WriteBarrier<ErrorPrototype> m_errorPrototype;
     151    WriteBarrier<JSPromisePrototype> m_promisePrototype;
     152    WriteBarrier<JSPromiseResolverPrototype> m_promiseResolverPrototype;
    137153
    138154    WriteBarrier<Structure> m_withScopeStructure;
     
    168184    WriteBarrier<Structure> m_stringObjectStructure;
    169185    WriteBarrier<Structure> m_internalFunctionStructure;
    170    
     186    WriteBarrier<Structure> m_promiseStructure;
     187    WriteBarrier<Structure> m_promiseResolverStructure;
     188    WriteBarrier<Structure> m_promiseCallbackStructure;
     189    WriteBarrier<Structure> m_promiseWrapperCallbackStructure;
     190
    171191    WriteBarrier<JSArrayBufferPrototype> m_arrayBufferPrototype;
    172192    WriteBarrier<Structure> m_arrayBufferStructure;
     
    313333    RegExpPrototype* regExpPrototype() const { return m_regExpPrototype.get(); }
    314334    ErrorPrototype* errorPrototype() const { return m_errorPrototype.get(); }
     335    JSPromisePrototype* promisePrototype() const { return m_promisePrototype.get(); }
     336    JSPromiseResolverPrototype* promiseResolverPrototype() const { return m_promiseResolverPrototype.get(); }
    315337
    316338    Structure* withScopeStructure() const { return m_withScopeStructure.get(); }
     
    360382    Structure* regExpStructure() const { return m_regExpStructure.get(); }
    361383    Structure* stringObjectStructure() const { return m_stringObjectStructure.get(); }
    362    
     384    Structure* promiseStructure() const { return m_promiseStructure.get(); }
     385    Structure* promiseResolverStructure() const { return m_promiseResolverStructure.get(); }
     386    Structure* promiseCallbackStructure() const { return m_promiseCallbackStructure.get(); }
     387    Structure* promiseWrapperCallbackStructure() const { return m_promiseWrapperCallbackStructure.get(); }
     388
    363389    JSArrayBufferPrototype* arrayBufferPrototype() const { return m_arrayBufferPrototype.get(); }
    364390    Structure* arrayBufferStructure() const { return m_arrayBufferStructure.get(); }
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r154156 r154629  
    102102extern const HashTable regExpPrototypeTable;
    103103extern const HashTable stringConstructorTable;
     104extern const HashTable promisePrototypeTable;
     105extern const HashTable promiseConstructorTable;
     106extern const HashTable promiseResolverPrototypeTable;
    104107
    105108// Note: Platform.h will enforce that ENABLE(ASSEMBLER) is true if either
     
    162165    , regExpPrototypeTable(fastNew<HashTable>(JSC::regExpPrototypeTable))
    163166    , stringConstructorTable(fastNew<HashTable>(JSC::stringConstructorTable))
     167    , promisePrototypeTable(fastNew<HashTable>(JSC::promisePrototypeTable))
     168    , promiseConstructorTable(fastNew<HashTable>(JSC::promiseConstructorTable))
     169    , promiseResolverPrototypeTable(fastNew<HashTable>(JSC::promiseResolverPrototypeTable))
    164170    , identifierTable(vmType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable())
    165171    , propertyNames(new CommonIdentifiers(this))
     
    311317    regExpPrototypeTable->deleteTable();
    312318    stringConstructorTable->deleteTable();
     319    promisePrototypeTable->deleteTable();
     320    promiseConstructorTable->deleteTable();
     321    promiseResolverPrototypeTable->deleteTable();
    313322
    314323    fastDelete(const_cast<HashTable*>(arrayConstructorTable));
     
    329338    fastDelete(const_cast<HashTable*>(regExpPrototypeTable));
    330339    fastDelete(const_cast<HashTable*>(stringConstructorTable));
     340    fastDelete(const_cast<HashTable*>(promisePrototypeTable));
     341    fastDelete(const_cast<HashTable*>(promiseConstructorTable));
     342    fastDelete(const_cast<HashTable*>(promiseResolverPrototypeTable));
    331343
    332344    delete emptyList;
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r154127 r154629  
    236236        const HashTable* regExpPrototypeTable;
    237237        const HashTable* stringConstructorTable;
     238        const HashTable* promisePrototypeTable;
     239        const HashTable* promiseConstructorTable;
     240        const HashTable* promiseResolverPrototypeTable;
    238241       
    239242        Strong<Structure> structureStructure;
Note: See TracChangeset for help on using the changeset viewer.