Reviewers: Michael Starzinger,
Description:
Remove remnants of INTERNAL variable handling from Scope
[email protected]
BUG=
Please review this at https://codereview.chromium.org/1256793005/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+3, -29 lines):
M src/scopes.h
M src/scopes.cc
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index
4aca42042233652d3ad0b597804793652e8b106d..64c97b0de3d218f11cf1ea8d2abc9183e7e60aa6
100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -74,7 +74,6 @@ Scope::Scope(Zone* zone, Scope* outer_scope, ScopeType
scope_type,
AstValueFactory* ast_value_factory, FunctionKind
function_kind)
: inner_scopes_(4, zone),
variables_(zone),
- internals_(4, zone),
temps_(4, zone),
params_(4, zone),
unresolved_(16, zone),
@@ -97,7 +96,6 @@ Scope::Scope(Zone* zone, Scope* inner_scope, ScopeType
scope_type,
Handle<ScopeInfo> scope_info, AstValueFactory* value_factory)
: inner_scopes_(4, zone),
variables_(zone),
- internals_(4, zone),
temps_(4, zone),
params_(4, zone),
unresolved_(16, zone),
@@ -123,7 +121,6 @@ Scope::Scope(Zone* zone, Scope* inner_scope,
AstValueFactory* value_factory)
: inner_scopes_(1, zone),
variables_(zone),
- internals_(0, zone),
temps_(0, zone),
params_(0, zone),
unresolved_(0, zone),
@@ -344,7 +341,6 @@ void Scope::Initialize() {
Scope* Scope::FinalizeBlockScope() {
DCHECK(is_block_scope());
- DCHECK(internals_.is_empty());
DCHECK(temps_.is_empty());
DCHECK(params_.is_empty());
@@ -496,8 +492,8 @@ Variable* Scope::DeclareLocal(const AstRawString* name,
VariableMode mode,
int declaration_group_start) {
DCHECK(!already_resolved());
// This function handles VAR, LET, and CONST modes. DYNAMIC variables
are
- // introduces during variable allocation, INTERNAL variables are
allocated
- // explicitly, and TEMPORARY variables are allocated via NewTemporary().
+ // introduces during variable allocation, and TEMPORARY variables are
+ // allocated via NewTemporary().
DCHECK(IsDeclaredVariableMode(mode));
++num_var_or_const_;
return variables_.Declare(this, name, mode, kind, init_flag,
@@ -616,15 +612,6 @@ void Scope::CollectStackAndContextLocals(
DCHECK(context_locals != 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
// context as a whole has forced context allocation.
for (int i = 0; i < temps_.length(); i++) {
@@ -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) {
Indent(n1, "// local vars:\n");
PrintMap(n1, &variables_);
@@ -1509,10 +1489,6 @@ void
Scope::AllocateNonParameterLocalsAndDeclaredGlobals(Isolate* isolate) {
AllocateNonParameterLocal(isolate, temps_[i]);
}
- for (int i = 0; i < internals_.length(); i++) {
- AllocateNonParameterLocal(isolate, internals_[i]);
- }
-
ZoneList<VarAndOrder> vars(variables_.occupancy(), zone());
for (VariableMap::Entry* p = variables_.Start();
p != NULL;
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index
73277252e3ed1bb451f8507603256358ab03ac29..2e09e5e24c905d3e7e61372a6a38dd2628846d3e
100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -553,8 +553,6 @@ class Scope: public ZoneObject {
// variables may be implicitly 'declared' by being used (possibly in
// an inner scope) with no intervening with statements or eval calls.
VariableMap variables_;
- // Compiler-allocated (user-invisible) internals.
- ZoneList<Variable*> internals_;
// Compiler-allocated (user-invisible) temporaries.
ZoneList<Variable*> temps_;
// Parameter list in source order.
@@ -629,7 +627,7 @@ class Scope: public ZoneObject {
// The number of modules (including nested ones).
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_;
// Rest parameter
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.