Skip to content

Instantly share code, notes, and snippets.

@arturovt
Last active December 6, 2018 22:19
Show Gist options
  • Save arturovt/9f7f15a51401dbe82c3965a1d148d1f5 to your computer and use it in GitHub Desktop.
Save arturovt/9f7f15a51401dbe82c3965a1d148d1f5 to your computer and use it in GitHub Desktop.
V8_NOINLINE static Type Stats_Runtime_DynamicImportCall(
int args_length,
Object** args_object,
Isolate* isolate
) {
RuntimeCallTimerScope timer(isolate, RuntimeCallCounterId::kRuntime_DynamicImportCall);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), "V8.Runtime_" Runtime_DynamicImportCall);
Arguments args(args_length, args_object);
return __RT_impl_Runtime_DynamicImportCall(args, isolate);
}
static Type __RT_impl_Runtime_DynamicImportCall(Arguments args, Isolate* isolate) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, specifier, 1);
Handle<Script> script(Script::cast(function->shared()->script()), isolate);
while (script->has_eval_from_shared()) {
script = handle(Script::cast(script->eval_from_shared()->script()), isolate);
}
RETURN_RESULT_OR_FAILURE(
isolate,
isolate->RunHostImportModuleDynamicallyCallback(script, specifier)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment