[ES6] Add ModuleLoaderPrototype and move methods to it
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Aug 2016 08:37:06 +0000 (08:37 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Aug 2016 08:37:06 +0000 (08:37 +0000)
commite4536b5a9de9fd92503edff21d33c4629887c8a5
tree8c5a3d37abe08ef98e110140abd8f7a9d1d7c0e9
parent7ae01c1d42cb0358a0b3da5a4a544e1fcfe8e28e
[ES6] Add ModuleLoaderPrototype and move methods to it
https://bugs.webkit.org/show_bug.cgi?id=160633

Reviewed by Saam Barati.

Source/JavaScriptCore:

In the future, we need to add the ability to create the new Loader object (by users).
So rather than holding all the methods in the ModuleLoaderObject instance, moving them
to ModuleLoaderPrototype and create the default JSModuleLoader instance is better.

No behavior change.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/ModuleLoaderObject.js:
(setStateToMax): Deleted.
(newRegistryEntry): Deleted.
(ensureRegistered): Deleted.
(forceFulfillPromise): Deleted.
(fulfillFetch): Deleted.
(fulfillTranslate): Deleted.
(fulfillInstantiate): Deleted.
(commitInstantiated): Deleted.
(instantiation): Deleted.
(requestFetch): Deleted.
(requestTranslate): Deleted.
(requestInstantiate): Deleted.
(requestResolveDependencies.): Deleted.
(requestResolveDependencies): Deleted.
(requestInstantiateAll): Deleted.
(requestLink): Deleted.
(requestReady): Deleted.
(link): Deleted.
(moduleEvaluation): Deleted.
(provide): Deleted.
(loadAndEvaluateModule): Deleted.
(loadModule): Deleted.
(linkAndEvaluateModule): Deleted.
* builtins/ModuleLoaderPrototype.js: Renamed from Source/JavaScriptCore/builtins/ModuleLoaderObject.js.
(setStateToMax):
(newRegistryEntry):
(ensureRegistered):
(forceFulfillPromise):
(fulfillFetch):
(fulfillTranslate):
(fulfillInstantiate):
(commitInstantiated):
(instantiation):
(requestFetch):
(requestTranslate):
(requestInstantiate):
(requestResolveDependencies.):
(requestResolveDependencies):
(requestInstantiateAll):
(requestLink):
(requestReady):
(link):
(moduleEvaluation):
(provide):
(loadAndEvaluateModule):
(loadModule):
(linkAndEvaluateModule):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* jsc.cpp:
(GlobalObject::moduleLoaderResolve):
(GlobalObject::moduleLoaderFetch):
* runtime/Completion.cpp:
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::moduleLoader):
(JSC::JSGlobalObject::moduleLoaderStructure):
* runtime/JSModuleLoader.cpp: Added.
(JSC::JSModuleLoader::JSModuleLoader):
(JSC::JSModuleLoader::finishCreation):
(JSC::printableModuleKey):
(JSC::JSModuleLoader::provide):
(JSC::JSModuleLoader::loadAndEvaluateModule):
(JSC::JSModuleLoader::loadModule):
(JSC::JSModuleLoader::linkAndEvaluateModule):
(JSC::JSModuleLoader::resolve):
(JSC::JSModuleLoader::fetch):
(JSC::JSModuleLoader::translate):
(JSC::JSModuleLoader::instantiate):
(JSC::JSModuleLoader::evaluate):
* runtime/JSModuleLoader.h: Copied from Source/JavaScriptCore/runtime/ModuleLoaderObject.h.
(JSC::JSModuleLoader::create):
(JSC::JSModuleLoader::createStructure):
* runtime/JSModuleRecord.h:
* runtime/ModuleLoaderObject.cpp: Removed.
(JSC::ModuleLoaderObject::ModuleLoaderObject): Deleted.
(JSC::ModuleLoaderObject::finishCreation): Deleted.
(JSC::printableModuleKey): Deleted.
(JSC::ModuleLoaderObject::provide): Deleted.
(JSC::ModuleLoaderObject::loadAndEvaluateModule): Deleted.
(JSC::ModuleLoaderObject::loadModule): Deleted.
(JSC::ModuleLoaderObject::linkAndEvaluateModule): Deleted.
(JSC::ModuleLoaderObject::resolve): Deleted.
(JSC::ModuleLoaderObject::fetch): Deleted.
(JSC::ModuleLoaderObject::translate): Deleted.
(JSC::ModuleLoaderObject::instantiate): Deleted.
(JSC::ModuleLoaderObject::evaluate): Deleted.
(JSC::moduleLoaderObjectParseModule): Deleted.
(JSC::moduleLoaderObjectRequestedModules): Deleted.
(JSC::moduleLoaderObjectModuleDeclarationInstantiation): Deleted.
(JSC::moduleLoaderObjectResolve): Deleted.
(JSC::moduleLoaderObjectFetch): Deleted.
(JSC::moduleLoaderObjectTranslate): Deleted.
(JSC::moduleLoaderObjectInstantiate): Deleted.
(JSC::moduleLoaderObjectEvaluate): Deleted.
* runtime/ModuleLoaderObject.h:
(JSC::ModuleLoaderObject::create): Deleted.
(JSC::ModuleLoaderObject::createStructure): Deleted.
* runtime/ModuleLoaderPrototype.cpp: Added.
(JSC::ModuleLoaderPrototype::ModuleLoaderPrototype):
(JSC::moduleLoaderPrototypeParseModule):
(JSC::moduleLoaderPrototypeRequestedModules):
(JSC::moduleLoaderPrototypeModuleDeclarationInstantiation):
(JSC::moduleLoaderPrototypeResolve):
(JSC::moduleLoaderPrototypeFetch):
(JSC::moduleLoaderPrototypeTranslate):
(JSC::moduleLoaderPrototypeInstantiate):
(JSC::moduleLoaderPrototypeEvaluate):
* runtime/ModuleLoaderPrototype.h: Renamed from Source/JavaScriptCore/runtime/ModuleLoaderObject.h.
(JSC::ModuleLoaderPrototype::create):
(JSC::ModuleLoaderPrototype::createStructure):

Source/WebCore:

No behavior change.

* ForwardingHeaders/runtime/JSModuleLoader.h: Added.
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::moduleLoaderResolve):
(WebCore::JSDOMWindowBase::moduleLoaderFetch):
(WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSModuleLoader.cpp:
(WebCore::JSModuleLoader::resolve):
(WebCore::JSModuleLoader::fetch):
(WebCore::JSModuleLoader::evaluate):
* bindings/js/JSModuleLoader.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204330 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/DerivedSources.make
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/builtins/ModuleLoaderPrototype.js [moved from Source/JavaScriptCore/builtins/ModuleLoaderObject.js with 100% similarity]
Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/Completion.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSModuleLoader.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/JSModuleLoader.h [moved from Source/JavaScriptCore/runtime/ModuleLoaderObject.h with 84% similarity]
Source/JavaScriptCore/runtime/JSModuleRecord.h
Source/JavaScriptCore/runtime/ModuleLoaderObject.cpp [deleted file]
Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/ModuleLoaderPrototype.h [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/ForwardingHeaders/runtime/JSModuleLoader.h [new file with mode: 0644]
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.h
Source/WebCore/bindings/js/JSModuleLoader.cpp
Source/WebCore/bindings/js/JSModuleLoader.h