Ignore:
Timestamp:
Dec 7, 2016, 5:02:13 PM (9 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Drop translate phase in module loader
https://bugs.webkit.org/show_bug.cgi?id=164861

Reviewed by Saam Barati.

Source/JavaScriptCore:

Originally, this "translate" phase was introduced to the module loader.
However, recent rework discussion[1] starts dropping this phase.
And this "translate" phase is meaningless in the browser side module loader
since this phase originally mimics the node.js's translation hook (like,
transpiling CoffeeScript source to JavaScript).

This "translate" phase is not necessary for the exposed HTML5
<script type="module"> tag right now. Once the module loader pipeline is
redefined and specified, we need to update the current loader anyway.
So dropping "translate" phase right now is OK.

This a bit simplifies the current module loader pipeline.

[1]: https://github.com/whatwg/loader/issues/147

  • builtins/ModuleLoaderPrototype.js:

(newRegistryEntry):
(fulfillFetch):
(requestFetch):
(requestInstantiate):
(provide):
(fulfillTranslate): Deleted.
(requestTranslate): Deleted.

  • bytecode/BytecodeIntrinsicRegistry.cpp:

(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):

  • jsc.cpp:
  • runtime/JSGlobalObject.cpp:
  • runtime/JSGlobalObject.h:
  • runtime/JSModuleLoader.cpp:

(JSC::JSModuleLoader::translate): Deleted.

  • runtime/JSModuleLoader.h:
  • runtime/ModuleLoaderPrototype.cpp:

(JSC::moduleLoaderPrototypeInstantiate):
(JSC::moduleLoaderPrototypeTranslate): Deleted.

Source/WebCore:

  • bindings/js/JSDOMWindowBase.cpp:
  • bindings/js/JSWorkerGlobalScopeBase.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSModuleLoader.cpp

    r206459 r209500  
    170170}
    171171
    172 JSInternalPromise* JSModuleLoader::translate(ExecState* exec, JSValue key, JSValue payload, JSValue initiator)
    173 {
    174     if (Options::dumpModuleLoadingState())
    175         dataLog("Loader [translate] ", printableModuleKey(exec, key), "\n");
    176 
    177     JSGlobalObject* globalObject = exec->lexicalGlobalObject();
    178     if (globalObject->globalObjectMethodTable()->moduleLoaderTranslate)
    179         return globalObject->globalObjectMethodTable()->moduleLoaderTranslate(globalObject, exec, this, key, payload, initiator);
    180     JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
    181     deferred->resolve(exec, payload);
    182     return deferred->promise();
    183 }
    184 
    185172JSInternalPromise* JSModuleLoader::instantiate(ExecState* exec, JSValue key, JSValue source, JSValue initiator)
    186173{
Note: See TracChangeset for help on using the changeset viewer.