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

Unified Diff: src/data-flow.cc

Issue 903003: Fix bug in assigned variables analysis.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 | « no previous file | test/mjsunit/regress/regress-643.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/data-flow.cc
===================================================================
--- src/data-flow.cc (revision 4112)
+++ src/data-flow.cc (working copy)
@@ -1360,17 +1360,21 @@
void AssignedVariablesAnalyzer::VisitAssignment(Assignment* expr) {
ASSERT(av_.IsEmpty());
- Visit(expr->target());
+ if (expr->target()->AsProperty() != NULL) {
+ // Visit receiver and key of property store and rhs.
+ Visit(expr->target()->AsProperty()->obj());
+ ProcessExpression(expr->target()->AsProperty()->key());
+ ProcessExpression(expr->value());
- ProcessExpression(expr->value());
+ // If we have a variable as a receiver in a property store, check if
+ // we can mark it as trivial.
+ MarkIfTrivial(expr->target()->AsProperty()->obj());
+ } else {
+ Visit(expr->target());
+ ProcessExpression(expr->value());
- Variable* var = expr->target()->AsVariableProxy()->AsVariable();
- if (var != NULL) RecordAssignedVar(var);
-
- // If we have a variable as a receiver in a property store, check if
- // we can mark it as trivial.
- if (expr->target()->AsProperty() != NULL) {
- MarkIfTrivial(expr->target()->AsProperty()->obj());
+ Variable* var = expr->target()->AsVariableProxy()->AsVariable();
+ if (var != NULL) RecordAssignedVar(var);
}
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-643.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698