Chromium Code Reviews| 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()); |
|
Vyacheslav Egorov (Google)
2014/10/03 13:07:41
no need to ask for a writable register.
|
| + 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); |
|
Vyacheslav Egorov (Google)
2014/10/03 13:07:41
The same comment as in ARM64. I suggest 32-bit ver
|
| +} |
| LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate, |