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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 12295017: Use compile type to improve stores to Int32List and Uint32List on ia32. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 18616)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -1314,7 +1314,7 @@
return kTagged;
case kInt32ArrayCid:
case kUint32ArrayCid:
- return kUnboxedMint;
+ return (value()->Type()->ToCid() == kSmiCid) ? kTagged : kUnboxedMint;
case kFloat32ArrayCid :
case kFloat64ArrayCid :
return kUnboxedDouble;
@@ -1368,12 +1368,18 @@
// Writable register because the value must be untagged before storing.
locs->set_in(2, Location::WritableRegister());
break;
+ case kInt32ArrayCid:
+ case kUint32ArrayCid:
+ // Mints are stored in XMM registers. For smis, use a writable register
+ // because the value must be untagged before storing.
+ locs->set_in(2, (RequiredInputRepresentation(2) == kUnboxedMint)
+ ? Location::RequiresFpuRegister()
+ : Location::WritableRegister());
+ break;
case kFloat32ArrayCid:
// Need temp register for float-to-double conversion.
locs->AddTemp(Location::RequiresFpuRegister());
// Fall through.
- case kInt32ArrayCid:
- case kUint32ArrayCid:
case kFloat64ArrayCid:
// TODO(srdjan): Support Float64 constants.
locs->set_in(2, Location::RequiresFpuRegister());
@@ -1483,7 +1489,14 @@
}
case kInt32ArrayCid:
case kUint32ArrayCid:
+ if (RequiredInputRepresentation(2) == kTagged) {
Vyacheslav Egorov (Google) 2013/02/18 16:21:44 I suggest you encapsulate this check (and two abov
Florian Schneider 2013/02/18 16:33:31 Done.
+ Register value = locs()->in(2).reg();
+ __ SmiUntag(value);
+ __ movl(element_address, value);
+ } else {
+ ASSERT(RequiredInputRepresentation(2) == kUnboxedMint);
__ movss(element_address, locs()->in(2).fpu_reg());
+ }
break;
case kFloat32ArrayCid:
// Convert to single precision.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698