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" // Needed here to get TARGET_ARCH_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
7 | 7 |
8 #include "vm/constants_mips.h" | 8 #include "vm/constants_mips.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/instructions.h" | 10 #include "vm/instructions.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 Instr* ori = Instr::At(pc_ + (1 * Instr::kInstrSize)); | 220 Instr* ori = Instr::At(pc_ + (1 * Instr::kInstrSize)); |
221 const int32_t lui_bits = lui->InstructionBits(); | 221 const int32_t lui_bits = lui->InstructionBits(); |
222 const int32_t ori_bits = ori->InstructionBits(); | 222 const int32_t ori_bits = ori->InstructionBits(); |
223 const uint16_t target_lo = target_address & 0xffff; | 223 const uint16_t target_lo = target_address & 0xffff; |
224 const uint16_t target_hi = target_address >> 16; | 224 const uint16_t target_hi = target_address >> 16; |
225 | 225 |
226 lui->SetInstructionBits((lui_bits & 0xffff0000) | target_hi); | 226 lui->SetInstructionBits((lui_bits & 0xffff0000) | target_hi); |
227 ori->SetInstructionBits((ori_bits & 0xffff0000) | target_lo); | 227 ori->SetInstructionBits((ori_bits & 0xffff0000) | target_lo); |
228 } | 228 } |
229 | 229 |
| 230 |
| 231 ReturnPattern::ReturnPattern(uword pc) |
| 232 : pc_(pc) { |
| 233 } |
| 234 |
| 235 |
| 236 bool ReturnPattern::IsValid() const { |
| 237 Instr* jr = Instr::At(pc_); |
| 238 return (jr->OpcodeField() == SPECIAL) && |
| 239 (jr->FunctionField() == JR) && |
| 240 (jr->RsField() == RA); |
| 241 } |
| 242 |
230 } // namespace dart | 243 } // namespace dart |
231 | 244 |
232 #endif // defined TARGET_ARCH_MIPS | 245 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |