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

Unified Diff: src/scopes.cc

Issue 669270: Remove unneeded variable usage analysis. (Closed)
Patch Set: Created 10 years, 9 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/usage-analyzer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index 701e5e3eddbdf3995515f0465076d9e93822496b..b55e5d5d7bd38744ad07ffcc9d679d9f96b5e481 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -309,7 +309,7 @@ void Scope::CollectUsedVariables(List<Variable*, Allocator>* locals) {
// which is the current user of this function).
for (int i = 0; i < temps_.length(); i++) {
Variable* var = temps_[i];
- if (var->var_uses()->is_used()) {
+ if (var->is_used()) {
locals->Add(var);
}
}
@@ -317,7 +317,7 @@ void Scope::CollectUsedVariables(List<Variable*, Allocator>* locals) {
p != NULL;
p = variables_.Next(p)) {
Variable* var = reinterpret_cast<Variable*>(p->value);
- if (var->var_uses()->is_used()) {
+ if (var->is_used()) {
locals->Add(var);
}
}
@@ -418,17 +418,16 @@ static void PrintName(Handle<String> name) {
static void PrintVar(PrettyPrinter* printer, int indent, Variable* var) {
- if (var->var_uses()->is_used() || var->rewrite() != NULL) {
+ if (var->is_used() || var->rewrite() != NULL) {
Indent(indent, Variable::Mode2String(var->mode()));
PrintF(" ");
PrintName(var->name());
PrintF("; // ");
- if (var->rewrite() != NULL) PrintF("%s, ", printer->Print(var->rewrite()));
- if (var->is_accessed_from_inner_scope()) PrintF("inner scope access, ");
- PrintF("var ");
- var->var_uses()->Print();
- PrintF(", obj ");
- var->obj_uses()->Print();
+ if (var->rewrite() != NULL) {
+ PrintF("%s, ", printer->Print(var->rewrite()));
+ if (var->is_accessed_from_inner_scope()) PrintF(", ");
+ }
+ if (var->is_accessed_from_inner_scope()) PrintF("inner scope access");
PrintF("\n");
}
}
@@ -738,10 +737,10 @@ bool Scope::MustAllocate(Variable* var) {
(var->is_accessed_from_inner_scope_ ||
scope_calls_eval_ || inner_scope_calls_eval_ ||
scope_contains_with_)) {
- var->var_uses()->RecordAccess(1);
+ var->set_is_used(true);
}
// Global variables do not need to be allocated.
- return !var->is_global() && var->var_uses()->is_used();
+ return !var->is_global() && var->is_used();
}
@@ -847,7 +846,7 @@ void Scope::AllocateParameterLocals() {
new Literal(Handle<Object>(Smi::FromInt(i))),
RelocInfo::kNoPosition,
Property::SYNTHETIC);
- arguments_shadow->var_uses()->RecordUses(var->var_uses());
+ if (var->is_used()) arguments_shadow->set_is_used(true);
}
}
« no previous file with comments | « src/scopeinfo.cc ('k') | src/usage-analyzer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698