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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 616873003: Use UnboxedInt32 and UnboxedUint32 representation for LoadIndexedInstr (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 741698aceb24da4e444c8194a451bb5c3b2e3460..e90dfc4b35a6645d51750848b19246e83d0e476f 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -968,9 +968,11 @@ Representation LoadIndexedInstr::representation() const {
case kTypedDataUint16ArrayCid:
case kOneByteStringCid:
case kTwoByteStringCid:
+ return kTagged;
case kTypedDataInt32ArrayCid:
+ return kUnboxedInt32;
case kTypedDataUint32ArrayCid:
- return kTagged;
+ return kUnboxedUint32;
case kTypedDataFloat32ArrayCid:
case kTypedDataFloat64ArrayCid:
return kUnboxedDouble;
@@ -1052,6 +1054,29 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
return;
}
+ if ((representation() == kUnboxedUint32) ||
+ (representation() == kUnboxedInt32)) {
+ if ((index_scale() == 1) && index.IsRegister()) {
+ __ SmiUntag(index.reg());
+ }
+ Register result = locs()->out(0).reg();
+ switch (class_id()) {
+ case kTypedDataInt32ArrayCid:
+ ASSERT(representation() == kUnboxedInt32);
+ __ movsxd(result, element_address);
+ break;
+ case kTypedDataUint32ArrayCid:
+ ASSERT(representation() == kUnboxedUint32);
+ __ movl(result, element_address);
+ break;
+ default:
+ UNREACHABLE();
+ }
+ return;
+ }
+
+ ASSERT(representation() == kTagged);
+
if ((index_scale() == 1) && index.IsRegister()) {
__ SmiUntag(index.reg());
}
@@ -1078,14 +1103,6 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ movzxw(result, element_address);
__ SmiTag(result);
break;
- case kTypedDataInt32ArrayCid:
- __ movsxd(result, element_address);
- __ SmiTag(result);
- break;
- case kTypedDataUint32ArrayCid:
- __ movl(result, element_address);
- __ SmiTag(result);
- break;
default:
ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid));
__ movq(result, element_address);
@@ -4619,7 +4636,23 @@ void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-DEFINE_UNIMPLEMENTED_INSTRUCTION(Int32ToDoubleInstr)
+LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Isolate* isolate,
+ bool opt) const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* result = new(isolate) LocationSummary(
+ isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ result->set_in(0, Location::WritableRegister());
+ result->set_out(0, Location::RequiresFpuRegister());
+ return result;
+}
+
+
+void Int32ToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Register value = locs()->in(0).reg();
+ FpuRegister result = locs()->out(0).fpu_reg();
+ __ cvtsi2sd(result, value);
+}
LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate,
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698