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

Unified Diff: src/scopes.h

Issue 28027: Speed up access to global variables from eval scopes. Traverse the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 10 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
« src/objects.cc ('K') | « src/scopeinfo.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
===================================================================
--- src/scopes.h (revision 1344)
+++ src/scopes.h (working copy)
@@ -170,6 +170,11 @@
bool calls_eval() const { return scope_calls_eval_; }
bool outer_scope_calls_eval() const { return outer_scope_calls_eval_; }
+ // Is this scope inside a with statement.
+ bool inside_with() const { return scope_inside_with_; }
+ // Does this scope contain a with statement.
+ bool contains_with() const { return scope_contains_with_; }
+
// The scope immediately surrounding this scope, or NULL.
Scope* outer_scope() const { return outer_scope_; }
@@ -216,10 +221,15 @@
template<class Allocator>
void CollectUsedVariables(List<Variable*, Allocator>* locals);
- // Resolve and fill in the allocation information for all variables in
- // this scopes. Must be called *after* all scopes have been processed
- // (parsed) to ensure that unresolved variables can be resolved properly.
- void AllocateVariables();
+ // Resolve and fill in the allocation information for all variables
+ // in this scopes. Must be called *after* all scopes have been
+ // processed (parsed) to ensure that unresolved variables can be
+ // resolved properly.
+ //
+ // In the case of code compiled and run using 'eval', the context
+ // parameter is the context in which eval was called. In all other
+ // cases the context parameter is an empty handle.
+ void AllocateVariables(Handle<Context> context);
// Result of variable allocation.
int num_stack_slots() const { return num_stack_slots_; }
@@ -308,8 +318,11 @@
Variable* LookupRecursive(Handle<String> name,
bool inner_lookup,
Variable** invalidated_local);
- void ResolveVariable(Scope* global_scope, VariableProxy* proxy);
- void ResolveVariablesRecursively(Scope* global_scope);
+ void ResolveVariable(Scope* global_scope,
+ Handle<Context> context,
+ VariableProxy* proxy);
+ void ResolveVariablesRecursively(Scope* global_scope,
+ Handle<Context> context);
// Scope analysis.
bool PropagateScopeInfo(bool outer_scope_calls_eval,
« src/objects.cc ('K') | « src/scopeinfo.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698