OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 CatchExtensionObject* expr) { | 1353 CatchExtensionObject* expr) { |
1354 ASSERT(av_.IsEmpty()); | 1354 ASSERT(av_.IsEmpty()); |
1355 Visit(expr->key()); | 1355 Visit(expr->key()); |
1356 ProcessExpression(expr->value()); | 1356 ProcessExpression(expr->value()); |
1357 } | 1357 } |
1358 | 1358 |
1359 | 1359 |
1360 void AssignedVariablesAnalyzer::VisitAssignment(Assignment* expr) { | 1360 void AssignedVariablesAnalyzer::VisitAssignment(Assignment* expr) { |
1361 ASSERT(av_.IsEmpty()); | 1361 ASSERT(av_.IsEmpty()); |
1362 | 1362 |
1363 Visit(expr->target()); | 1363 if (expr->target()->AsProperty() != NULL) { |
| 1364 // Visit receiver and key of property store and rhs. |
| 1365 Visit(expr->target()->AsProperty()->obj()); |
| 1366 ProcessExpression(expr->target()->AsProperty()->key()); |
| 1367 ProcessExpression(expr->value()); |
1364 | 1368 |
1365 ProcessExpression(expr->value()); | 1369 // If we have a variable as a receiver in a property store, check if |
| 1370 // we can mark it as trivial. |
| 1371 MarkIfTrivial(expr->target()->AsProperty()->obj()); |
| 1372 } else { |
| 1373 Visit(expr->target()); |
| 1374 ProcessExpression(expr->value()); |
1366 | 1375 |
1367 Variable* var = expr->target()->AsVariableProxy()->AsVariable(); | 1376 Variable* var = expr->target()->AsVariableProxy()->AsVariable(); |
1368 if (var != NULL) RecordAssignedVar(var); | 1377 if (var != NULL) RecordAssignedVar(var); |
1369 | |
1370 // If we have a variable as a receiver in a property store, check if | |
1371 // we can mark it as trivial. | |
1372 if (expr->target()->AsProperty() != NULL) { | |
1373 MarkIfTrivial(expr->target()->AsProperty()->obj()); | |
1374 } | 1378 } |
1375 } | 1379 } |
1376 | 1380 |
1377 | 1381 |
1378 void AssignedVariablesAnalyzer::VisitThrow(Throw* expr) { | 1382 void AssignedVariablesAnalyzer::VisitThrow(Throw* expr) { |
1379 ASSERT(av_.IsEmpty()); | 1383 ASSERT(av_.IsEmpty()); |
1380 Visit(expr->exception()); | 1384 Visit(expr->exception()); |
1381 } | 1385 } |
1382 | 1386 |
1383 | 1387 |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1974 | 1978 |
1975 // Step 2: Compute KILL and GEN for each block node, initialize RD. | 1979 // Step 2: Compute KILL and GEN for each block node, initialize RD. |
1976 for (int i = block_count - 1; i >= 0; i--) { | 1980 for (int i = block_count - 1; i >= 0; i--) { |
1977 postorder_->at(i)->InitializeReachingDefinitions(definition_count, | 1981 postorder_->at(i)->InitializeReachingDefinitions(definition_count, |
1978 &variables_); | 1982 &variables_); |
1979 } | 1983 } |
1980 } | 1984 } |
1981 | 1985 |
1982 | 1986 |
1983 } } // namespace v8::internal | 1987 } } // namespace v8::internal |
OLD | NEW |