Commit fa987b4b authored by rossberg's avatar rossberg Committed by Commit bot

Remove remnants of INTERNAL variable handling from Scope

R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1256793005

Cr-Commit-Position: refs/heads/master@{#29851}
parent 3eb91e8a
...@@ -74,7 +74,6 @@ Scope::Scope(Zone* zone, Scope* outer_scope, ScopeType scope_type, ...@@ -74,7 +74,6 @@ Scope::Scope(Zone* zone, Scope* outer_scope, ScopeType scope_type,
AstValueFactory* ast_value_factory, FunctionKind function_kind) AstValueFactory* ast_value_factory, FunctionKind function_kind)
: inner_scopes_(4, zone), : inner_scopes_(4, zone),
variables_(zone), variables_(zone),
internals_(4, zone),
temps_(4, zone), temps_(4, zone),
params_(4, zone), params_(4, zone),
unresolved_(16, zone), unresolved_(16, zone),
...@@ -97,7 +96,6 @@ Scope::Scope(Zone* zone, Scope* inner_scope, ScopeType scope_type, ...@@ -97,7 +96,6 @@ Scope::Scope(Zone* zone, Scope* inner_scope, ScopeType scope_type,
Handle<ScopeInfo> scope_info, AstValueFactory* value_factory) Handle<ScopeInfo> scope_info, AstValueFactory* value_factory)
: inner_scopes_(4, zone), : inner_scopes_(4, zone),
variables_(zone), variables_(zone),
internals_(4, zone),
temps_(4, zone), temps_(4, zone),
params_(4, zone), params_(4, zone),
unresolved_(16, zone), unresolved_(16, zone),
...@@ -123,7 +121,6 @@ Scope::Scope(Zone* zone, Scope* inner_scope, ...@@ -123,7 +121,6 @@ Scope::Scope(Zone* zone, Scope* inner_scope,
AstValueFactory* value_factory) AstValueFactory* value_factory)
: inner_scopes_(1, zone), : inner_scopes_(1, zone),
variables_(zone), variables_(zone),
internals_(0, zone),
temps_(0, zone), temps_(0, zone),
params_(0, zone), params_(0, zone),
unresolved_(0, zone), unresolved_(0, zone),
...@@ -344,7 +341,6 @@ void Scope::Initialize() { ...@@ -344,7 +341,6 @@ void Scope::Initialize() {
Scope* Scope::FinalizeBlockScope() { Scope* Scope::FinalizeBlockScope() {
DCHECK(is_block_scope()); DCHECK(is_block_scope());
DCHECK(internals_.is_empty());
DCHECK(temps_.is_empty()); DCHECK(temps_.is_empty());
DCHECK(params_.is_empty()); DCHECK(params_.is_empty());
...@@ -496,8 +492,8 @@ Variable* Scope::DeclareLocal(const AstRawString* name, VariableMode mode, ...@@ -496,8 +492,8 @@ Variable* Scope::DeclareLocal(const AstRawString* name, VariableMode mode,
int declaration_group_start) { int declaration_group_start) {
DCHECK(!already_resolved()); DCHECK(!already_resolved());
// This function handles VAR, LET, and CONST modes. DYNAMIC variables are // This function handles VAR, LET, and CONST modes. DYNAMIC variables are
// introduces during variable allocation, INTERNAL variables are allocated // introduces during variable allocation, and TEMPORARY variables are
// explicitly, and TEMPORARY variables are allocated via NewTemporary(). // allocated via NewTemporary().
DCHECK(IsDeclaredVariableMode(mode)); DCHECK(IsDeclaredVariableMode(mode));
++num_var_or_const_; ++num_var_or_const_;
return variables_.Declare(this, name, mode, kind, init_flag, return variables_.Declare(this, name, mode, kind, init_flag,
...@@ -616,15 +612,6 @@ void Scope::CollectStackAndContextLocals( ...@@ -616,15 +612,6 @@ void Scope::CollectStackAndContextLocals(
DCHECK(context_locals != NULL); DCHECK(context_locals != NULL);
DCHECK(context_globals != NULL); DCHECK(context_globals != NULL);
// Collect internals which are always allocated on the heap.
for (int i = 0; i < internals_.length(); i++) {
Variable* var = internals_[i];
if (var->is_used()) {
DCHECK(var->IsContextSlot());
context_locals->Add(var, zone());
}
}
// Collect temporaries which are always allocated on the stack, unless the // Collect temporaries which are always allocated on the stack, unless the
// context as a whole has forced context allocation. // context as a whole has forced context allocation.
for (int i = 0; i < temps_.length(); i++) { for (int i = 0; i < temps_.length(); i++) {
...@@ -980,13 +967,6 @@ void Scope::Print(int n) { ...@@ -980,13 +967,6 @@ void Scope::Print(int n) {
} }
} }
if (internals_.length() > 0) {
Indent(n1, "// internal vars:\n");
for (int i = 0; i < internals_.length(); i++) {
PrintVar(n1, internals_[i]);
}
}
if (variables_.Start() != NULL) { if (variables_.Start() != NULL) {
Indent(n1, "// local vars:\n"); Indent(n1, "// local vars:\n");
PrintMap(n1, &variables_); PrintMap(n1, &variables_);
...@@ -1509,10 +1489,6 @@ void Scope::AllocateNonParameterLocalsAndDeclaredGlobals(Isolate* isolate) { ...@@ -1509,10 +1489,6 @@ void Scope::AllocateNonParameterLocalsAndDeclaredGlobals(Isolate* isolate) {
AllocateNonParameterLocal(isolate, temps_[i]); AllocateNonParameterLocal(isolate, temps_[i]);
} }
for (int i = 0; i < internals_.length(); i++) {
AllocateNonParameterLocal(isolate, internals_[i]);
}
ZoneList<VarAndOrder> vars(variables_.occupancy(), zone()); ZoneList<VarAndOrder> vars(variables_.occupancy(), zone());
for (VariableMap::Entry* p = variables_.Start(); for (VariableMap::Entry* p = variables_.Start();
p != NULL; p != NULL;
......
...@@ -555,8 +555,6 @@ class Scope: public ZoneObject { ...@@ -555,8 +555,6 @@ class Scope: public ZoneObject {
// variables may be implicitly 'declared' by being used (possibly in // variables may be implicitly 'declared' by being used (possibly in
// an inner scope) with no intervening with statements or eval calls. // an inner scope) with no intervening with statements or eval calls.
VariableMap variables_; VariableMap variables_;
// Compiler-allocated (user-invisible) internals.
ZoneList<Variable*> internals_;
// Compiler-allocated (user-invisible) temporaries. // Compiler-allocated (user-invisible) temporaries.
ZoneList<Variable*> temps_; ZoneList<Variable*> temps_;
// Parameter list in source order. // Parameter list in source order.
...@@ -631,7 +629,7 @@ class Scope: public ZoneObject { ...@@ -631,7 +629,7 @@ class Scope: public ZoneObject {
// The number of modules (including nested ones). // The number of modules (including nested ones).
int num_modules_; int num_modules_;
// For module scopes, the host scope's internal variable binding this module. // For module scopes, the host scope's temporary variable binding this module.
Variable* module_var_; Variable* module_var_;
// Rest parameter // Rest parameter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment