Index: runtime/vm/assembler_arm64.cc |
diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc |
index e163e1d626ddfbbedcf37063647563f91d4e5f58..833cf3e9e1564c7bcfc48304745eff0f7b57377e 100644 |
--- a/runtime/vm/assembler_arm64.cc |
+++ b/runtime/vm/assembler_arm64.cc |
@@ -1133,6 +1133,51 @@ void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { |
} |
+void Assembler::ComputeRange(Register result, |
+ Register value, |
+ Register scratch, |
+ Label* not_mint) { |
+ Label done, not_smi; |
+ tsti(value, Immediate(kSmiTagMask)); |
+ b(¬_smi, NE); |
+ |
+ AsrImmediate(scratch, value, 32); |
+ LoadImmediate(result, ICData::kUint32RangeBit, PP); |
+ cmp(scratch, Operand(1)); |
+ b(&done, EQ); |
+ |
+ neg(scratch, scratch); |
+ add(result, scratch, Operand(ICData::kInt32RangeBit)); |
+ cmp(scratch, Operand(1)); |
+ LoadImmediate(TMP, ICData::kSignedRangeBit, PP); |
+ csel(result, result, TMP, LS); |
+ b(&done); |
+ |
+ Bind(¬_smi); |
+ CompareClassId(value, kMintCid, PP); |
+ b(not_mint, NE); |
+ |
+ LoadImmediate(result, ICData::kInt64RangeBit, PP); |
+ Bind(&done); |
+} |
+ |
+ |
+void Assembler::UpdateRangeFeedback(Register value, |
+ intptr_t index, |
+ Register ic_data, |
+ Register scratch1, |
+ Register scratch2, |
+ Label* miss) { |
+ ASSERT(ICData::IsValidRangeFeedbackIndex(index)); |
+ ComputeRange(scratch1, value, scratch2, miss); |
+ ldr(scratch2, FieldAddress(ic_data, ICData::range_feedback_offset()), kWord); |
+ orrw(scratch2, |
+ scratch2, |
+ Operand(scratch1, LSL, ICData::kBitsPerRangeFeedback * index)); |
+ str(scratch2, FieldAddress(ic_data, ICData::range_feedback_offset()), kWord); |
+} |
+ |
+ |
// Frame entry and exit. |
void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { |
// Reserve space for arguments and align frame before entering |