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

Unified Diff: src/scopes.h

Issue 1218783005: Support for global var shortcuts in script contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixing builds Created 5 years, 5 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/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
diff --git a/src/scopes.h b/src/scopes.h
index 1b43f8e393399e152cb389fb737c56f74f150560..40863800e492da1c8983ed4015e0cc3b2339b0a1 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -442,6 +442,7 @@ class Scope: public ZoneObject {
// handled separately.
void CollectStackAndContextLocals(
ZoneList<Variable*>* stack_locals, ZoneList<Variable*>* context_locals,
+ ZoneList<Variable*>* context_globals,
ZoneList<Variable*>* strong_mode_free_variables = nullptr);
// Current number of var or const locals.
@@ -450,9 +451,11 @@ class Scope: public ZoneObject {
// Result of variable allocation.
int num_stack_slots() const { return num_stack_slots_; }
int num_heap_slots() const { return num_heap_slots_; }
+ int num_global_slots() const { return num_global_slots_; }
int StackLocalCount() const;
int ContextLocalCount() const;
+ int ContextGlobalCount() const;
// For script scopes, the number of module literals (including nested ones).
int num_modules() const { return num_modules_; }
@@ -617,6 +620,7 @@ class Scope: public ZoneObject {
// Computed via AllocateVariables; function, block and catch scopes only.
int num_stack_slots_;
int num_heap_slots_;
+ int num_global_slots_;
// The number of modules (including nested ones).
int num_modules_;
@@ -713,7 +717,8 @@ class Scope: public ZoneObject {
void AllocateHeapSlot(Variable* var);
void AllocateParameterLocals(Isolate* isolate);
void AllocateNonParameterLocal(Isolate* isolate, Variable* var);
- void AllocateNonParameterLocals(Isolate* isolate);
+ void AllocateDeclaredGlobal(Isolate* isolate, Variable* var);
+ void AllocateNonParameterLocalsAndDeclaredGlobals(Isolate* isolate);
void AllocateVariablesRecursively(Isolate* isolate);
void AllocateParameter(Variable* var, int index);
void AllocateReceiver();
« no previous file with comments | « src/scopeinfo.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698