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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 10836362: Clean up EmitSmiBinaryOp template to remove redundant moves. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index ae9fa90abdad6f58bab8cbbbe3558e1403e656cd..98e7bdf93810902687fabf61cbc7f0c09657a1b3 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -1515,19 +1515,11 @@ static void EmitSmiBinaryOp(FlowGraphCompiler* compiler, BinaryOpComp* comp) {
comp->instance_call()->try_index(),
kDeoptSmiBinaryOp);
}
- if (left_is_smi && right_is_smi) {
- if (can_deopt) {
- // Preserve left for deopt.
- __ movq(temp, left);
- }
- } else {
- // TODO(vegorov): for many binary operations this pattern can be rearranged
- // to save one move.
+ if (!left_is_smi || !right_is_smi) {
__ movq(temp, left);
- __ orq(left, right);
- __ testq(left, Immediate(kSmiTagMask));
+ __ orq(temp, right);
+ __ testq(temp, Immediate(kSmiTagMask));
__ j(NOT_ZERO, deopt);
- __ movq(left, temp);
}
switch (comp->op_kind()) {
case Token::kADD: {
@@ -1604,6 +1596,7 @@ static void EmitSmiBinaryOp(FlowGraphCompiler* compiler, BinaryOpComp* comp) {
case Token::kSHL: {
Label call_method, done;
// Check if count too large for handling it inlined.
+ __ movq(temp, left);
__ cmpq(right,
Immediate(reinterpret_cast<int64_t>(Smi::New(Smi::kBits))));
__ j(ABOVE_EQUAL, &call_method, Assembler::kNearJump);
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698