Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: src/scopes.h

Issue 6646017: Rebuild scope chain from serialized scope info before parsing lazily. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 123c4d867f251d1c77e264eb79b34b9817b2afcd..10994df9c855cf503fd7e8bcb86580d41916ac47 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -104,6 +104,9 @@ class Scope: public ZoneObject {
// doesn't re-allocate variables repeatedly.
static bool Analyze(CompilationInfo* info);
+ static Scope* DeserializeScopeChain(CompilationInfo* info,
+ Scope* innermost_scope);
+
// The scope name is only used for printing/debugging.
void SetScopeName(Handle<String> scope_name) { scope_name_ = scope_name; }
@@ -318,14 +321,6 @@ class Scope: public ZoneObject {
explicit Scope(Type type);
- void InsertAfterScope(Scope* scope) {
- inner_scopes_.Add(scope);
- outer_scope_ = scope->outer_scope_;
- outer_scope_->inner_scopes_.RemoveElement(scope);
- outer_scope_->inner_scopes_.Add(this);
- scope->outer_scope_ = this;
- }
-
// Scope tree.
Scope* outer_scope_; // the immediately enclosing outer scope, or NULL
ZoneList<Scope*> inner_scopes_; // the immediately enclosed inner scopes
@@ -419,6 +414,13 @@ class Scope: public ZoneObject {
private:
Scope(Scope* inner_scope, SerializedScopeInfo* scope_info);
+ void AddInnerScope(Scope* inner_scope) {
+ if (inner_scope != NULL) {
+ inner_scopes_.Add(inner_scope);
+ inner_scope->outer_scope_ = this;
+ }
+ }
+
void SetDefaults(Type type,
Scope* outer_scope,
SerializedScopeInfo* scope_info) {
« no previous file with comments | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698