diff options
| author | Ben Murdoch <benm@google.com> | 2012-05-24 09:23:34 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2012-05-24 09:23:34 -0700 |
| commit | 6331c683f5e6a2a3400ccbdafc79920e0f44593b (patch) | |
| tree | befbd35746223bac3b9ffc4429fb936f97966f57 /src/scopes.cc | |
| parent | 21eaa3b0abc4562dac0be1acebe2fdf35335e752 (diff) | |
| parent | 4768e9d22b13edbae2ae177109420028748bf872 (diff) | |
| download | android_external_v8-6331c683f5e6a2a3400ccbdafc79920e0f44593b.tar.gz android_external_v8-6331c683f5e6a2a3400ccbdafc79920e0f44593b.tar.bz2 android_external_v8-6331c683f5e6a2a3400ccbdafc79920e0f44593b.zip | |
am 4768e9d2: Merge V8 at 3.9.24.29
* commit '4768e9d22b13edbae2ae177109420028748bf872':
Merge V8 at 3.9.24.29
Diffstat (limited to 'src/scopes.cc')
| -rw-r--r-- | src/scopes.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/scopes.cc b/src/scopes.cc index 859cbd1a..c142c3d6 100644 --- a/src/scopes.cc +++ b/src/scopes.cc @@ -649,6 +649,26 @@ bool Scope::HasTrivialOuterContext() const { } +bool Scope::AllowsLazyRecompilation() const { + return !force_eager_compilation_ && + !TrivialDeclarationScopesBeforeWithScope(); +} + + +bool Scope::TrivialDeclarationScopesBeforeWithScope() const { + Scope* outer = outer_scope_; + if (outer == NULL) return false; + outer = outer->DeclarationScope(); + while (outer != NULL) { + if (outer->is_with_scope()) return true; + if (outer->is_declaration_scope() && outer->num_heap_slots() > 0) + return false; + outer = outer->outer_scope_; + } + return false; +} + + int Scope::ContextChainLength(Scope* scope) { int n = 0; for (Scope* s = this; s != scope; s = s->outer_scope_) { |
