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

Unified Diff: src/data-flow.cc

Issue 722001: Add IsStackAllocated helper for variables. (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/ast.h ('k') | src/rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/data-flow.cc
diff --git a/src/data-flow.cc b/src/data-flow.cc
index 1a0cf1a18765cf4843b14b21be4ef2225e53caa3..6b45da02b93040d7e64d616f86f285be7b8c7d00 100644
--- a/src/data-flow.cc
+++ b/src/data-flow.cc
@@ -433,11 +433,7 @@ void FlowGraphBuilder::VisitAssignment(Assignment* expr) {
ASSERT(var == NULL || prop == NULL);
if (var != NULL) {
Visit(expr->value());
- Slot* slot = var->slot();
- if (slot != NULL &&
- (slot->type() == Slot::LOCAL || slot->type() == Slot::PARAMETER)) {
- definitions_.Add(expr);
- }
+ if (var->IsStackAllocated()) definitions_.Add(expr);
} else if (prop != NULL) {
Visit(prop->obj());
@@ -499,12 +495,8 @@ void FlowGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) {
void FlowGraphBuilder::VisitCountOperation(CountOperation* expr) {
Visit(expr->expression());
Variable* var = expr->expression()->AsVariableProxy()->AsVariable();
- if (var != NULL) {
- Slot* slot = var->slot();
- if (slot != NULL &&
- (slot->type() == Slot::LOCAL || slot->type() == Slot::PARAMETER)) {
- definitions_.Add(expr);
- }
+ if (var != NULL && var->IsStackAllocated()) {
+ definitions_.Add(expr);
}
graph_.AppendInstruction(expr);
}
« no previous file with comments | « src/ast.h ('k') | src/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698