Ignore:
Timestamp:
Oct 11, 2017, 5:30:37 AM (8 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Drop Instantiate hook in ES6 module loader
https://bugs.webkit.org/show_bug.cgi?id=178162

Reviewed by Sam Weinig.

Source/JavaScriptCore:

This patch is a part of patch series for module loader refactoring to adopt
integrity="" parameters and introduce new whatwg module import mechanism.

In this patch, we drop instantiate hook in module loader. This hook is originally
introduced because it is defined in whatwg/loader spec. But this hook is not
used in our implementation, and this hook won't be used since (1) whatwg/loader
spec is abandoned, and (2) this type of hooks should be done in Service Workers.

In addition, this patch applies some cleaning up of our module loader JS code
to simplify things. This change paves the way to more efficient loader implementation
with great flexibility to adopt integrity="" parameters.

  • builtins/ModuleLoaderPrototype.js:

(requestInstantiate):
(provideFetch):
provide is changed to provideFetch since we only used this function with Fetch stage parameter.

(fulfillInstantiate): Deleted.
(commitInstantiated): Deleted.
(instantiation): Deleted.
They are merged into requestInstantiate code. This is simpler.

(provide): Deleted.

  • jsc.cpp:
  • runtime/Completion.cpp:

(JSC::loadAndEvaluateModule):
(JSC::loadModule):

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

(JSC::JSModuleLoader::provideFetch):
(JSC::JSModuleLoader::provide): Deleted.
Changed to provideFetch.

(JSC::JSModuleLoader::instantiate): Deleted.
Drop this hook.

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

(JSC::moduleLoaderPrototypeInstantiate): Deleted.
Drop this hook.

Source/WebCore:

Drop instantiate hooks.
No behavior change.

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

Legend:

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

    r221822 r223173  
    188188
    189189    // Insert the given source code to the ModuleLoader registry as the fetched registry entry.
    190     globalObject->moduleLoader()->provide(exec, key, JSModuleLoader::Status::Fetch, source);
     190    globalObject->moduleLoader()->provideFetch(exec, key, source);
    191191    RETURN_IF_EXCEPTION(scope, rejectPromise(exec, globalObject));
    192192
     
    228228    // Insert the given source code to the ModuleLoader registry as the fetched registry entry.
    229229    // FIXME: Introduce JSSourceCode object to wrap around this source.
    230     globalObject->moduleLoader()->provide(exec, key, JSModuleLoader::Status::Fetch, source);
     230    globalObject->moduleLoader()->provideFetch(exec, key, source);
    231231    RETURN_IF_EXCEPTION(scope, rejectPromise(exec, globalObject));
    232232
Note: See TracChangeset for help on using the changeset viewer.