Changeset 154629 in webkit
- Timestamp:
- Aug 26, 2013 12:19:50 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 88 added
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r154628 r154629 1 2013-08-24 Sam Weinig <sam@webkit.org> 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 tests adapted from the Mozilla and Blink projects. 9 10 * fast/js/Promise-already-fulfilled-expected.txt: Added. 11 * fast/js/Promise-already-fulfilled.html: Added. 12 * fast/js/Promise-already-rejected-expected.txt: Added. 13 * fast/js/Promise-already-rejected.html: Added. 14 * fast/js/Promise-already-resolved-expected.txt: Added. 15 * fast/js/Promise-already-resolved.html: Added. 16 * fast/js/Promise-catch-expected.txt: Added. 17 * fast/js/Promise-catch-in-workers-expected.txt: Added. 18 * fast/js/Promise-catch-in-workers.html: Added. 19 * fast/js/Promise-catch.html: Added. 20 * fast/js/Promise-chain-expected.txt: Added. 21 * fast/js/Promise-chain.html: Added. 22 * fast/js/Promise-exception-expected.txt: Added. 23 * fast/js/Promise-exception.html: Added. 24 * fast/js/Promise-expected.txt: Added. 25 * fast/js/Promise-fulfill-expected.txt: Added. 26 * fast/js/Promise-fulfill-in-workers-expected.txt: Added. 27 * fast/js/Promise-fulfill-in-workers.html: Added. 28 * fast/js/Promise-fulfill.html: Added. 29 * fast/js/Promise-init-expected.txt: Added. 30 * fast/js/Promise-init-in-workers-expected.txt: Added. 31 * fast/js/Promise-init-in-workers.html: Added. 32 * fast/js/Promise-init.html: Added. 33 * fast/js/Promise-reject-expected.txt: Added. 34 * fast/js/Promise-reject-in-workers-expected.txt: Added. 35 * fast/js/Promise-reject-in-workers.html: Added. 36 * fast/js/Promise-reject.html: Added. 37 * fast/js/Promise-resolve-chain-expected.txt: Added. 38 * fast/js/Promise-resolve-chain.html: Added. 39 * fast/js/Promise-resolve-expected.txt: Added. 40 * fast/js/Promise-resolve-in-workers-expected.txt: Added. 41 * fast/js/Promise-resolve-in-workers.html: Added. 42 * fast/js/Promise-resolve-with-then-exception-expected.txt: Added. 43 * fast/js/Promise-resolve-with-then-exception.html: Added. 44 * fast/js/Promise-resolve-with-then-fulfill-expected.txt: Added. 45 * fast/js/Promise-resolve-with-then-fulfill.html: Added. 46 * fast/js/Promise-resolve-with-then-reject-expected.txt: Added. 47 * fast/js/Promise-resolve-with-then-reject.html: Added. 48 * fast/js/Promise-resolve.html: Added. 49 * fast/js/Promise-simple-expected.txt: Added. 50 * fast/js/Promise-simple-fulfill-expected.txt: Added. 51 * fast/js/Promise-simple-fulfill-inside-callback-expected.txt: Added. 52 * fast/js/Promise-simple-fulfill-inside-callback.html: Added. 53 * fast/js/Promise-simple-fulfill.html: Added. 54 * fast/js/Promise-simple-in-workers-expected.txt: Added. 55 * fast/js/Promise-simple-in-workers.html: Added. 56 * fast/js/Promise-simple.html: Added. 57 * fast/js/Promise-static-fulfill-expected.txt: Added. 58 * fast/js/Promise-static-fulfill.html: Added. 59 * fast/js/Promise-static-reject-expected.txt: Added. 60 * fast/js/Promise-static-reject.html: Added. 61 * fast/js/Promise-static-resolve-expected.txt: Added. 62 * fast/js/Promise-static-resolve.html: Added. 63 * fast/js/Promise-then-expected.txt: Added. 64 * fast/js/Promise-then-in-workers-expected.txt: Added. 65 * fast/js/Promise-then-in-workers.html: Added. 66 * fast/js/Promise-then-without-callbacks-expected.txt: Added. 67 * fast/js/Promise-then-without-callbacks-in-workers-expected.txt: Added. 68 * fast/js/Promise-then-without-callbacks-in-workers.html: Added. 69 * fast/js/Promise-then-without-callbacks.html: Added. 70 * fast/js/Promise-then.html: Added. 71 * fast/js/Promise-types-expected.txt: Added. 72 * fast/js/Promise-types.html: Added. 73 * fast/js/Promise.html: Added. 74 * fast/js/resources/Promise-catch-in-workers.js: Added. 75 * fast/js/resources/Promise-fulfill-in-workers.js: Added. 76 * fast/js/resources/Promise-init-in-workers.js: Added. 77 * fast/js/resources/Promise-reject-in-workers.js: Added. 78 * fast/js/resources/Promise-resolve-in-workers.js: Added. 79 * fast/js/resources/Promise-simple-in-workers.js: Added. 80 * fast/js/resources/Promise-then-in-workers.js: Added. 81 * fast/js/resources/Promise-then-without-callbacks-in-workers.js: Added. 82 1 83 2013-08-26 Rob Buis <rwlbuis@webkit.org> 2 84 -
trunk/Source/JavaScriptCore/CMakeLists.txt
r154162 r154629 335 335 runtime/JSONObject.cpp 336 336 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 337 344 runtime/JSPropertyNameIterator.cpp 338 345 runtime/JSProxy.cpp … … 416 423 runtime/JSGlobalObject.cpp 417 424 runtime/JSONObject.cpp 425 runtime/JSPromiseConstructor.cpp 426 runtime/JSPromisePrototype.cpp 427 runtime/JSPromiseResolverPrototype.cpp 418 428 runtime/NamePrototype.cpp 419 429 runtime/NumberConstructor.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r154626 r154629 1 2013-08-24 Sam Weinig <sam@webkit.org> 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 1 71 2013-08-26 Zan Dobersek <zdobersek@igalia.com> 2 72 -
trunk/Source/JavaScriptCore/DerivedSources.make
r154127 r154629 45 45 JSONObject.lut.h \ 46 46 JSGlobalObject.lut.h \ 47 JSPromisePrototype.lut.h \ 48 JSPromiseConstructor.lut.h \ 49 JSPromiseResolverPrototype.lut.h \ 47 50 KeywordLookup.h \ 48 51 Lexer.lut.h \ -
trunk/Source/JavaScriptCore/DerivedSources.pri
r154127 r154629 17 17 runtime/JSGlobalObject.cpp \ 18 18 runtime/JSONObject.cpp \ 19 runtime/JSPromiseConstructor.cpp \ 20 runtime/JSPromisePrototype.cpp \ 21 runtime/JSPromiseResolverPrototype.cpp \ 19 22 runtime/MathObject.cpp \ 20 23 runtime/NamePrototype.cpp \ -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r154569 r154629 21 21 DerivedSources/JavaScriptCore/JSGlobalObject.lut.h \ 22 22 DerivedSources/JavaScriptCore/JSONObject.lut.h \ 23 DerivedSources/JavaScriptCore/JSPromiseConstructor.lut.h \ 24 DerivedSources/JavaScriptCore/JSPromisePrototype.lut.h \ 25 DerivedSources/JavaScriptCore/JSPromiseResolverPrototype.lut.h \ 23 26 DerivedSources/JavaScriptCore/MathObject.lut.h \ 24 27 DerivedSources/JavaScriptCore/NamePrototype.lut.h \ … … 812 815 Source/JavaScriptCore/runtime/JSONObject.cpp \ 813 816 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 \ 814 831 Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp \ 815 832 Source/JavaScriptCore/runtime/JSPropertyNameIterator.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
r154569 r154629 469 469 <ClCompile Include="..\runtime\JSONObject.cpp" /> 470 470 <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" /> 471 478 <ClCompile Include="..\runtime\JSPropertyNameIterator.cpp" /> 472 479 <ClCompile Include="..\runtime\JSProxy.cpp" /> … … 544 551 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSGlobalObject.lut.h" /> 545 552 <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" /> 546 556 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\Lexer.lut.h" /> 547 557 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\LLIntAssembly.h" /> … … 881 891 <ClInclude Include="..\runtime\JSONObject.h" /> 882 892 <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" /> 883 900 <ClInclude Include="..\runtime\JSPropertyNameIterator.h" /> 884 901 <ClInclude Include="..\runtime\JSProxy.h" /> -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r154569 r154629 650 650 65C0285C1717966800351E35 /* ARMv7DOpcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C0285A1717966800351E35 /* ARMv7DOpcode.cpp */; }; 651 651 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 */; }; 652 666 7E4EE7090EBB7963005934AA /* StructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4EE7080EBB7963005934AA /* StructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; }; 653 667 7E4EE70F0EBB7A5B005934AA /* StructureChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */; }; … … 1013 1027 BC18C47A0E16F5CD00B34460 /* WebKitAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1014 1028 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 */; };1017 1029 BC18C52C0E16FCD200B34460 /* RegExpObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */; }; 1018 1030 BC18C52E0E16FCE100B34460 /* Lexer.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52D0E16FCE100B34460 /* Lexer.lut.h */; }; … … 1780 1792 65EA73630BAE35D1001BB560 /* CommonIdentifiers.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CommonIdentifiers.h; sourceTree = "<group>"; }; 1781 1793 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>"; }; 1782 1811 7E4EE7080EBB7963005934AA /* StructureChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureChain.h; sourceTree = "<group>"; }; 1783 1812 7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructureChain.cpp; sourceTree = "<group>"; }; … … 2122 2151 BC18C3C60E16EE3300B34460 /* StringPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringPrototype.h; sourceTree = "<group>"; }; 2123 2152 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>"; };2126 2153 BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpObject.lut.h; sourceTree = "<group>"; }; 2127 2154 BC18C52D0E16FCE100B34460 /* Lexer.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lexer.lut.h; sourceTree = "<group>"; }; … … 2157 2184 BC7952350E15EB5600A898AB /* BooleanPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BooleanPrototype.h; sourceTree = "<group>"; }; 2158 2185 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>"; };2160 2186 BC87CDB810712ACA000614CF /* JSONObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONObject.lut.h; sourceTree = "<group>"; }; 2161 2187 BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstructData.h; sourceTree = "<group>"; }; … … 2866 2892 isa = PBXGroup; 2867 2893 children = ( 2894 7C3BA29A17C03BE10072DDC9 /* JSPromiseResolverPrototype.lut.h */, 2868 2895 BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */, 2869 2896 BCD203E70E1718F4002C7E82 /* DatePrototype.lut.h */, 2870 BC8149AF12F89F53007B2C32 /* HeaderDetection.h */,2871 2897 BC87CDB810712ACA000614CF /* JSONObject.lut.h */, 2898 7C184E2417BFFA36007CB63A /* JSPromiseConstructor.lut.h */, 2899 7C184E2517BFFA36007CB63A /* JSPromisePrototype.lut.h */, 2872 2900 A7C225CD1399849C00FF1662 /* KeywordLookup.h */, 2873 2901 BC18C52D0E16FCE100B34460 /* Lexer.lut.h */, 2874 BC18C5290E16FCC200B34460 /* MathObject.lut.h */,2875 2902 BC2680E60E16D52300A06E92 /* NumberConstructor.lut.h */, 2876 2903 BCD202D50E170708002C7E82 /* RegExpConstructor.lut.h */, 2877 2904 A718F61A11754A21002465A7 /* RegExpJitTables.h */, 2878 2905 BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */, 2879 BC18C5250E16FCA700B34460 /* StringPrototype.lut.h */,2880 2906 5D53727D0E1C55EC0021E549 /* TracingDtrace.h */, 2881 2907 ); … … 3103 3129 A7F9935E0FD7325100A0B2D0 /* JSONObject.cpp */, 3104 3130 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 */, 3105 3145 A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */, 3106 3146 A727FF650DA3053B00E548D7 /* JSPropertyNameIterator.h */, … … 3768 3808 0F136D4D174AD69E0075B354 /* DeferGC.h in Headers */, 3769 3809 A77A423E17A0BBFD00A8DB81 /* DFGAbstractHeap.h in Headers */, 3810 7C15F65E17C199CE00794D40 /* JSPromiseCallback.h in Headers */, 3770 3811 A704D90317A0BAA8006BA554 /* DFGAbstractInterpreter.h in Headers */, 3771 3812 A704D90417A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h in Headers */, … … 3835 3876 A7D89CFC17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.h in Headers */, 3836 3877 0FF0F19B16B729FA005DF95B /* DFGLongLivedState.h in Headers */, 3878 7C184E1F17BEE22E007CB63A /* JSPromisePrototype.h in Headers */, 3837 3879 A767B5B617A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h in Headers */, 3838 3880 A704D90717A0BAA8006BA554 /* DFGMergeMode.h in Headers */, … … 3912 3954 0F235BD617178E1C00690C7F /* FTLExitArgumentForOperand.h in Headers */, 3913 3955 0F235BD717178E1C00690C7F /* FTLExitArgumentList.h in Headers */, 3956 7C3BA29917C039560072DDC9 /* JSPromiseResolverPrototype.h in Headers */, 3914 3957 0F235BD917178E1C00690C7F /* FTLExitThunkGenerator.h in Headers */, 3915 3958 0F235BDB17178E1C00690C7F /* FTLExitValue.h in Headers */, … … 3976 4019 1429D77C0ED20D7300B89619 /* Interpreter.h in Headers */, 3977 4020 860BD801148EA6F200112B2F /* Intrinsic.h in Headers */, 4021 7C3BA29517C039560072DDC9 /* JSPromiseResolver.h in Headers */, 3978 4022 BC18C4130E16F5CD00B34460 /* JavaScript.h in Headers */, 3979 4023 BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */, … … 4136 4180 8612E4CD152389EC00C836BE /* MatchResult.h in Headers */, 4137 4181 BC18C43C0E16F5CD00B34460 /* MathObject.h in Headers */, 4138 BC18C52A0E16FCC200B34460 /* MathObject.lut.h in Headers */,4139 4182 90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */, 4140 4183 0FB5467B14F5C7E1002C2989 /* MethodOfGettingAValueProfile.h in Headers */, … … 4201 4244 0F9332A414CA7DD90085F3C6 /* PutByIdStatus.h in Headers */, 4202 4245 0F0CD4C215F1A6070032F1C0 /* PutDirectIndexMode.h in Headers */, 4246 7C184E1B17BEDBD3007CB63A /* JSPromise.h in Headers */, 4247 0F2B66F217B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h in Headers */, 4203 4248 0F9FC8C514E1B60400D52AE0 /* PutKind.h in Headers */, 4204 4249 147B84630E6DE6B1004775A4 /* PutPropertySlot.h in Headers */, … … 4206 4251 BC18C45A0E16F5CD00B34460 /* RegExp.h in Headers */, 4207 4252 A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */, 4253 7C3BA29717C039560072DDC9 /* JSPromiseResolverConstructor.h in Headers */, 4208 4254 BCD202C20E1706A7002C7E82 /* RegExpConstructor.h in Headers */, 4209 4255 BCD202D60E170708002C7E82 /* RegExpConstructor.lut.h in Headers */, … … 4216 4262 969A072B0ED1CE6900F1F681 /* RegisterID.h in Headers */, 4217 4263 0FB7F39D15ED8E4600F167B2 /* Reject.h in Headers */, 4264 7C184E2317BEE240007CB63A /* JSPromiseConstructor.h in Headers */, 4218 4265 86D3B3C410159D7F002865E7 /* RepatchBuffer.h in Headers */, 4219 4266 869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */, … … 4242 4289 BC18C4680E16F5CD00B34460 /* StringObject.h in Headers */, 4243 4290 BC18C46A0E16F5CD00B34460 /* StringPrototype.h in Headers */, 4244 BC18C5260E16FCA700B34460 /* StringPrototype.lut.h in Headers */,4245 4291 142E313B134FF0A600AFADB5 /* Strong.h in Headers */, 4246 4292 145722861437E140005FDE26 /* StrongInlines.h in Headers */, … … 4729 4775 C2981FDC17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp in Sources */, 4730 4776 0FF427641591A1CC004CB9FF /* DFGDisassembler.cpp in Sources */, 4777 7C3BA29817C039560072DDC9 /* JSPromiseResolverPrototype.cpp in Sources */, 4731 4778 0FD81AD2154FB4EE00983E72 /* DFGDominators.cpp in Sources */, 4732 4779 0FD3C82614115D4000FD81CB /* DFGDriver.cpp in Sources */, … … 4750 4797 0F2BDC4D1522818600CD8910 /* DFGMinifiedNode.cpp in Sources */, 4751 4798 A737810D1799EA2E00817533 /* DFGNaturalLoops.cpp in Sources */, 4799 7C15F65D17C199CE00794D40 /* JSPromiseCallback.cpp in Sources */, 4752 4800 0FF0F19C16B72A03005DF95B /* DFGNode.cpp in Sources */, 4753 4801 0FA581BA150E952C00B9A2D9 /* DFGNodeFlags.cpp in Sources */, … … 4769 4817 86BB09C0138E381B0056702F /* DFGRepatch.cpp in Sources */, 4770 4818 86EC9DD21328DF82002B2AD7 /* DFGSpeculativeJIT.cpp in Sources */, 4819 7C3BA29617C039560072DDC9 /* JSPromiseResolverConstructor.cpp in Sources */, 4771 4820 86880F1F14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp in Sources */, 4772 4821 86880F4D14353B2100B08D42 /* DFGSpeculativeJIT64.cpp in Sources */, … … 4798 4847 0FEA0A1E1708B00700BB722C /* FTLAbstractHeapRepository.cpp in Sources */, 4799 4848 0FEA0A09170513DB00BB722C /* FTLCapabilities.cpp in Sources */, 4849 7C184E1E17BEE22E007CB63A /* JSPromisePrototype.cpp in Sources */, 4800 4850 0F235BD117178E1C00690C7F /* FTLCArgumentGetter.cpp in Sources */, 4801 4851 0FEA0A271709623B00BB722C /* FTLCommonValues.cpp in Sources */, … … 4859 4909 140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */, 4860 4910 C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.mm in Sources */, 4911 7C3BA29417C039560072DDC9 /* JSPromiseResolver.cpp in Sources */, 4861 4912 147F39D0107EC37600427A48 /* JSArray.cpp in Sources */, 4862 4913 0F2B66E217B6B5AB00A7AE3F /* JSArrayBuffer.cpp in Sources */, … … 4928 4979 0F4680CC14BBB17A00BFE272 /* LowLevelInterpreter.cpp in Sources */, 4929 4980 14B723B212D7DA46003BD5ED /* MachineStackMarker.cpp in Sources */, 4981 7C184E1A17BEDBD3007CB63A /* JSPromise.cpp in Sources */, 4930 4982 0FEB3ECF16237F6C00AB67AD /* MacroAssembler.cpp in Sources */, 4931 4983 86C568E011A213EE0007F7F0 /* MacroAssemblerARM.cpp in Sources */, … … 4982 5034 0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */, 4983 5035 0FF60AC316740F8800029779 /* ReduceWhitespace.cpp in Sources */, 5036 7C184E2217BEE240007CB63A /* JSPromiseConstructor.cpp in Sources */, 4984 5037 14280841107EC0930013E7B2 /* RegExp.cpp in Sources */, 4985 5038 A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */, -
trunk/Source/JavaScriptCore/Target.pri
r154162 r154629 324 324 runtime/JSONObject.cpp \ 325 325 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 \ 326 333 runtime/JSPropertyNameIterator.cpp \ 327 334 runtime/JSProxy.cpp \ -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r154127 r154629 102 102 static const HashTable* regExpPrototypeTable(CallFrame* callFrame) { return callFrame->vm().regExpPrototypeTable; } 103 103 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; } 104 107 105 108 static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); } -
trunk/Source/JavaScriptCore/jsc.cpp
r154127 r154629 260 260 261 261 const 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 };262 const GlobalObjectMethodTable GlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled, 0 }; 263 263 264 264 -
trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h
r154127 r154629 42 42 macro(Number) \ 43 43 macro(Object) \ 44 macro(Promise) \ 45 macro(PromiseResolver) \ 44 46 macro(RangeError) \ 45 47 macro(ReferenceError) \ … … 124 126 macro(subarray) \ 125 127 macro(test) \ 128 macro(then) \ 126 129 macro(toExponential) \ 127 130 macro(toFixed) \ -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r154466 r154629 67 67 #include "JSNameScope.h" 68 68 #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" 69 76 #include "JSTypedArrayConstructors.h" 70 77 #include "JSTypedArrayPrototypes.h" … … 100 107 const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &Base::s_info, 0, ExecState::globalObjectTable, CREATE_METHOD_TABLE(JSGlobalObject) }; 101 108 102 const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled };109 const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled, 0 }; 103 110 104 111 /* Source for JSGlobalObject.lut.h … … 298 305 m_errorStructure.set(exec->vm(), this, ErrorInstance::createStructure(exec->vm(), this, m_errorPrototype.get())); 299 306 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 300 315 // Constructors 301 316 … … 307 322 JSCell* numberConstructor = NumberConstructor::create(exec, this, NumberConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_numberPrototype.get()); 308 323 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()); 309 326 310 327 m_regExpConstructor.set(exec->vm(), this, RegExpConstructor::create(exec, this, RegExpConstructor::createStructure(exec->vm(), this, m_functionPrototype.get()), m_regExpPrototype.get())); … … 330 347 m_regExpPrototype->putDirectWithoutTransition(exec->vm(), exec->propertyNames().constructor, m_regExpConstructor.get(), DontEnum); 331 348 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); 332 351 333 352 putDirectWithoutTransition(exec->vm(), exec->propertyNames().Object, objectConstructor, DontEnum); … … 346 365 putDirectWithoutTransition(exec->vm(), exec->propertyNames().TypeError, m_typeErrorConstructor.get(), DontEnum); 347 366 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); 348 369 349 370 m_evalFunction.set(exec->vm(), this, JSFunction::create(exec, this, 1, exec->propertyNames().eval.string(), globalFuncEval)); … … 565 586 visitor.append(&thisObject->m_regExpPrototype); 566 587 visitor.append(&thisObject->m_errorPrototype); 588 visitor.append(&thisObject->m_promisePrototype); 589 visitor.append(&thisObject->m_promiseResolverPrototype); 567 590 568 591 visitor.append(&thisObject->m_withScopeStructure); … … 595 618 visitor.append(&thisObject->m_stringObjectStructure); 596 619 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 598 625 visitor.append(&thisObject->m_arrayBufferPrototype); 599 626 visitor.append(&thisObject->m_arrayBufferStructure); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r154459 r154629 25 25 #include "ArrayAllocationProfile.h" 26 26 #include "JSArray.h" 27 #include "JSArrayBufferPrototype.h" 27 28 #include "JSClassRef.h" 28 #include "JSArrayBufferPrototype.h"29 29 #include "JSSegmentedVariableObject.h" 30 30 #include "JSWeakObjectMapRefInternal.h" … … 39 39 #include <wtf/HashSet.h> 40 40 #include <wtf/OwnPtr.h> 41 #include <wtf/PassRefPtr.h> 41 42 #include <wtf/RandomNumber.h> 42 43 … … 59 60 class GetterSetter; 60 61 class GlobalCodeBlock; 62 class JSPromisePrototype; 63 class JSPromiseResolverPrototype; 61 64 class JSStack; 62 65 class LLIntOffsetsExtractor; … … 71 74 72 75 typedef Vector<ExecState*, 16> ExecStateStack; 73 76 77 class TaskContext : public RefCounted<TaskContext> { 78 public: 79 virtual ~TaskContext() 80 { 81 } 82 }; 83 74 84 struct GlobalObjectMethodTable { 75 85 typedef bool (*AllowsAccessFromFunctionPtr)(const JSGlobalObject*, ExecState*); … … 87 97 typedef bool (*JavaScriptExperimentsEnabledFunctionPtr)(const JSGlobalObject*); 88 98 JavaScriptExperimentsEnabledFunctionPtr javaScriptExperimentsEnabled; 99 100 typedef void (*QueueTaskToEventLoopCallbackFunctionPtr)(ExecState*, TaskContext*); 101 typedef void (*QueueTaskToEventLoopFunctionPtr)(const JSGlobalObject*, QueueTaskToEventLoopCallbackFunctionPtr, PassRefPtr<TaskContext>); 102 QueueTaskToEventLoopFunctionPtr queueTaskToEventLoop; 89 103 }; 90 104 … … 135 149 WriteBarrier<RegExpPrototype> m_regExpPrototype; 136 150 WriteBarrier<ErrorPrototype> m_errorPrototype; 151 WriteBarrier<JSPromisePrototype> m_promisePrototype; 152 WriteBarrier<JSPromiseResolverPrototype> m_promiseResolverPrototype; 137 153 138 154 WriteBarrier<Structure> m_withScopeStructure; … … 168 184 WriteBarrier<Structure> m_stringObjectStructure; 169 185 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 171 191 WriteBarrier<JSArrayBufferPrototype> m_arrayBufferPrototype; 172 192 WriteBarrier<Structure> m_arrayBufferStructure; … … 313 333 RegExpPrototype* regExpPrototype() const { return m_regExpPrototype.get(); } 314 334 ErrorPrototype* errorPrototype() const { return m_errorPrototype.get(); } 335 JSPromisePrototype* promisePrototype() const { return m_promisePrototype.get(); } 336 JSPromiseResolverPrototype* promiseResolverPrototype() const { return m_promiseResolverPrototype.get(); } 315 337 316 338 Structure* withScopeStructure() const { return m_withScopeStructure.get(); } … … 360 382 Structure* regExpStructure() const { return m_regExpStructure.get(); } 361 383 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 363 389 JSArrayBufferPrototype* arrayBufferPrototype() const { return m_arrayBufferPrototype.get(); } 364 390 Structure* arrayBufferStructure() const { return m_arrayBufferStructure.get(); } -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r154156 r154629 102 102 extern const HashTable regExpPrototypeTable; 103 103 extern const HashTable stringConstructorTable; 104 extern const HashTable promisePrototypeTable; 105 extern const HashTable promiseConstructorTable; 106 extern const HashTable promiseResolverPrototypeTable; 104 107 105 108 // Note: Platform.h will enforce that ENABLE(ASSEMBLER) is true if either … … 162 165 , regExpPrototypeTable(fastNew<HashTable>(JSC::regExpPrototypeTable)) 163 166 , stringConstructorTable(fastNew<HashTable>(JSC::stringConstructorTable)) 167 , promisePrototypeTable(fastNew<HashTable>(JSC::promisePrototypeTable)) 168 , promiseConstructorTable(fastNew<HashTable>(JSC::promiseConstructorTable)) 169 , promiseResolverPrototypeTable(fastNew<HashTable>(JSC::promiseResolverPrototypeTable)) 164 170 , identifierTable(vmType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable()) 165 171 , propertyNames(new CommonIdentifiers(this)) … … 311 317 regExpPrototypeTable->deleteTable(); 312 318 stringConstructorTable->deleteTable(); 319 promisePrototypeTable->deleteTable(); 320 promiseConstructorTable->deleteTable(); 321 promiseResolverPrototypeTable->deleteTable(); 313 322 314 323 fastDelete(const_cast<HashTable*>(arrayConstructorTable)); … … 329 338 fastDelete(const_cast<HashTable*>(regExpPrototypeTable)); 330 339 fastDelete(const_cast<HashTable*>(stringConstructorTable)); 340 fastDelete(const_cast<HashTable*>(promisePrototypeTable)); 341 fastDelete(const_cast<HashTable*>(promiseConstructorTable)); 342 fastDelete(const_cast<HashTable*>(promiseResolverPrototypeTable)); 331 343 332 344 delete emptyList; -
trunk/Source/JavaScriptCore/runtime/VM.h
r154127 r154629 236 236 const HashTable* regExpPrototypeTable; 237 237 const HashTable* stringConstructorTable; 238 const HashTable* promisePrototypeTable; 239 const HashTable* promiseConstructorTable; 240 const HashTable* promiseResolverPrototypeTable; 238 241 239 242 Strong<Structure> structureStructure; -
trunk/Source/WebCore/ChangeLog
r154628 r154629 1 2013-08-24 Sam Weinig <sam@webkit.org> 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 Tests: fast/js/Promise-already-fulfilled.html 13 fast/js/Promise-already-rejected.html 14 fast/js/Promise-already-resolved.html 15 fast/js/Promise-catch-in-workers.html 16 fast/js/Promise-catch.html 17 fast/js/Promise-chain.html 18 fast/js/Promise-exception.html 19 fast/js/Promise-fulfill-in-workers.html 20 fast/js/Promise-fulfill.html 21 fast/js/Promise-init-in-workers.html 22 fast/js/Promise-init.html 23 fast/js/Promise-reject-in-workers.html 24 fast/js/Promise-reject.html 25 fast/js/Promise-resolve-chain.html 26 fast/js/Promise-resolve-in-workers.html 27 fast/js/Promise-resolve-with-then-exception.html 28 fast/js/Promise-resolve-with-then-fulfill.html 29 fast/js/Promise-resolve-with-then-reject.html 30 fast/js/Promise-resolve.html 31 fast/js/Promise-simple-fulfill-inside-callback.html 32 fast/js/Promise-simple-fulfill.html 33 fast/js/Promise-simple-in-workers.html 34 fast/js/Promise-simple.html 35 fast/js/Promise-static-fulfill.html 36 fast/js/Promise-static-reject.html 37 fast/js/Promise-static-resolve.html 38 fast/js/Promise-then-in-workers.html 39 fast/js/Promise-then-without-callbacks-in-workers.html 40 fast/js/Promise-then-without-callbacks.html 41 fast/js/Promise-then.html 42 fast/js/Promise-types.html 43 fast/js/Promise.html 44 45 * GNUmakefile.list.am: 46 * Target.pri: 47 * UseJSC.cmake: 48 * WebCore.vcxproj/WebCore.vcxproj: 49 * WebCore.vcxproj/WebCore.vcxproj.filters: 50 * WebCore.xcodeproj/project.pbxproj: 51 * bindings/js/JSBindingsAllInOne.cpp: 52 Add new files. 53 54 * bindings/js/JSDOMGlobalObjectTask.cpp: Added. 55 (WebCore::JSGlobalObjectCallback::create): 56 (WebCore::JSGlobalObjectCallback::~JSGlobalObjectCallback): 57 (WebCore::JSGlobalObjectCallback::call): 58 (WebCore::JSGlobalObjectCallback::JSGlobalObjectCallback): 59 (WebCore::JSGlobalObjectTask::JSGlobalObjectTask): 60 (WebCore::JSGlobalObjectTask::~JSGlobalObjectTask): 61 (WebCore::JSGlobalObjectTask::performTask): 62 * bindings/js/JSDOMGlobalObjectTask.h: Added. 63 (WebCore::JSGlobalObjectTask::create): 64 Add a new task type to be used with the GlobalObjectMethodTable's new QueueTaskToEventLoop callback. 65 66 * bindings/js/JSDOMWindowBase.cpp: 67 (WebCore::JSDOMWindowBase::queueTaskToEventLoop): 68 * bindings/js/JSDOMWindowBase.h: 69 Implement the GlobalObjectMethodTable callback, QueueTaskToEventLoop. 70 71 * bindings/js/JSMainThreadExecState.h: 72 All using JSMainThreadExecState as a simple RAII object. 73 74 * bindings/js/JSWorkerGlobalScopeBase.cpp: 75 (WebCore::JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase): 76 (WebCore::JSWorkerGlobalScopeBase::allowsAccessFrom): 77 (WebCore::JSWorkerGlobalScopeBase::supportsProfiling): 78 (WebCore::JSWorkerGlobalScopeBase::supportsRichSourceInfo): 79 (WebCore::JSWorkerGlobalScopeBase::shouldInterruptScript): 80 (WebCore::JSWorkerGlobalScopeBase::javaScriptExperimentsEnabled): 81 (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop): 82 * bindings/js/JSWorkerGlobalScopeBase.h: 83 Add a GlobalObjectMethodTable and implement QueueTaskToEventLoop. Forward the other callbacks 84 to JSGlobalObject so they retain their existing behavior. 85 1 86 2013-08-26 Rob Buis <rwlbuis@webkit.org> 2 87 -
trunk/Source/WebCore/GNUmakefile.list.am
r154581 r154629 2333 2333 Source/WebCore/bindings/js/JSDOMGlobalObject.cpp \ 2334 2334 Source/WebCore/bindings/js/JSDOMGlobalObject.h \ 2335 Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp \ 2336 Source/WebCore/bindings/js/JSDOMGlobalObjectTask.h \ 2335 2337 Source/WebCore/bindings/js/JSDOMImplementationCustom.cpp \ 2336 2338 Source/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp \ -
trunk/Source/WebCore/Target.pri
r154581 r154629 103 103 bindings/js/JSDOMFormDataCustom.cpp \ 104 104 bindings/js/JSDOMGlobalObject.cpp \ 105 bindings/js/JSDOMGlobalObjectTask.cpp \ 105 106 bindings/js/JSDOMImplementationCustom.cpp \ 106 107 bindings/js/JSDOMMimeTypeArrayCustom.cpp \ … … 1354 1355 bindings/js/JSDOMBinding.h \ 1355 1356 bindings/js/JSDOMGlobalObject.h \ 1357 bindings/js/JSDOMGlobalObjectTask.h \ 1356 1358 bindings/js/JSDOMWindowBase.h \ 1357 1359 bindings/js/JSDOMWindowCustom.h \ -
trunk/Source/WebCore/UseJSC.cmake
r154127 r154629 54 54 bindings/js/JSDOMFormDataCustom.cpp 55 55 bindings/js/JSDOMGlobalObject.cpp 56 bindings/js/JSDOMGlobalObjectTask.cpp 56 57 bindings/js/JSDOMImplementationCustom.cpp 57 58 bindings/js/JSDOMMimeTypeArrayCustom.cpp -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r154581 r154629 16126 16126 </ClCompile> 16127 16127 <ClCompile Include="..\bindings\js\JSDOMGlobalObject.cpp"> 16128 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 16129 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> 16130 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild> 16131 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild> 16132 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild> 16133 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild> 16134 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> 16135 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> 16136 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild> 16137 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild> 16138 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild> 16139 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild> 16140 </ClCompile> 16141 <ClCompile Include="..\bindings\js\JSDOMGlobalObjectTask.cpp"> 16128 16142 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 16129 16143 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> … … 20680 20694 <ClInclude Include="..\bindings\js\JSDOMBinding.h" /> 20681 20695 <ClInclude Include="..\bindings\js\JSDOMGlobalObject.h" /> 20696 <ClInclude Include="..\bindings\js\JSDOMGlobalObjectTask.h" /> 20682 20697 <ClInclude Include="..\bindings\js\JSDOMWindowBase.h" /> 20683 20698 <ClInclude Include="..\bindings\js\JSDOMWindowCustom.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r154462 r154629 4483 4483 <Filter>bindings\js</Filter> 4484 4484 </ClCompile> 4485 <ClCompile Include="..\bindings\js\JSDOMGlobalObjectTask.cpp"> 4486 <Filter>bindings\js</Filter> 4487 </ClCompile> 4485 4488 <ClCompile Include="..\bindings\js\JSDOMImplementationCustom.cpp"> 4486 4489 <Filter>bindings\js</Filter> … … 11577 11580 </ClInclude> 11578 11581 <ClInclude Include="..\bindings\js\JSDOMGlobalObject.h"> 11582 <Filter>bindings\js</Filter> 11583 </ClInclude> 11584 <ClInclude Include="..\bindings\js\JSDOMGlobalObjectTask.h"> 11579 11585 <Filter>bindings\js</Filter> 11580 11586 </ClInclude> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r154581 r154629 1936 1936 7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1937 1937 7BE7427381FA906FBB4F0F2C /* JSSVGGraphicsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */; }; 1938 7C2BDD3D17C7F98C0038FF15 /* JSDOMGlobalObjectTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */; }; 1939 7C2BDD3E17C7F98C0038FF15 /* JSDOMGlobalObjectTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */; }; 1938 1940 7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */; }; 1939 1941 7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */; }; … … 8333 8335 7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptBreakpoint.h; sourceTree = "<group>"; }; 8334 8336 7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugListener.h; sourceTree = "<group>"; }; 8337 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGlobalObjectTask.cpp; sourceTree = "<group>"; }; 8338 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMGlobalObjectTask.h; sourceTree = "<group>"; }; 8335 8339 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorOverlay.cpp; sourceTree = "<group>"; }; 8336 8340 7C522D4A15B478B2009B7C95 /* InspectorOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorOverlay.h; sourceTree = "<group>"; }; … … 18603 18607 BC4EDEF70C08F414007EDD49 /* Custom */, 18604 18608 14DFB33F0A7DF7630018F769 /* Derived Sources */, 18609 93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */, 18605 18610 49B3760A15C6C6840059131D /* ArrayValue.cpp */, 18606 18611 49B3760B15C6C6840059131D /* ArrayValue.h */, … … 18608 18613 973AA3F315D088F000E38A85 /* BindingState.h */, 18609 18614 BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */, 18610 93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */,18611 18615 312D67B01535691F00563D0D /* Dictionary.cpp */, 18612 18616 316023EF1532C40C00D50FF4 /* Dictionary.h */, … … 18627 18631 E1C36CBC0EB08062007410BC /* JSDOMGlobalObject.cpp */, 18628 18632 E1C36C020EB076D6007410BC /* JSDOMGlobalObject.h */, 18633 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */, 18634 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */, 18629 18635 BC6932710D7E293900AE44D1 /* JSDOMWindowBase.cpp */, 18630 18636 BC6932720D7E293900AE44D1 /* JSDOMWindowBase.h */, … … 23726 23732 5DB1BC6A10715A6400EFAA49 /* TransformSource.h in Headers */, 23727 23733 4945BFD413CF809000CC3B38 /* TransformState.h in Headers */, 23734 7C2BDD3E17C7F98C0038FF15 /* JSDOMGlobalObjectTask.h in Headers */, 23728 23735 E17B491616A9B094001C8839 /* TransitionEvent.h in Headers */, 23729 23736 49E911D20EF86D47009D0CAF /* TranslateTransformOperation.h in Headers */, … … 26289 26296 29A309AC1561C99B00BBD8E5 /* RunLoopCF.cpp in Sources */, 26290 26297 BC0B358314C4F9540055E22A /* RunLoopMac.mm in Sources */, 26298 7C2BDD3D17C7F98C0038FF15 /* JSDOMGlobalObjectTask.cpp in Sources */, 26291 26299 1A569D1E0D7E2B82007C3983 /* runtime_array.cpp in Sources */, 26292 26300 1A569D200D7E2B82007C3983 /* runtime_method.cpp in Sources */, -
trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
r154127 r154629 59 59 #include "JSDOMFormDataCustom.cpp" 60 60 #include "JSDOMGlobalObject.cpp" 61 #include "JSDOMGlobalObjectTask.cpp" 61 62 #include "JSDOMImplementationCustom.cpp" 62 63 #include "JSDOMMimeTypeArrayCustom.cpp" -
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
r154219 r154629 30 30 #include "Frame.h" 31 31 #include "InspectorController.h" 32 #include "JSDOMGlobalObjectTask.h" 32 33 #include "JSDOMWindowCustom.h" 33 34 #include "JSNode.h" … … 51 52 const ClassInfo JSDOMWindowBase::s_info = { "Window", &JSDOMGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSDOMWindowBase) }; 52 53 53 const GlobalObjectMethodTable JSDOMWindowBase::s_globalObjectMethodTable = { &shouldAllowAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled };54 const GlobalObjectMethodTable JSDOMWindowBase::s_globalObjectMethodTable = { &shouldAllowAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled, &queueTaskToEventLoop }; 54 55 55 56 JSDOMWindowBase::JSDOMWindowBase(VM& vm, Structure* structure, PassRefPtr<DOMWindow> window, JSDOMWindowShell* shell) … … 164 165 } 165 166 167 void JSDOMWindowBase::queueTaskToEventLoop(const JSGlobalObject* object, GlobalObjectMethodTable::QueueTaskToEventLoopCallbackFunctionPtr functionPtr, PassRefPtr<TaskContext> taskContext) 168 { 169 const JSDOMWindowBase* thisObject = static_cast<const JSDOMWindowBase*>(object); 170 thisObject->scriptExecutionContext()->postTask(JSGlobalObjectTask::create((JSDOMWindowBase*)thisObject, functionPtr, taskContext)); 171 } 172 166 173 void JSDOMWindowBase::willRemoveFromWindowShell() 167 174 { -
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h
r154038 r154629 65 65 static bool shouldInterruptScript(const JSC::JSGlobalObject*); 66 66 static bool javaScriptExperimentsEnabled(const JSC::JSGlobalObject*); 67 68 static void queueTaskToEventLoop(const JSC::JSGlobalObject*, JSC::GlobalObjectMethodTable::QueueTaskToEventLoopCallbackFunctionPtr, PassRefPtr<JSC::TaskContext>); 69 67 70 void printErrorMessage(const String&) const; 68 71 -
trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h
r153145 r154629 75 75 }; 76 76 77 protected:78 77 explicit JSMainThreadExecState(JSC::ExecState* exec) 79 78 : m_previousState(s_mainThreadState) -
trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp
r154038 r154629 33 33 34 34 #include "DOMWrapperWorld.h" 35 #include "JSDOMGlobalObjectTask.h" 35 36 #include "JSDedicatedWorkerGlobalScope.h" 36 37 #include "JSWorkerGlobalScope.h" … … 47 48 const ClassInfo JSWorkerGlobalScopeBase::s_info = { "WorkerGlobalScope", &JSDOMGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSWorkerGlobalScopeBase) }; 48 49 50 const GlobalObjectMethodTable JSWorkerGlobalScopeBase::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled, &queueTaskToEventLoop }; 51 49 52 JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase(JSC::VM& vm, JSC::Structure* structure, PassRefPtr<WorkerGlobalScope> impl) 50 : JSDOMGlobalObject(vm, structure, normalWorld(vm) )53 : JSDOMGlobalObject(vm, structure, normalWorld(vm), &s_globalObjectMethodTable) 51 54 , m_impl(impl) 52 55 { … … 67 70 { 68 71 return m_impl.get(); 72 } 73 74 bool JSWorkerGlobalScopeBase::allowsAccessFrom(const JSGlobalObject* object, ExecState* exec) 75 { 76 return JSGlobalObject::allowsAccessFrom(object, exec); 77 } 78 79 bool JSWorkerGlobalScopeBase::supportsProfiling(const JSGlobalObject* object) 80 { 81 return JSGlobalObject::supportsProfiling(object); 82 } 83 84 bool JSWorkerGlobalScopeBase::supportsRichSourceInfo(const JSGlobalObject* object) 85 { 86 return JSGlobalObject::supportsRichSourceInfo(object); 87 } 88 89 bool JSWorkerGlobalScopeBase::shouldInterruptScript(const JSGlobalObject* object) 90 { 91 return JSGlobalObject::shouldInterruptScript(object); 92 } 93 94 bool JSWorkerGlobalScopeBase::javaScriptExperimentsEnabled(const JSGlobalObject* object) 95 { 96 return JSGlobalObject::javaScriptExperimentsEnabled(object); 97 } 98 99 void JSWorkerGlobalScopeBase::queueTaskToEventLoop(const JSGlobalObject* object, GlobalObjectMethodTable::QueueTaskToEventLoopCallbackFunctionPtr functionPtr, PassRefPtr<TaskContext> taskContext) 100 { 101 const JSWorkerGlobalScopeBase* thisObject = static_cast<const JSWorkerGlobalScopeBase*>(object); 102 thisObject->scriptExecutionContext()->postTask(JSGlobalObjectTask::create((JSDOMGlobalObject*)thisObject, functionPtr, taskContext)); 69 103 } 70 104 -
trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.h
r154038 r154629 54 54 } 55 55 56 static const JSC::GlobalObjectMethodTable s_globalObjectMethodTable; 57 58 static bool allowsAccessFrom(const JSC::JSGlobalObject*, JSC::ExecState*); 59 static bool supportsProfiling(const JSC::JSGlobalObject*); 60 static bool supportsRichSourceInfo(const JSC::JSGlobalObject*); 61 static bool shouldInterruptScript(const JSC::JSGlobalObject*); 62 static bool javaScriptExperimentsEnabled(const JSC::JSGlobalObject*); 63 static void queueTaskToEventLoop(const JSC::JSGlobalObject*, JSC::GlobalObjectMethodTable::QueueTaskToEventLoopCallbackFunctionPtr, PassRefPtr<JSC::TaskContext>); 64 56 65 protected: 57 66 JSWorkerGlobalScopeBase(JSC::VM&, JSC::Structure*, PassRefPtr<WorkerGlobalScope>);
Note: See TracChangeset
for help on using the changeset viewer.