Commit d55f9297 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

Revert "Skip Execution::Call in CompileFunctionInContext."

This reverts commit ce8f5141.

Reason for revert: Changes a layout test:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/20693

Original change's description:
> Skip Execution::Call in CompileFunctionInContext.
> 
> We execute the top-level function only to get to the wrapped function.
> We could do the same by simply instantiating it.
> 
> Other approaches would change the parser so that the top-level function
> is the wrapped function. However, that change violates existing scoping
> invariants and fixing it would add a lot more complexity to the parser.
> 
> R=​adamk@chromium.org, marja@chromium.org
> 
> Bug: v8:7172
> Change-Id: I7272b8b58fc739d47a44da3a9d4a914af3e8cf3d
> Reviewed-on: https://chromium-review.googlesource.com/836367
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50333}

TBR=adamk@chromium.org,marja@chromium.org,yangguo@chromium.org

Change-Id: I922fdd2410512d837705263e092a09e041b9d28f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7172
Reviewed-on: https://chromium-review.googlesource.com/849215Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50345}
parent 5a8e1f3f
......@@ -1206,24 +1206,24 @@ MaybeHandle<JSFunction> Compiler::GetWrappedFunction(
ASSIGN_RETURN_ON_EXCEPTION(isolate, top_level,
CompileToplevel(&parse_info, isolate), JSFunction);
Handle<SharedFunctionInfo> wrapped;
SharedFunctionInfo::ScriptIterator infos(script);
while (SharedFunctionInfo* info = infos.Next()) {
if (info->is_wrapped()) {
wrapped = Handle<SharedFunctionInfo>(info);
break;
}
}
DCHECK(!wrapped.is_null());
Handle<JSFunction> function =
isolate->factory()->NewFunctionFromSharedFunctionInfo(wrapped, context,
Handle<JSFunction> top_level_fun =
isolate->factory()->NewFunctionFromSharedFunctionInfo(top_level, context,
NOT_TENURED);
// TODO(yangguo): consider not having to call the top-level function, and
// instead instantiate the wrapper function directly.
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(
isolate, result,
Execution::Call(isolate, top_level_fun, isolate->global_proxy(), 0,
nullptr),
JSFunction);
// OnAfterCompile has to be called after we create the JSFunction, which we
// may require to recompile the eval for debugging, if we find a function
// that contains break points in the eval script.
isolate->debug()->OnAfterCompile(script);
return function;
return Handle<JSFunction>::cast(result);
}
namespace {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment