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

Unified Diff: src/scopes.h

Issue 5753005: Make closures optimizable by Crankshaft compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Next round Created 9 years, 11 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/runtime-profiler.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 d909b81fc1f420d41ca273e702522c70b015ad2c..09901ade615237a771a34653a9922d08206ce788 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -302,6 +302,14 @@ 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
@@ -355,6 +363,10 @@ class Scope: public ZoneObject {
int num_stack_slots_;
int num_heap_slots_;
+ // Serialized scopes support.
+ SerializedScopeInfo* scope_info_;
+ bool resolved() { return scope_info_ != NULL; }
+
// Create a non-local variable with a given name.
// These variables are looked up dynamically at runtime.
Variable* NonLocal(Handle<String> name, Variable::Mode mode);
@@ -386,6 +398,33 @@ class Scope: public ZoneObject {
void AllocateNonParameterLocal(Variable* var);
void AllocateNonParameterLocals();
void AllocateVariablesRecursively();
+
+ private:
+ Scope(Scope* inner_scope, SerializedScopeInfo* scope_info);
+
+ void SetDefaults(Type type,
+ Scope* outer_scope,
+ SerializedScopeInfo* scope_info) {
+ outer_scope_ = outer_scope;
+ type_ = type;
+ scope_name_ = Factory::empty_symbol();
+ dynamics_ = NULL;
+ receiver_ = NULL;
+ function_ = NULL;
+ arguments_ = NULL;
+ arguments_shadow_ = NULL;
+ illegal_redecl_ = NULL;
+ scope_inside_with_ = false;
+ scope_contains_with_ = false;
+ scope_calls_eval_ = false;
+ outer_scope_calls_eval_ = false;
+ inner_scope_calls_eval_ = false;
+ outer_scope_is_eval_scope_ = false;
+ force_eager_compilation_ = false;
+ num_stack_slots_ = 0;
+ num_heap_slots_ = 0;
+ scope_info_ = scope_info;
+ }
};
« no previous file with comments | « src/runtime-profiler.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698