Reviewers: ulan,
Description:
Remove outdated ban on lazy compilation due to scope chain.
[email protected]
Please review this at https://codereview.chromium.org/1214303002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+1, -25 lines):
M src/scopes.h
M src/scopes.cc
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index
e0922b423b5600cdc5927b69fb011079a2e86741..5f7ed84beecca11f7e5f3715c93b5aa4f58a903e
100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -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 {
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index
ba45cc47ad6825564b14652ecdb65ec91fddbdcb..fac8a5622d440d1a4a6db537839d297089d77091
100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -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);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.