Adapt pre-parser heuristics for lazy compilation.

R=ulan@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10540120

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11790 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4a385fa2
......@@ -4521,7 +4521,6 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> function_name,
// The heuristics are:
// - It must not have been prohibited by the caller to Parse (some callers
// need a full AST).
// - The outer scope must be trivial (only global variables in scope).
// - The function mustn't be a function expression with an open parenthesis
// before; we consider that a hint that the function will be called
// immediately, and it would be a waste of time to make it lazily
......@@ -4529,8 +4528,6 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> function_name,
// These are all things we can know at this point, without looking at the
// function itself.
bool is_lazily_compiled = (mode() == PARSE_LAZILY &&
top_scope_->outer_scope()->is_global_scope() &&
top_scope_->HasTrivialOuterContext() &&
!parenthesized_function_);
parenthesized_function_ = false; // The bit was set for this function only.
......
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