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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 10536145: Fuse comparisons that are used by branches together. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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/flow_graph_compiler_ia32.cc
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index e87dfd03e0744a92a99646ace4f5939569c3687b..659a744ddb1b5e4435068d81f66ca5982496bcef 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -408,8 +408,7 @@ void FlowGraphCompiler::GenerateBoolToJump(Register bool_register,
Label fall_through;
__ cmpl(bool_register, raw_null);
__ j(EQUAL, &fall_through, Assembler::kNearJump);
- const Bool& bool_true = Bool::ZoneHandle(Bool::True());
- __ CompareObject(bool_register, bool_true);
+ __ CompareObject(bool_register, true_value());
__ j(EQUAL, is_true);
__ jmp(is_false);
__ Bind(&fall_through);
@@ -790,8 +789,6 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t cid,
const AbstractType& type,
bool negate_result) {
ASSERT(type.IsFinalized() && !type.IsMalformed());
- const Bool& bool_true = Bool::ZoneHandle(Bool::True());
- const Bool& bool_false = Bool::ZoneHandle(Bool::False());
const Immediate raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
@@ -836,21 +833,21 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t cid,
Label done;
if (negate_result) {
__ popl(EDX);
- __ LoadObject(EAX, bool_true);
+ __ LoadObject(EAX, true_value());
__ cmpl(EDX, EAX);
__ j(NOT_EQUAL, &done, Assembler::kNearJump);
- __ LoadObject(EAX, bool_false);
+ __ LoadObject(EAX, false_value());
} else {
__ popl(EAX);
}
__ jmp(&done, Assembler::kNearJump);
__ Bind(&is_not_instance);
- __ LoadObject(EAX, negate_result ? bool_true : bool_false);
+ __ LoadObject(EAX, negate_result ? true_value() : false_value());
__ jmp(&done, Assembler::kNearJump);
__ Bind(&is_instance);
- __ LoadObject(EAX, negate_result ? bool_false : bool_true);
+ __ LoadObject(EAX, negate_result ? false_value() : true_value());
__ Bind(&done);
__ popl(EDX); // Remove pushed instantiator type arguments.
__ popl(ECX); // Remove pushed instantiator.

Powered by Google App Engine
This is Rietveld 408576698