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

Unified Diff: runtime/vm/assembler_arm64.cc

Issue 735543003: Range feedback for binary integer operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 6 years 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 | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_arm64_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(&not_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(&not_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
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_arm64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698