Chromium Code Reviews| Index: src/data-flow.cc |
| diff --git a/src/data-flow.cc b/src/data-flow.cc |
| index 96acb9959cfd0b58edbfa175dfaa498da9e398d6..1a0cf1a18765cf4843b14b21be4ef2225e53caa3 100644 |
| --- a/src/data-flow.cc |
| +++ b/src/data-flow.cc |
| @@ -431,11 +431,17 @@ void FlowGraphBuilder::VisitAssignment(Assignment* expr) { |
| // Left-hand side can be a variable or property (or reference error) but |
| // not both. |
| ASSERT(var == NULL || prop == NULL); |
| - if (prop != NULL) { |
| + if (var != NULL) { |
| + Visit(expr->value()); |
| + Slot* slot = var->slot(); |
| + if (slot != NULL && |
|
fschneider
2010/03/09 09:23:05
I'm also checking for stack locals and parameters
|
| + (slot->type() == Slot::LOCAL || slot->type() == Slot::PARAMETER)) { |
| + definitions_.Add(expr); |
| + } |
| + |
| + } else if (prop != NULL) { |
| Visit(prop->obj()); |
| if (!prop->key()->IsPropertyName()) Visit(prop->key()); |
| - } |
| - if (var != NULL || prop != NULL) { |
| Visit(expr->value()); |
| } |
| graph_.AppendInstruction(expr); |
| @@ -492,6 +498,14 @@ void FlowGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) { |
| void FlowGraphBuilder::VisitCountOperation(CountOperation* expr) { |
| Visit(expr->expression()); |
| + Variable* var = expr->expression()->AsVariableProxy()->AsVariable(); |
|
fschneider
2010/03/09 09:23:05
Sometimes we use
...->AsVariableProxy()->var()
|
| + if (var != NULL) { |
| + Slot* slot = var->slot(); |
| + if (slot != NULL && |
| + (slot->type() == Slot::LOCAL || slot->type() == Slot::PARAMETER)) { |
| + definitions_.Add(expr); |
| + } |
| + } |
| graph_.AppendInstruction(expr); |
| } |