| 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 #ifndef VM_ASSEMBLER_MIPS_H_ | 5 #ifndef VM_ASSEMBLER_MIPS_H_ |
| 6 #define VM_ASSEMBLER_MIPS_H_ | 6 #define VM_ASSEMBLER_MIPS_H_ |
| 7 | 7 |
| 8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
| 9 #error Do not include assembler_mips.h directly; use assembler.h instead. | 9 #error Do not include assembler_mips.h directly; use assembler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 } | 988 } |
| 989 | 989 |
| 990 void SmiTag(Register reg) { | 990 void SmiTag(Register reg) { |
| 991 sll(reg, reg, kSmiTagSize); | 991 sll(reg, reg, kSmiTagSize); |
| 992 } | 992 } |
| 993 | 993 |
| 994 void SmiUntag(Register reg) { | 994 void SmiUntag(Register reg) { |
| 995 sra(reg, reg, kSmiTagSize); | 995 sra(reg, reg, kSmiTagSize); |
| 996 } | 996 } |
| 997 | 997 |
| 998 void LoadFromOffset(Register reg, Register base, int32_t offset) { |
| 999 if (Utils::IsInt(kImmBits, offset)) { |
| 1000 lw(reg, Address(base, offset)); |
| 1001 } else { |
| 1002 LoadImmediate(TMP, offset); |
| 1003 addu(TMP, base, TMP); |
| 1004 lw(reg, Address(TMP, 0)); |
| 1005 } |
| 1006 } |
| 1007 |
| 1008 void StoreToOffset(Register reg, Register base, int32_t offset) { |
| 1009 if (Utils::IsInt(kImmBits, offset)) { |
| 1010 sw(reg, Address(base, offset)); |
| 1011 } else { |
| 1012 LoadImmediate(TMP, offset); |
| 1013 addu(TMP, base, TMP); |
| 1014 sw(reg, Address(TMP, 0)); |
| 1015 } |
| 1016 } |
| 1017 |
| 998 void StoreDToOffset(DRegister reg, Register base, int32_t offset) { | 1018 void StoreDToOffset(DRegister reg, Register base, int32_t offset) { |
| 999 FRegister lo = static_cast<FRegister>(reg * 2); | 1019 FRegister lo = static_cast<FRegister>(reg * 2); |
| 1000 FRegister hi = static_cast<FRegister>(reg * 2 + 1); | 1020 FRegister hi = static_cast<FRegister>(reg * 2 + 1); |
| 1001 swc1(lo, Address(base, offset)); | 1021 swc1(lo, Address(base, offset)); |
| 1002 swc1(hi, Address(base, offset + kWordSize)); | 1022 swc1(hi, Address(base, offset + kWordSize)); |
| 1003 } | 1023 } |
| 1004 | 1024 |
| 1005 void LoadDFromOffset(DRegister reg, Register base, int32_t offset) { | 1025 void LoadDFromOffset(DRegister reg, Register base, int32_t offset) { |
| 1006 FRegister lo = static_cast<FRegister>(reg * 2); | 1026 FRegister lo = static_cast<FRegister>(reg * 2); |
| 1007 FRegister hi = static_cast<FRegister>(reg * 2 + 1); | 1027 FRegister hi = static_cast<FRegister>(reg * 2 + 1); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1224 Register value, | 1244 Register value, |
| 1225 Label* no_update); | 1245 Label* no_update); |
| 1226 | 1246 |
| 1227 DISALLOW_ALLOCATION(); | 1247 DISALLOW_ALLOCATION(); |
| 1228 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1248 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 1229 }; | 1249 }; |
| 1230 | 1250 |
| 1231 } // namespace dart | 1251 } // namespace dart |
| 1232 | 1252 |
| 1233 #endif // VM_ASSEMBLER_MIPS_H_ | 1253 #endif // VM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |