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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/assembler_mips_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/longjump.h" 9 #include "vm/longjump.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 andi(CMPRES1, object, Immediate(kSmiTagMask)); 695 andi(CMPRES1, object, Immediate(kSmiTagMask));
696 if (result != object) { 696 if (result != object) {
697 mov(result, object); 697 mov(result, object);
698 } 698 }
699 movz(result, TMP, CMPRES1); 699 movz(result, TMP, CMPRES1);
700 LoadClassId(result, result); 700 LoadClassId(result, result);
701 SmiTag(result); 701 SmiTag(result);
702 } 702 }
703 703
704 704
705 void Assembler::ComputeRange(Register result,
706 Register value,
707 Label* miss) {
708 const Register hi = TMP;
709 const Register lo = CMPRES2;
710
711 Label done;
712 srl(result, value, kBitsPerWord - 1);
713 andi(CMPRES1, value, Immediate(kSmiTagMask));
714 beq(CMPRES1, ZR, &done);
715
716 LoadClassId(CMPRES1, value);
717 BranchNotEqual(CMPRES1, Immediate(kMintCid), miss);
718 LoadFieldFromOffset(hi, value, Mint::value_offset() + kWordSize);
719 LoadFieldFromOffset(lo, value, Mint::value_offset());
720 sra(lo, lo, kBitsPerWord - 1);
721
722 LoadImmediate(result, ICData::kInt32RangeBit);
723
724 beq(hi, lo, &done);
725 delay_slot()->subu(result, result, hi);
726
727 beq(hi, ZR, &done);
728 delay_slot()->addiu(result, ZR, Immediate(ICData::kUint32RangeBit));
729 LoadImmediate(result, ICData::kInt64RangeBit);
730 Bind(&done);
731 }
732
733
734 void Assembler::UpdateRangeFeedback(Register value,
735 intptr_t index,
736 Register ic_data,
737 Register scratch,
738 Label* miss) {
739 ASSERT(ICData::IsValidRangeFeedbackIndex(index));
740 ComputeRange(scratch, value, miss);
741 LoadFieldFromOffset(TMP, ic_data, ICData::range_feedback_offset());
742 if (index != 0) {
743 sll(scratch, scratch, ICData::kBitsPerRangeFeedback * index);
744 }
745 or_(TMP, TMP, scratch);
746 StoreFieldToOffset(TMP, ic_data, ICData::range_feedback_offset());
747 }
748
749
705 void Assembler::EnterFrame() { 750 void Assembler::EnterFrame() {
706 ASSERT(!in_delay_slot_); 751 ASSERT(!in_delay_slot_);
707 addiu(SP, SP, Immediate(-2 * kWordSize)); 752 addiu(SP, SP, Immediate(-2 * kWordSize));
708 sw(RA, Address(SP, 1 * kWordSize)); 753 sw(RA, Address(SP, 1 * kWordSize));
709 sw(FP, Address(SP, 0 * kWordSize)); 754 sw(FP, Address(SP, 0 * kWordSize));
710 mov(FP, SP); 755 mov(FP, SP);
711 } 756 }
712 757
713 758
714 void Assembler::LeaveFrameAndReturn() { 759 void Assembler::LeaveFrameAndReturn() {
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 Emit(reinterpret_cast<int32_t>(message)); 1273 Emit(reinterpret_cast<int32_t>(message));
1229 Bind(&msg); 1274 Bind(&msg);
1230 break_(Instr::kSimulatorMessageCode); 1275 break_(Instr::kSimulatorMessageCode);
1231 } 1276 }
1232 #endif 1277 #endif
1233 } 1278 }
1234 1279
1235 } // namespace dart 1280 } // namespace dart
1236 1281
1237 #endif // defined TARGET_ARCH_MIPS 1282 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« 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