Commit 328d6037 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[wasm] Allow validator to inspect entire module.

This changes the parser to keep around bodies for asm.js functions when
then asm.js validator is turned on. Eventually the validator will work
on one function at a time, but for now we validate the entire module at
once.

R=rossberg@chromium.org

Review-Url: https://codereview.chromium.org/1981333003
Cr-Commit-Position: refs/heads/master@{#36291}
parent e9aad72f
......@@ -4280,10 +4280,13 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// FunctionExpression; even without enclosing parentheses it might be
// immediately invoked.
// - The function literal shouldn't be hinted to eagerly compile.
// - For asm.js functions the body needs to be available when module
// validation is active, because we examine the entire module at once.
bool use_temp_zone =
FLAG_lazy && !allow_natives() && extension_ == NULL && allow_lazy() &&
function_type == FunctionLiteral::kDeclaration &&
eager_compile_hint != FunctionLiteral::kShouldEagerCompile;
eager_compile_hint != FunctionLiteral::kShouldEagerCompile &&
!(FLAG_validate_asm && scope->asm_function());
// Open a new BodyScope, which sets our AstNodeFactory to allocate in the
// new temporary zone if the preconditions are satisfied, and ensures that
// the previous zone is always restored after parsing the body.
......
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