Index: runtime/vm/intermediate_language_arm64.cc |
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc |
index da1e92aaa83a000256513f7282e90507ceba2a9f..72c6852ce03ef2dc931b384934aeb6f7f877ce34 100644 |
--- a/runtime/vm/intermediate_language_arm64.cc |
+++ b/runtime/vm/intermediate_language_arm64.cc |
@@ -1134,6 +1134,93 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
} |
+CompileType LoadCodeUnitsInstr::ComputeType() const { |
+ switch (class_id()) { |
+ case kOneByteStringCid: |
+ case kTwoByteStringCid: |
+ case kExternalOneByteStringCid: |
+ case kExternalTwoByteStringCid: |
+ return CompileType::FromCid(kSmiCid); |
+ default: |
+ UNIMPLEMENTED(); |
+ return CompileType::Dynamic(); |
+ } |
+} |
+ |
+ |
+Representation LoadCodeUnitsInstr::representation() const { |
+ switch (class_id()) { |
+ case kOneByteStringCid: |
+ case kTwoByteStringCid: |
+ case kExternalOneByteStringCid: |
+ case kExternalTwoByteStringCid: |
+ return kTagged; |
+ default: |
+ UNIMPLEMENTED(); |
+ return kTagged; |
+ } |
+} |
+ |
+ |
+LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate, |
+ bool opt) const { |
+ const intptr_t kNumInputs = 2; |
+ const intptr_t kNumTemps = 0; |
+ LocationSummary* locs = new(isolate) LocationSummary( |
+ isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
+ locs->set_in(0, Location::RequiresRegister()); |
+ if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { |
+ locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
+ } else { |
+ locs->set_in(1, Location::RequiresRegister()); |
+ } |
+ |
+ locs->set_out(0, Location::RequiresRegister()); |
+ return locs; |
+} |
+ |
+ |
+void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
+ const Register array = locs()->in(0).reg(); |
+ const Location index = locs()->in(1); |
+ |
+ Address element_address = index.IsRegister() |
+ ? __ ElementAddressForRegIndex(true, // Load. |
+ IsExternal(), class_id(), index_scale(), |
+ array, index.reg()) |
+ : __ ElementAddressForIntIndex( |
+ IsExternal(), class_id(), index_scale(), |
+ array, Smi::Cast(index.constant()).Value()); |
+ // Warning: element_address may use register TMP as base. |
+ |
+ Register result = locs()->out(0).reg(); |
+ switch (class_id()) { |
+ case kOneByteStringCid: |
+ case kExternalOneByteStringCid: |
+ switch (element_count()) { |
+ case 1: __ ldr(result, element_address, kUnsignedByte); break; |
+ case 2: __ ldr(result, element_address, kUnsignedHalfword); break; |
+ case 4: __ ldr(result, element_address, kUnsignedWord); break; |
+ default: UNREACHABLE(); |
+ } |
+ __ SmiTag(result); |
+ break; |
+ case kTwoByteStringCid: |
+ case kExternalTwoByteStringCid: |
+ switch (element_count()) { |
+ case 1: __ ldr(result, element_address, kUnsignedHalfword); break; |
+ case 2: __ ldr(result, element_address, kUnsignedWord); break; |
+ default: UNREACHABLE(); |
+ } |
+ __ SmiTag(result); |
+ break; |
+ default: |
+ UNREACHABLE(); |
+ break; |
+ } |
+} |
+ |
+ |
Representation StoreIndexedInstr::RequiredInputRepresentation( |
intptr_t idx) const { |
// Array can be a Dart object or a pointer to external data. |
@@ -4240,6 +4327,28 @@ void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
} |
+LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary( |
+ Isolate* isolate, bool opt) const { |
+ const intptr_t kNumTemps = 0; |
+ LocationSummary* summary = new(isolate) LocationSummary( |
+ isolate, InputCount(), kNumTemps, LocationSummary::kCall); |
+ summary->set_in(0, Location::RegisterLocation(R0)); |
+ summary->set_in(1, Location::RegisterLocation(R1)); |
+ summary->set_in(2, Location::RegisterLocation(R2)); |
+ summary->set_in(3, Location::RegisterLocation(R3)); |
+ summary->set_out(0, Location::RegisterLocation(R0)); |
+ return summary; |
+} |
+ |
+ |
+void CaseInsensitiveCompareUC16Instr::EmitNativeCode( |
+ FlowGraphCompiler* compiler) { |
+ |
+ // Call the function. |
+ __ CallRuntime(TargetFunction(), TargetFunction().argument_count()); |
+} |
+ |
+ |
LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate, |
bool opt) const { |
if (result_cid() == kDoubleCid) { |
@@ -5316,6 +5425,19 @@ void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
} |
+void IndirectEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
+ __ Bind(compiler->GetJumpLabel(this)); |
+ if (!compiler->is_optimizing()) { |
+ compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
+ deopt_id_, |
+ Scanner::kNoSourcePos); |
+ } |
+ if (HasParallelMove()) { |
+ compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
+ } |
+} |
+ |
+ |
LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate, |
bool opt) const { |
return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); |
@@ -5348,6 +5470,43 @@ void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
} |
+LocationSummary* IndirectGotoInstr::MakeLocationSummary(Isolate* isolate, |
+ bool opt) const { |
+ const intptr_t kNumInputs = 1; |
+ const intptr_t kNumTemps = 1; |
+ |
+ LocationSummary* locs = new(isolate) LocationSummary( |
+ isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
+ |
+ locs->set_in(0, Location::RequiresRegister()); |
+ locs->set_temp(0, Location::RequiresRegister()); |
+ |
+ return locs; |
+} |
+ |
+ |
+void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
+ Register sum_reg = locs()->temp_slot(0)->reg(); |
+ |
+ // Load from [current frame pointer] + kPcMarkerSlotFromFp. |
+ __ ldr(sum_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize)); |
+ |
+ // Subtract the entrypoint offset. |
+ __ AddImmediate(sum_reg, |
+ sum_reg, |
+ -Assembler::EntryPointToPcMarkerOffset(), |
+ PP); |
+ |
+ // Add the offset. |
+ Register offset_reg = locs()->in(0).reg(); |
+ __ SmiUntag(offset_reg); |
+ __ add(sum_reg, sum_reg, Operand(offset_reg)); |
+ |
+ // Jump to the absolute address. |
+ __ br(sum_reg); |
+} |
+ |
+ |
LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate, |
bool opt) const { |
return LocationSummary::Make(isolate, |