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

Unified Diff: runtime/vm/assembler_ia32.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_ia32.h ('k') | runtime/vm/assembler_ia32_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index f05f3bc832abc8066fe7ba6546724b593cebba93..865fafa35c1167c0b8af09199c6f82be8fd5c7df 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -1497,6 +1497,13 @@ void Assembler::orl(Register dst, const Address& address) {
}
+void Assembler::orl(const Address& address, Register reg) {
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+ EmitUint8(0x09);
+ EmitOperand(reg, address);
+}
+
+
void Assembler::xorl(Register dst, Register src) {
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
EmitUint8(0x33);
@@ -2918,6 +2925,49 @@ void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) {
}
+void Assembler::ComputeRange(Register result,
+ Register value,
+ Register lo_temp,
+ Register hi_temp,
+ Label* not_mint) {
+ Label done;
+ movl(result, value);
+ shrl(result, Immediate(kBitsPerWord - 1)); // Sign bit.
+ testl(value, Immediate(kSmiTagMask));
+ j(ZERO, &done, Assembler::kNearJump);
+ CompareClassId(value, kMintCid, result);
+ j(NOT_EQUAL, not_mint);
+ movl(lo_temp, FieldAddress(value, Mint::value_offset()));
+ movl(hi_temp, FieldAddress(value, Mint::value_offset() + kWordSize));
+ movl(result, Immediate(ICData::kInt32RangeBit));
+ subl(result, hi_temp); // 10 (positive int32), 11 (negative int32)
+ sarl(lo_temp, Immediate(kBitsPerWord - 1));
+ cmpl(lo_temp, hi_temp);
+ j(EQUAL, &done, Assembler::kNearJump);
+ movl(result, Immediate(ICData::kUint32RangeBit)); // Uint32
+ cmpl(hi_temp, Immediate(0));
+ j(EQUAL, &done, Assembler::kNearJump);
+ movl(result, Immediate(ICData::kInt64RangeBit)); // Int64
+ Bind(&done);
+}
+
+
+void Assembler::UpdateRangeFeedback(Register value,
+ intptr_t index,
+ Register ic_data,
+ Register scratch1,
+ Register scratch2,
+ Register scratch3,
+ Label* miss) {
+ ASSERT(ICData::IsValidRangeFeedbackIndex(index));
+ ComputeRange(scratch1, value, scratch2, scratch3, miss);
+ if (index != 0) {
+ shll(scratch1, Immediate(ICData::kBitsPerRangeFeedback * index));
+ }
+ orl(FieldAddress(ic_data, ICData::range_feedback_offset()), scratch1);
+}
+
+
Address Assembler::ElementAddressForIntIndex(bool is_external,
intptr_t cid,
intptr_t index_scale,
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_ia32_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698