Merge V8 at branches/3.2 r8200: Initial merge by Git
Change-Id: I5c434306e98132997e9c5f6024b6ce200b255edf
diff --git a/src/scopes.h b/src/scopes.h
index 18db0cd..a0e56a4 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -95,6 +95,11 @@
GLOBAL_SCOPE // the top-level scope for a program or a top-level eval
};
+ enum LocalType {
+ PARAMETER,
+ VAR_OR_CONST
+ };
+
Scope(Scope* outer_scope, Type type);
virtual ~Scope() { }
@@ -134,7 +139,9 @@
// Declare a local variable in this scope. If the variable has been
// declared before, the previously declared variable is returned.
- virtual Variable* DeclareLocal(Handle<String> name, Variable::Mode mode);
+ virtual Variable* DeclareLocal(Handle<String> name,
+ Variable::Mode mode,
+ LocalType type);
// Declare an implicit global variable in this scope which must be a
// global scope. The variable was introduced (possibly from an inner
@@ -282,6 +289,9 @@
// cases the context parameter is an empty handle.
void AllocateVariables(Handle<Context> context);
+ // Current number of var or const locals.
+ int num_var_or_const() { return num_var_or_const_; }
+
// Result of variable allocation.
int num_stack_slots() const { return num_stack_slots_; }
int num_heap_slots() const { return num_heap_slots_; }
@@ -373,6 +383,9 @@
bool outer_scope_is_eval_scope_;
bool force_eager_compilation_;
+ // Computed as variables are declared.
+ int num_var_or_const_;
+
// Computed via AllocateVariables; function scopes only.
int num_stack_slots_;
int num_heap_slots_;