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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 16126003: Use stack locations instead of register for binary Smi operations when possible. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 23246)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -2320,7 +2320,12 @@
LocationSummary* summary =
new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
- summary->set_in(1, Location::RegisterOrSmiConstant(right()));
+ ConstantInstr* constant = right()->definition()->AsConstant();
+ if (constant != NULL) {
+ summary->set_in(1, Location::RegisterOrSmiConstant(right()));
+ } else {
+ summary->set_in(1, Location::PrefersRegister());
+ }
summary->set_out(Location::SameAsFirstInput());
return summary;
}
@@ -2444,8 +2449,51 @@
break;
}
return;
- }
+ } // locs()->in(1).IsConstant().
+
+ if (locs()->in(1).IsStackSlot()) {
+ const Address& right = locs()->in(1).ToStackSlotAddress();
+ switch (op_kind()) {
+ case Token::kADD: {
+ __ addq(left, right);
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
+ break;
+ }
+ case Token::kSUB: {
+ __ subq(left, right);
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
+ break;
+ }
+ case Token::kMUL: {
+ __ SmiUntag(left);
+ __ imulq(left, right);
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
+ break;
+ }
+ case Token::kBIT_AND: {
+ // No overflow check.
+ __ andq(left, right);
+ break;
+ }
+ case Token::kBIT_OR: {
+ // No overflow check.
+ __ orq(left, right);
+ break;
+ }
+ case Token::kBIT_XOR: {
+ // No overflow check.
+ __ xorq(left, right);
+ break;
+ }
+ default:
+ UNREACHABLE();
+ break;
+ }
+ return;
+ } // locs()->in(1).IsStackSlot().
+
+ // if locs()->in(1).IsRegister.
Register right = locs()->in(1).reg();
switch (op_kind()) {
case Token::kADD: {
« 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