Commit 9d36cd41 authored by yangguo's avatar yangguo Committed by Commit bot

Remove outdated ban on lazy compilation due to scope chain.

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/1214303002

Cr-Commit-Position: refs/heads/master@{#29373}
parent a7697bdc
......@@ -711,25 +711,6 @@ bool Scope::HasTrivialOuterContext() const {
}
bool Scope::HasLazyCompilableOuterContext() const {
Scope* outer = outer_scope_;
if (outer == NULL) return true;
// We have to prevent lazy compilation if this scope is inside a with scope
// and all declaration scopes between them have empty contexts. Such
// declaration scopes may become invisible during scope info deserialization.
outer = outer->DeclarationScope();
bool found_non_trivial_declarations = false;
for (const Scope* scope = outer; scope != NULL; scope = scope->outer_scope_) {
if (scope->is_with_scope() && !found_non_trivial_declarations) return false;
if (scope->is_block_scope() && !scope->decls_.is_empty()) return false;
if (scope->is_declaration_scope() && scope->num_heap_slots() > 0) {
found_non_trivial_declarations = true;
}
}
return true;
}
bool Scope::AllowsLazyParsing() const {
// If we are inside a block scope, we must parse eagerly to find out how
// to allocate variables on the block scope. At this point, declarations may
......@@ -741,9 +722,7 @@ bool Scope::AllowsLazyParsing() const {
}
bool Scope::AllowsLazyCompilation() const {
return !force_eager_compilation_ && HasLazyCompilableOuterContext();
}
bool Scope::AllowsLazyCompilation() const { return !force_eager_compilation_; }
bool Scope::AllowsLazyCompilationWithoutContext() const {
......
......@@ -482,9 +482,6 @@ class Scope: public ZoneObject {
// True if the outer context of this scope is always the native context.
bool HasTrivialOuterContext() const;
// True if the outer context allows lazy compilation of this scope.
bool HasLazyCompilableOuterContext() const;
// The number of contexts between this and scope; zero if this == scope.
int ContextChainLength(Scope* scope);
......
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