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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index b04179de7da4a494fa7b8627eefeb348141ce156..d57c3b4a1cdd381a7d0c8757fc5d8a5bab32d879 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1306,6 +1306,16 @@ static Condition NegateCondition(Condition condition) {
}
+void ControlInstruction::EmitBranchOnValue(FlowGraphCompiler* compiler,
+ bool value) {
+ if (value && compiler->IsNextBlock(false_successor())) {
+ __ jmp(compiler->GetBlockLabel(true_successor()));
+ } else if (!value && compiler->IsNextBlock(true_successor())) {
+ __ jmp(compiler->GetBlockLabel(false_successor()));
+ }
+}
+
+
void ControlInstruction::EmitBranchOnCondition(FlowGraphCompiler* compiler,
Condition true_condition) {
if (compiler->IsNextBlock(false_successor())) {

Powered by Google App Engine
This is Rietveld 408576698