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" | 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 ASSERT((high == Instr::kNopInstruction) && (low == Instr::kNopInstruction)); | 107 ASSERT((high == Instr::kNopInstruction) && (low == Instr::kNopInstruction)); |
108 } | 108 } |
109 }; | 109 }; |
110 | 110 |
111 | 111 |
112 void Assembler::EmitFarJump(int32_t offset, bool link) { | 112 void Assembler::EmitFarJump(int32_t offset, bool link) { |
113 ASSERT(use_far_branches()); | 113 ASSERT(use_far_branches()); |
114 const uint16_t low = Utils::Low16Bits(offset); | 114 const uint16_t low = Utils::Low16Bits(offset); |
115 const uint16_t high = Utils::High16Bits(offset); | 115 const uint16_t high = Utils::High16Bits(offset); |
116 buffer_.EmitFixup(new PatchFarJump()); | 116 buffer_.EmitFixup(new PatchFarJump()); |
117 lui(TMP, Immediate(high)); | 117 lui(T9, Immediate(high)); |
118 ori(TMP, TMP, Immediate(low)); | 118 ori(T9, T9, Immediate(low)); |
119 if (link) { | 119 if (link) { |
120 EmitRType(SPECIAL, TMP, R0, RA, 0, JALR); | 120 EmitRType(SPECIAL, T9, R0, RA, 0, JALR); |
121 } else { | 121 } else { |
122 EmitRType(SPECIAL, TMP, R0, R0, 0, JR); | 122 EmitRType(SPECIAL, T9, R0, R0, 0, JR); |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 | 126 |
127 static Opcode OppositeBranchOpcode(Opcode b) { | 127 static Opcode OppositeBranchOpcode(Opcode b) { |
128 switch (b) { | 128 switch (b) { |
129 case BEQ: return BNE; | 129 case BEQ: return BNE; |
130 case BNE: return BEQ; | 130 case BNE: return BEQ; |
131 case BGTZ: return BLEZ; | 131 case BGTZ: return BLEZ; |
132 case BLEZ: return BGTZ; | 132 case BLEZ: return BGTZ; |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 Emit(reinterpret_cast<int32_t>(message)); | 1053 Emit(reinterpret_cast<int32_t>(message)); |
1054 Bind(&msg); | 1054 Bind(&msg); |
1055 break_(Instr::kMsgMessageCode); | 1055 break_(Instr::kMsgMessageCode); |
1056 } | 1056 } |
1057 #endif | 1057 #endif |
1058 } | 1058 } |
1059 | 1059 |
1060 } // namespace dart | 1060 } // namespace dart |
1061 | 1061 |
1062 #endif // defined TARGET_ARCH_MIPS | 1062 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |