Ignore:
Timestamp:
Apr 24, 2019, 3:42:38 PM (6 years ago)
Author:
[email protected]
Message:

Add SPI callbacks for before and after module execution
https://bugs.webkit.org/show_bug.cgi?id=197244
<rdar://problem/50180511>

Reviewed by Yusuke Suzuki.

This is helpful for clients that want to profile execution of modules
in some way. E.g, if they want to time module execution time.

  • API/JSAPIGlobalObject.h:
  • API/JSAPIGlobalObject.mm:

(JSC::JSAPIGlobalObject::moduleLoaderEvaluate):

  • API/JSContextPrivate.h:
  • API/tests/testapi.mm:

(+[JSContextFetchDelegate contextWithBlockForFetch:]):
(-[JSContextFetchDelegate willEvaluateModule:]):
(-[JSContextFetchDelegate didEvaluateModule:]):
(testFetch):
(testFetchWithTwoCycle):
(testFetchWithThreeCycle):
(testLoaderResolvesAbsoluteScriptURL):
(testLoaderRejectsNilScriptURL):

  • runtime/JSModuleLoader.cpp:

(JSC::JSModuleLoader::evaluate):
(JSC::JSModuleLoader::evaluateNonVirtual):

  • runtime/JSModuleLoader.h:
File:
1 edited

Legend:

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

    r240023 r244620  
    8181    // Additional platform dependent hooked APIs.
    8282    JSValue evaluate(ExecState*, JSValue key, JSValue moduleRecord, JSValue scriptFetcher);
     83    JSValue evaluateNonVirtual(ExecState*, JSValue key, JSValue moduleRecord, JSValue scriptFetcher);
    8384
    8485    // Utility functions.
Note: See TracChangeset for help on using the changeset viewer.