OLD | NEW |
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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
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 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 Bind(&done); | 819 Bind(&done); |
820 } | 820 } |
821 | 821 |
822 | 822 |
823 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { | 823 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { |
824 LoadClassIdMayBeSmi(result, object); | 824 LoadClassIdMayBeSmi(result, object); |
825 SmiTag(result); | 825 SmiTag(result); |
826 } | 826 } |
827 | 827 |
828 | 828 |
829 void Assembler::ComputeRange(Register result, | |
830 Register value, | |
831 Label* miss) { | |
832 const Register hi = TMP; | |
833 const Register lo = CMPRES2; | |
834 | |
835 Label done; | |
836 srl(result, value, kBitsPerWord - 1); | |
837 andi(CMPRES1, value, Immediate(kSmiTagMask)); | |
838 beq(CMPRES1, ZR, &done); | |
839 | |
840 LoadClassId(CMPRES1, value); | |
841 BranchNotEqual(CMPRES1, Immediate(kMintCid), miss); | |
842 LoadFieldFromOffset(hi, value, Mint::value_offset() + kWordSize); | |
843 LoadFieldFromOffset(lo, value, Mint::value_offset()); | |
844 sra(lo, lo, kBitsPerWord - 1); | |
845 | |
846 LoadImmediate(result, ICData::kInt32RangeBit); | |
847 | |
848 beq(hi, lo, &done); | |
849 delay_slot()->subu(result, result, hi); | |
850 | |
851 beq(hi, ZR, &done); | |
852 delay_slot()->addiu(result, ZR, Immediate(ICData::kUint32RangeBit)); | |
853 LoadImmediate(result, ICData::kInt64RangeBit); | |
854 Bind(&done); | |
855 } | |
856 | |
857 | |
858 void Assembler::UpdateRangeFeedback(Register value, | |
859 intptr_t index, | |
860 Register ic_data, | |
861 Register scratch, | |
862 Label* miss) { | |
863 ASSERT(ICData::IsValidRangeFeedbackIndex(index)); | |
864 ComputeRange(scratch, value, miss); | |
865 LoadFieldFromOffset(TMP, ic_data, ICData::state_bits_offset()); | |
866 sll(scratch, scratch, ICData::RangeFeedbackShift(index)); | |
867 or_(TMP, TMP, scratch); | |
868 StoreFieldToOffset(TMP, ic_data, ICData::state_bits_offset()); | |
869 } | |
870 | |
871 | |
872 void Assembler::EnterFrame() { | 829 void Assembler::EnterFrame() { |
873 ASSERT(!in_delay_slot_); | 830 ASSERT(!in_delay_slot_); |
874 addiu(SP, SP, Immediate(-2 * kWordSize)); | 831 addiu(SP, SP, Immediate(-2 * kWordSize)); |
875 sw(RA, Address(SP, 1 * kWordSize)); | 832 sw(RA, Address(SP, 1 * kWordSize)); |
876 sw(FP, Address(SP, 0 * kWordSize)); | 833 sw(FP, Address(SP, 0 * kWordSize)); |
877 mov(FP, SP); | 834 mov(FP, SP); |
878 } | 835 } |
879 | 836 |
880 | 837 |
881 void Assembler::LeaveFrameAndReturn() { | 838 void Assembler::LeaveFrameAndReturn() { |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 Label stop; | 1263 Label stop; |
1307 b(&stop); | 1264 b(&stop); |
1308 Emit(reinterpret_cast<int32_t>(message)); | 1265 Emit(reinterpret_cast<int32_t>(message)); |
1309 Bind(&stop); | 1266 Bind(&stop); |
1310 break_(Instr::kStopMessageCode); | 1267 break_(Instr::kStopMessageCode); |
1311 } | 1268 } |
1312 | 1269 |
1313 } // namespace dart | 1270 } // namespace dart |
1314 | 1271 |
1315 #endif // defined TARGET_ARCH_MIPS | 1272 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |