Changeset 190401 in webkit
- Timestamp:
- Oct 1, 2015 5:30:43 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r190396 r190401 1 2015-10-01 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 [Streams API] Add support for private WebCore JS builtins functions 4 https://bugs.webkit.org/show_bug.cgi?id=149518 5 6 Reviewed by Darin Adler. 7 8 Rebasing tests now that tee is appearing in the IDL, although not yet conformant in its implementation. 9 10 * streams/reference-implementation/readable-stream-expected.txt: 11 * streams/reference-implementation/readable-stream-tee-expected.txt: 12 * streams/reference-implementation/readable-stream-templated-expected.txt: 13 1 14 2015-10-01 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 15 -
trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt
r190396 r190401 2 2 PASS ReadableStream can be constructed with no errors 3 3 PASS ReadableStream can't be constructed with garbage 4 FAIL ReadableStream instances should have the correct list of properties assert_ array_equals: should have all the correct methods lengths differ, expected 7 got 64 FAIL ReadableStream instances should have the correct list of properties assert_false: method should be non-enumerable expected false got true 5 5 PASS ReadableStream constructor should throw for non-function start arguments 6 6 PASS ReadableStream constructor can get initial garbage as cancel argument -
trunk/LayoutTests/streams/reference-implementation/readable-stream-tee-expected.txt
r185586 r190401 1 1 2 FAIL ReadableStream teeing: rs.tee() returns an array of two ReadableStreams rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)3 FAIL ReadableStream teeing: should be able to read one branch to the end without affecting the other rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)4 FAIL ReadableStream teeing: values should be equal across each branch rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)5 FAIL ReadableStream teeing: errors in the source should propagate to both branches rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)6 FAIL ReadableStream teeing: canceling branch1 should not impact branch2 rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)7 FAIL ReadableStream teeing: canceling branch2 should not impact branch1 rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)8 FAIL ReadableStream teeing: canceling both branches should aggregate the cancel reasons into an array rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)9 FAIL ReadableStream teeing: failing to cancel the original stream should cause cancel() to reject on branches rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)10 FAIL ReadableStream teeing: closing the original should immediately close the branches rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)11 FAIL ReadableStream teeing: erroring the original should immediately error the branches rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)2 FAIL ReadableStream teeing: rs.tee() returns an array of two ReadableStreams tee is not implemented 3 FAIL ReadableStream teeing: should be able to read one branch to the end without affecting the other tee is not implemented 4 FAIL ReadableStream teeing: values should be equal across each branch tee is not implemented 5 FAIL ReadableStream teeing: errors in the source should propagate to both branches tee is not implemented 6 FAIL ReadableStream teeing: canceling branch1 should not impact branch2 tee is not implemented 7 FAIL ReadableStream teeing: canceling branch2 should not impact branch1 tee is not implemented 8 FAIL ReadableStream teeing: canceling both branches should aggregate the cancel reasons into an array tee is not implemented 9 FAIL ReadableStream teeing: failing to cancel the original stream should cause cancel() to reject on branches tee is not implemented 10 FAIL ReadableStream teeing: closing the original should immediately close the branches tee is not implemented 11 FAIL ReadableStream teeing: erroring the original should immediately error the branches tee is not implemented 12 12 -
trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt
r189693 r190401 1 1 2 2 PASS Running templatedRSEmpty with ReadableStream (empty) 3 FAIL instances have the correct methods and properties assert_equals: has a tee method expected "function" but got "undefined" 3 PASS instances have the correct methods and properties 4 4 PASS Running templatedRSEmptyReader with ReadableStream (empty) reader 5 5 PASS instances have the correct methods and properties -
trunk/Source/JavaScriptCore/ChangeLog
r190390 r190401 1 2015-10-01 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 [Streams API] Add support for private WebCore JS builtins functions 4 https://bugs.webkit.org/show_bug.cgi?id=149518 5 6 Reviewed by Darin Adler. 7 8 Adding API to add private identifiers on the fly. 9 This is used to support private JS Builtin functions/private JS Builtin names in WebCore. 10 11 * builtins/BuiltinNames.h: 12 (JSC::BuiltinNames::appendExternalName): 13 * runtime/CommonIdentifiers.cpp: 14 (JSC::CommonIdentifiers::appendExternalName): 15 * runtime/CommonIdentifiers.h: 16 1 17 2015-09-30 Jaehun Lim <ljaehun.lim@samsung.com> 2 18 -
trunk/Source/JavaScriptCore/builtins/BuiltinNames.h
r190155 r190401 60 60 const Identifier& lookUpPublicName(const Identifier&) const; 61 61 62 void appendExternalName(const Identifier& publicName, const Identifier& privateName); 63 62 64 JSC_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) 63 65 JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) … … 109 111 } 110 112 113 inline void BuiltinNames::appendExternalName(const Identifier& publicName, const Identifier& privateName) 114 { 115 #ifndef NDEBUG 116 for (const auto& key : m_publicToPrivateMap.keys()) 117 ASSERT(publicName.string() != *key); 118 #endif 119 120 m_privateToPublicMap.add(privateName.impl(), &publicName); 121 m_publicToPrivateMap.add(publicName.impl(), &privateName); 122 } 111 123 112 124 } -
trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.cpp
r188752 r190401 79 79 } 80 80 81 void CommonIdentifiers::appendExternalName(const Identifier& publicName, const Identifier& privateName) 82 { 83 m_builtinNames->appendExternalName(publicName, privateName); 84 } 81 85 82 86 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h
r190385 r190401 360 360 const BytecodeIntrinsicRegistry& bytecodeIntrinsicRegistry() const { return m_bytecodeIntrinsicRegistry; } 361 361 362 // Callers of this method should make sure that identifiers given to this method 363 // survive the lifetime of CommonIdentifiers and related VM. 364 JS_EXPORT_PRIVATE void appendExternalName(const Identifier& publicName, const Identifier& privateName); 365 362 366 private: 363 367 BytecodeIntrinsicRegistry m_bytecodeIntrinsicRegistry; -
trunk/Source/WebCore/CMakeLists.txt
r190394 r190401 3356 3356 ${WEBCORE_DIR}/Modules/streams/CountQueuingStrategy.js 3357 3357 ${WEBCORE_DIR}/Modules/streams/ReadableStream.js 3358 ${WEBCORE_DIR}/Modules/streams/ReadableStreamInternals.js 3358 3359 ) 3359 3360 -
trunk/Source/WebCore/ChangeLog
r190398 r190401 1 2015-10-01 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 [Streams API] Add support for private WebCore JS builtins functions 4 https://bugs.webkit.org/show_bug.cgi?id=149518 5 6 Reviewed by Darin Adler. 7 8 Using ReadableStream tee method as a testbed to add support for private WebCore JS builtins functions. 9 Private functions are hooked to JSDOMWindowBase, as it is the one connected to WebCoreClientData. 10 WebCoreClientData is responsible to export the private function symbols to the VM. 11 12 Updated generate-js-builtins script to generate a class that can create and own all JS functions. 13 This class is used by JSDOMWindowBase to create the JS builtin functions. 14 It is also used to manage the GC of these objects. 15 16 Covered by rebased tests. 17 18 * CMakeLists.txt: Adding ReadableStreamInternals builtin files. 19 * DerivedSources.cpp: Ditto. 20 * DerivedSources.make: Ditto. 21 * Modules/streams/ReadableStream.idl: Adding tee declaration as builtin 22 * Modules/streams/ReadableStream.js: 23 (tee): Calling @teeReadableStream 24 * Modules/streams/ReadableStreamInternals.js: Barebone @teeReadableStream implementation. 25 (teeReadableStream): 26 * WebCore.vcxproj/WebCore.vcxproj: Adding ReadableStreamInternals builtin files. 27 * WebCore.xcodeproj/project.pbxproj: Adding ReadableStreamInternals builtin files. 28 * bindings/js/JSDOMWindowBase.cpp: 29 (WebCore::JSDOMWindowBase::JSDOMWindowBase): Creating ReadableStreamInternalsBuiltinFunctions object. 30 (WebCore::JSDOMWindowBase::finishCreation): Creating builtin functions through ReadableStreamInternalsBuiltinFunctions and registering them to the JS engine. 31 (WebCore::JSDOMWindowBase::visitChildren): Ensuring GC does not collect private builtin functions through ReadableStreamInternalsBuiltinFunctions object 32 * bindings/js/JSDOMWindowBase.h: 33 * bindings/js/WebCoreJSClientData.h: 34 (WebCore::WebCoreJSClientData::WebCoreJSClientData): Exporting private names of ReadableStreamInternalsBuiltins 35 (WebCore::WebCoreJSClientData::readableStreamBuiltins): 36 (WebCore::WebCoreJSClientData::readableStreamInternalsBuiltins): 37 * generate-js-builtins: Adding support for ReadableStreamInternalsBuiltinFunctions and exportNames. 38 1 39 2015-10-01 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 40 -
trunk/Source/WebCore/DerivedSources.make
r190394 r190401 1254 1254 $(WebCore)/Modules/streams/CountQueuingStrategy.js \ 1255 1255 $(WebCore)/Modules/streams/ReadableStream.js \ 1256 $(WebCore)/Modules/streams/ReadableStreamInternals.js \ 1256 1257 # 1257 1258 -
trunk/Source/WebCore/Modules/streams/ReadableStream.idl
r190155 r190401 38 38 [Custom] Promise pipeTo(any streams, any options); 39 39 [JSBuiltin] Object pipeThrough(any dest, any options); 40 [JSBuiltin] Object tee(); 40 41 41 42 readonly attribute boolean locked; -
trunk/Source/WebCore/Modules/streams/ReadableStream.js
r190155 r190401 31 31 return streams.readable; 32 32 } 33 34 function tee() 35 { 36 "use strict"; 37 38 // TODO: check this is a ReadableStream 39 return @teeReadableStream(this, false) 40 } -
trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js
r190400 r190401 1 1 /* 2 * Copyright (C) 2015 Canon Inc. 2 * Copyright (C) 2015 Canon Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 function pipeThrough(streams, options)26 function teeReadableStream(stream, shouldClone) 27 27 { 28 28 "use strict"; 29 29 30 this.pipeTo(streams.writable, options); 31 return streams.readable; 30 throw new @TypeError("tee is not implemented"); 32 31 } -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r190394 r190401 3934 3934 </ClCompile> 3935 3935 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSReadableStream.cpp"> 3936 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 3937 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> 3938 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild> 3939 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild> 3940 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild> 3941 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild> 3942 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> 3943 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> 3944 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild> 3945 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild> 3946 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild> 3947 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild> 3948 </ClCompile> 3949 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\ReadableStreamInternalsBuiltins.cpp"> 3936 3950 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 3937 3951 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r190394 r190401 1505 1505 4162A4581011464700DFF3ED /* JSDedicatedWorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 4162A4561011464700DFF3ED /* JSDedicatedWorkerGlobalScope.h */; }; 1506 1506 416E29A6102FA962007FC14E /* WorkerReportingProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 416E29A5102FA962007FC14E /* WorkerReportingProxy.h */; }; 1507 416E6FE81BBD12DF000A6043 /* ReadableStreamInternalsBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1508 416E6FE91BBD12E5000A6043 /* ReadableStreamBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1509 416E6FEA1BBD1684000A6043 /* ReadableStreamInternalsBuiltinsWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8071BB3110D00B764D9 /* ReadableStreamInternalsBuiltinsWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1507 1510 417253AA1354BBBC00360F2A /* MediaControlElements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417253A81354BBBC00360F2A /* MediaControlElements.cpp */; }; 1508 1511 417253AB1354BBBC00360F2A /* MediaControlElements.h in Headers */ = {isa = PBXBuildFile; fileRef = 417253A91354BBBC00360F2A /* MediaControlElements.h */; }; … … 11328 11331 9AB1F37F18E2489A00534743 /* CSSToLengthConversionData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSToLengthConversionData.cpp; sourceTree = "<group>"; }; 11329 11332 9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamBuiltins.h; sourceTree = "<group>"; }; 11333 9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamInternalsBuiltins.h; sourceTree = "<group>"; }; 11330 11334 9B03D8071BB3110D00B764D8 /* ReadableStreamBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamBuiltinsWrapper.h; sourceTree = "<group>"; }; 11335 9B03D8071BB3110D00B764D9 /* ReadableStreamInternalsBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamInternalsBuiltinsWrapper.h; sourceTree = "<group>"; }; 11331 11336 9B19B67E1B964E5200348745 /* ShadowRoot.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ShadowRoot.idl; sourceTree = "<group>"; }; 11332 11337 9B1AB0791648C69D0051F3F2 /* HTMLFormControlsCollection.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HTMLFormControlsCollection.idl; sourceTree = "<group>"; }; … … 17078 17083 71E2183917359FB8006E6E4D /* PlugInsResourcesData.cpp */, 17079 17084 9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */, 17085 9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */, 17080 17086 9B03D8071BB3110D00B764D8 /* ReadableStreamBuiltinsWrapper.h */, 17087 9B03D8071BB3110D00B764D9 /* ReadableStreamInternalsBuiltinsWrapper.h */, 17081 17088 43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */, 17082 17089 43B85ED318CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.gperf */, … … 25085 25092 85526CD20AB0B7D9000302EA /* DOMTreeWalker.h in Headers */, 25086 25093 850B41C30AD9E7E700A6ED4F /* DOMTreeWalkerInternal.h in Headers */, 25094 416E6FE91BBD12E5000A6043 /* ReadableStreamBuiltins.h in Headers */, 25087 25095 85C7F4910AAF79DC004014DD /* DOMUIEvent.h in Headers */, 25088 25096 85989DD00ACC8BBD00A0BC51 /* DOMUIEventInternal.h in Headers */, … … 25265 25273 B2C3DA660D006CD600EF6F26 /* FontDescription.h in Headers */, 25266 25274 4A6E9FC813C17D570046A7F8 /* FontFeatureSettings.h in Headers */, 25275 416E6FE81BBD12DF000A6043 /* ReadableStreamInternalsBuiltins.h in Headers */, 25267 25276 409EBDB616B7EEA300CBA3FC /* FontLoader.h in Headers */, 25268 25277 0845680812B90DA600960A9F /* FontMetrics.h in Headers */, … … 25730 25739 652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */, 25731 25740 BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowShell.h in Headers */, 25741 416E6FEA1BBD1684000A6043 /* ReadableStreamInternalsBuiltinsWrapper.h in Headers */, 25732 25742 65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */, 25733 25743 FD7868BA136B999200D403DF /* JSDynamicsCompressorNode.h in Headers */, -
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
r190272 r190401 48 48 #endif 49 49 50 #if ENABLE(STREAMS_API) 51 #include "ReadableStreamInternalsBuiltins.h" 52 #endif 53 50 54 using namespace JSC; 51 55 … … 66 70 , m_impl(window) 67 71 , m_shell(shell) 72 #if ENABLE(STREAMS_API) 73 , m_readableStreamFunctions(vm) 74 #endif 68 75 { 69 76 } … … 74 81 ASSERT(inherits(info())); 75 82 83 #if ENABLE(STREAMS_API) 84 m_readableStreamFunctions.init(*this); 85 #endif 86 76 87 GlobalPropertyInfo staticGlobals[] = { 77 88 GlobalPropertyInfo(vm.propertyNames->document, jsNull(), DontDelete | ReadOnly), 78 GlobalPropertyInfo(vm.propertyNames->window, m_shell, DontDelete | ReadOnly) 89 GlobalPropertyInfo(vm.propertyNames->window, m_shell, DontDelete | ReadOnly), 90 #if ENABLE(STREAMS_API) 91 #define DECLARE_GLOBAL_STATIC(name)\ 92 GlobalPropertyInfo(\ 93 static_cast<WebCoreJSClientData*>(vm.clientData)->readableStreamInternalsBuiltins().name##PrivateName(),\ 94 m_readableStreamFunctions.m_##name##Function.get() , DontDelete | ReadOnly), 95 WEBCOREREADABLESTREAMINTERNALS_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC) 96 #undef EXPORT_FUNCTION 97 #endif 79 98 }; 80 99 81 100 addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals)); 101 } 102 103 void JSDOMWindowBase::visitChildren(JSCell* cell, SlotVisitor& visitor) 104 { 105 JSDOMWindowBase* thisObject = jsCast<JSDOMWindowBase*>(cell); 106 ASSERT_GC_OBJECT_INHERITS(thisObject, info()); 107 Base::visitChildren(thisObject, visitor); 108 #if ENABLE(STREAMS_API) 109 thisObject->m_readableStreamFunctions.visit(visitor); 110 #endif 82 111 } 83 112 -
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h
r190272 r190401 23 23 #include "JSDOMBinding.h" 24 24 #include "JSDOMGlobalObject.h" 25 #include "ReadableStreamInternalsBuiltinsWrapper.h" 25 26 #include <wtf/Forward.h> 26 27 … … 74 75 static JSC::VM& commonVM(); 75 76 static void fireFrameClearedWatchpointsForWindow(DOMWindow*); 77 static void visitChildren(JSC::JSCell*, JSC::SlotVisitor&); 76 78 77 79 protected: … … 85 87 RefPtr<DOMWindow> m_impl; 86 88 JSDOMWindowShell* m_shell; 89 90 #if ENABLE(STREAMS_API) 91 ReadableStreamInternalsBuiltinFunctions m_readableStreamFunctions; 92 #endif 87 93 }; 88 94 -
trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp
r190394 r190401 30 30 #include "CountQueuingStrategyBuiltins.cpp" 31 31 #include "ReadableStreamBuiltins.cpp" 32 #include "ReadableStreamInternalsBuiltins.cpp" 32 33 #endif -
trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h
r190394 r190401 32 32 #include "CountQueuingStrategyBuiltinsWrapper.h" 33 33 #include "ReadableStreamBuiltinsWrapper.h" 34 #include "ReadableStreamInternalsBuiltinsWrapper.h" 34 35 #endif 35 36 … … 45 46 explicit WebCoreJSClientData(JSC::VM& vm) 46 47 : m_readableStreamBuiltins(&vm) 48 , m_readableStreamInternalsBuiltins(&vm) 47 49 , m_byteLengthQueuingStrategyBuiltins(&vm) 48 50 , m_countQueuingStrategyBuiltins(&vm) … … 51 53 #endif 52 54 { 55 #if ENABLE(STREAMS_API) 56 m_readableStreamInternalsBuiltins.exportNames(); 57 #endif 53 58 } 54 59 … … 87 92 #if ENABLE(STREAMS_API) 88 93 ReadableStreamBuiltinsWrapper& readableStreamBuiltins() { return m_readableStreamBuiltins; } 94 ReadableStreamInternalsBuiltinsWrapper& readableStreamInternalsBuiltins() { return m_readableStreamInternalsBuiltins; } 89 95 ByteLengthQueuingStrategyBuiltinsWrapper& byteLengthQueuingStrategyBuiltins() { return m_byteLengthQueuingStrategyBuiltins; } 90 96 CountQueuingStrategyBuiltinsWrapper& countQueuingStrategyBuiltins() { return m_countQueuingStrategyBuiltins; } … … 97 103 #if ENABLE(STREAMS_API) 98 104 ReadableStreamBuiltinsWrapper m_readableStreamBuiltins; 105 ReadableStreamInternalsBuiltinsWrapper m_readableStreamInternalsBuiltins; 99 106 ByteLengthQueuingStrategyBuiltinsWrapper m_byteLengthQueuingStrategyBuiltins; 100 107 CountQueuingStrategyBuiltinsWrapper m_countQueuingStrategyBuiltins; -
trunk/Source/WebCore/generate-js-builtins
r190178 r190401 81 81 #include <builtins/BuiltinUtils.h> 82 82 #include <runtime/Identifier.h> 83 #include <runtime/JSFunction.h> 83 84 84 85 namespace WebCore { 85 86 86 class ${Filename}BuiltinsWrapper : private JSC::WeakHandleOwner 87 { 87 class ${Filename}BuiltinsWrapper : private JSC::WeakHandleOwner { 88 88 public: 89 89 explicit ${Filename}BuiltinsWrapper(JSC::VM* vm) … … 103 103 104 104 ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) 105 106 void exportNames(); 105 107 106 108 private: … … 127 129 #undef DEFINE_BUILTIN_EXECUTABLES 128 130 131 inline void ${Filename}BuiltinsWrapper::exportNames() 132 { 133 #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); 134 ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) 135 #undef EXPORT_FUNCTION_NAME 136 } 137 138 class ${Filename}BuiltinFunctions { 139 public: 140 explicit ${Filename}BuiltinFunctions(JSC::VM& vm) : m_vm(vm) { } 141 142 void init(JSC::JSGlobalObject&); 143 void visit(JSC::SlotVisitor&); 144 145 public: 146 JSC::VM& m_vm; 147 148 #define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \\ 149 JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function; 150 ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS) 151 #undef DECLARE_BUILTIN_SOURCE_MEMBERS 152 }; 153 154 inline void ${Filename}BuiltinFunctions::init(JSC::JSGlobalObject& globalObject) 155 { 156 #define EXPORT_FUNCTION(codeName, functionName, length)\\ 157 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject)); 158 ${Prefix}_FOREACH_BUILTIN(EXPORT_FUNCTION) 159 #undef EXPORT_FUNCTION 160 } 161 162 inline void ${Filename}BuiltinFunctions::visit(JSC::SlotVisitor& visitor) 163 { 164 #define VISIT_FUNCTION(name) visitor.append(&m_##name##Function); 165 ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION) 166 #undef VISIT_FUNCTION 167 } 168 129 169 } // namespace WebCore 130 170
Note: See TracChangeset
for help on using the changeset viewer.