| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/opt_code_generator.h" | 8 #include "vm/opt_code_generator.h" |
| 9 | 9 |
| 10 #include "vm/assembler_macros.h" | 10 #include "vm/assembler_macros.h" |
| (...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1438 return true; | 1438 return true; |
| 1439 } | 1439 } |
| 1440 | 1440 |
| 1441 | 1441 |
| 1442 void OptimizingCodeGenerator::VisitIncrOpInstanceFieldNode( | 1442 void OptimizingCodeGenerator::VisitIncrOpInstanceFieldNode( |
| 1443 IncrOpInstanceFieldNode* node) { | 1443 IncrOpInstanceFieldNode* node) { |
| 1444 ASSERT((node->kind() == Token::kINCR) || (node->kind() == Token::kDECR)); | 1444 ASSERT((node->kind() == Token::kINCR) || (node->kind() == Token::kDECR)); |
| 1445 VisitLoadOne(node->receiver(), EBX); | 1445 VisitLoadOne(node->receiver(), EBX); |
| 1446 __ pushl(EBX); // Duplicate receiver (preserve for setter). | 1446 __ pushl(EBX); // Duplicate receiver (preserve for setter). |
| 1447 const ICData& ic_data = node->ICDataAtId(node->id()); | 1447 const ICData& ic_data = node->ICDataAtId(node->id()); |
| 1448 if (ic_data.NumberOfChecks() == 0) { | 1448 // Deoptimize if either this node has never been visited before or |
| 1449 // if the classes collected at getter and setter do not match (can happen |
| 1450 // if the increment is 'interrupted' by an exception). |
| 1451 if ((ic_data.NumberOfChecks() == 0) || |
| 1452 !HaveSameClassesInICData(node->ICDataAtId(node->getter_id()), |
| 1453 node->ICDataAtId(node->setter_id()))) { |
| 1449 // Deoptimization point for this node is after receiver has been | 1454 // Deoptimization point for this node is after receiver has been |
| 1450 // pushed twice on stack and before the getter (above) was executed. | 1455 // pushed twice on stack and before the getter (above) was executed. |
| 1451 DeoptimizationBlob* deopt_blob = | 1456 DeoptimizationBlob* deopt_blob = |
| 1452 AddDeoptimizationBlob(node, EBX, kDeoptIncrInstance); | 1457 AddDeoptimizationBlob(node, EBX, kDeoptIncrInstance); |
| 1453 __ jmp(deopt_blob->label()); | 1458 __ jmp(deopt_blob->label()); |
| 1454 return; | 1459 return; |
| 1455 } | 1460 } |
| 1456 InlineInstanceGetter(node, | 1461 InlineInstanceGetter(node, |
| 1457 node->getter_id(), | 1462 node->getter_id(), |
| 1458 node->receiver(), | 1463 node->receiver(), |
| (...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3067 } | 3072 } |
| 3068 } | 3073 } |
| 3069 // TODO(srdjan): Implement unary kSUB (negate) Mint. | 3074 // TODO(srdjan): Implement unary kSUB (negate) Mint. |
| 3070 CodeGenerator::VisitUnaryOpNode(node); | 3075 CodeGenerator::VisitUnaryOpNode(node); |
| 3071 } | 3076 } |
| 3072 | 3077 |
| 3073 | 3078 |
| 3074 } // namespace dart | 3079 } // namespace dart |
| 3075 | 3080 |
| 3076 #endif // defined TARGET_ARCH_IA32 | 3081 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |