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

Side by Side Diff: runtime/vm/opt_code_generator_ia32.cc

Issue 10020058: Fix a crash when optimizing instance field increment: if the increment operation gets interrupted b… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/src/ExceptionInIncrement.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 naver been visited before or
regis 2012/04/11 22:13:04 naver -> never
srdjan 2012/04/11 22:16:37 Done.
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
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
OLDNEW
« no previous file with comments | « no previous file | tests/language/src/ExceptionInIncrement.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698