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

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

Issue 10918097: Allow smi comparisons to have constant operands. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 case ABOVE: return BELOW_EQUAL; 1299 case ABOVE: return BELOW_EQUAL;
1300 case ABOVE_EQUAL: return BELOW; 1300 case ABOVE_EQUAL: return BELOW;
1301 default: 1301 default:
1302 OS::Print("Error %d\n", condition); 1302 OS::Print("Error %d\n", condition);
1303 UNIMPLEMENTED(); 1303 UNIMPLEMENTED();
1304 return EQUAL; 1304 return EQUAL;
1305 } 1305 }
1306 } 1306 }
1307 1307
1308 1308
1309 void ControlInstruction::EmitBranchOnValue(FlowGraphCompiler* compiler,
1310 bool value) {
1311 if (value && compiler->IsNextBlock(false_successor())) {
1312 __ jmp(compiler->GetBlockLabel(true_successor()));
1313 } else if (!value && compiler->IsNextBlock(true_successor())) {
1314 __ jmp(compiler->GetBlockLabel(false_successor()));
1315 }
1316 }
1317
1318
1309 void ControlInstruction::EmitBranchOnCondition(FlowGraphCompiler* compiler, 1319 void ControlInstruction::EmitBranchOnCondition(FlowGraphCompiler* compiler,
1310 Condition true_condition) { 1320 Condition true_condition) {
1311 if (compiler->IsNextBlock(false_successor())) { 1321 if (compiler->IsNextBlock(false_successor())) {
1312 // If the next block is the false successor we will fall through to it. 1322 // If the next block is the false successor we will fall through to it.
1313 __ j(true_condition, compiler->GetBlockLabel(true_successor())); 1323 __ j(true_condition, compiler->GetBlockLabel(true_successor()));
1314 } else { 1324 } else {
1315 // If the next block is the true successor we negate comparison and fall 1325 // If the next block is the true successor we negate comparison and fall
1316 // through to it. 1326 // through to it.
1317 ASSERT(compiler->IsNextBlock(true_successor())); 1327 ASSERT(compiler->IsNextBlock(true_successor()));
1318 Condition false_condition = NegateCondition(true_condition); 1328 Condition false_condition = NegateCondition(true_condition);
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 value->set_use_index(i); 1607 value->set_use_index(i);
1598 value->AddToEnvUseList(); 1608 value->AddToEnvUseList();
1599 } 1609 }
1600 instr->set_env(copy); 1610 instr->set_env(copy);
1601 } 1611 }
1602 1612
1603 1613
1604 #undef __ 1614 #undef __
1605 1615
1606 } // namespace dart 1616 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698