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

Unified Diff: runtime/vm/assembler_mips.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_mips.h ('k') | runtime/vm/assembler_mips_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_mips.cc
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index 811023dcd9298d1c7dfdb40292a22a4b54e0fa6f..b7b0e483a7a18941c336047dd27b4392d5374c08 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -702,6 +702,51 @@ void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) {
}
+void Assembler::ComputeRange(Register result,
+ Register value,
+ Label* miss) {
+ const Register hi = TMP;
+ const Register lo = CMPRES2;
+
+ Label done;
+ srl(result, value, kBitsPerWord - 1);
+ andi(CMPRES1, value, Immediate(kSmiTagMask));
+ beq(CMPRES1, ZR, &done);
+
+ LoadClassId(CMPRES1, value);
+ BranchNotEqual(CMPRES1, Immediate(kMintCid), miss);
+ LoadFieldFromOffset(hi, value, Mint::value_offset() + kWordSize);
+ LoadFieldFromOffset(lo, value, Mint::value_offset());
+ sra(lo, lo, kBitsPerWord - 1);
+
+ LoadImmediate(result, ICData::kInt32RangeBit);
+
+ beq(hi, lo, &done);
+ delay_slot()->subu(result, result, hi);
+
+ beq(hi, ZR, &done);
+ delay_slot()->addiu(result, ZR, Immediate(ICData::kUint32RangeBit));
+ LoadImmediate(result, ICData::kInt64RangeBit);
+ Bind(&done);
+}
+
+
+void Assembler::UpdateRangeFeedback(Register value,
+ intptr_t index,
+ Register ic_data,
+ Register scratch,
+ Label* miss) {
+ ASSERT(ICData::IsValidRangeFeedbackIndex(index));
+ ComputeRange(scratch, value, miss);
+ LoadFieldFromOffset(TMP, ic_data, ICData::range_feedback_offset());
+ if (index != 0) {
+ sll(scratch, scratch, ICData::kBitsPerRangeFeedback * index);
+ }
+ or_(TMP, TMP, scratch);
+ StoreFieldToOffset(TMP, ic_data, ICData::range_feedback_offset());
+}
+
+
void Assembler::EnterFrame() {
ASSERT(!in_delay_slot_);
addiu(SP, SP, Immediate(-2 * kWordSize));
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/assembler_mips_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698