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/instructions.h" | 9 #include "vm/instructions.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 i = Back(++end); | 51 i = Back(++end); |
52 instr = Instr::At(reinterpret_cast<uword>(&i)); | 52 instr = Instr::At(reinterpret_cast<uword>(&i)); |
53 ASSERT(instr->OpcodeField() == SPECIAL); | 53 ASSERT(instr->OpcodeField() == SPECIAL); |
54 ASSERT(instr->FunctionField() == ADDU); | 54 ASSERT(instr->FunctionField() == ADDU); |
55 ASSERT(instr->RdField() == *reg); | 55 ASSERT(instr->RdField() == *reg); |
56 ASSERT(instr->RsField() == *reg); | 56 ASSERT(instr->RsField() == *reg); |
57 ASSERT(instr->RtField() == PP); | 57 ASSERT(instr->RtField() == PP); |
58 | 58 |
59 i = Back(++end); | 59 i = Back(++end); |
60 instr = Instr::At(reinterpret_cast<uword>(&i)); | 60 instr = Instr::At(reinterpret_cast<uword>(&i)); |
61 if (instr->OpcodeField() == LUI) { | 61 ASSERT(instr->RtField() == *reg); |
62 ASSERT(instr->RtField() == *reg); | 62 // Offset is signed, so add the upper 16 bits. |
63 offset |= (instr->UImmField() << 16); | 63 offset += (instr->UImmField() << 16); |
64 } else { | |
65 ASSERT(instr->OpcodeField() == ORI); | |
66 ASSERT(instr->RtField() == *reg); | |
67 offset |= instr->UImmField(); | |
68 | |
69 if (instr->RsField() != ZR) { | |
70 ASSERT(instr->RsField() == *reg); | |
71 i = Back(++end); | |
72 instr = Instr::At(reinterpret_cast<uword>(&i)); | |
73 ASSERT(instr->OpcodeField() == LUI); | |
74 ASSERT(instr->RtField() == *reg); | |
75 offset |= (instr->UImmField() << 16); | |
76 } | |
77 } | |
78 } | 64 } |
79 offset += kHeapObjectTag; | 65 offset += kHeapObjectTag; |
80 ASSERT(Utils::IsAligned(offset, 4)); | 66 ASSERT(Utils::IsAligned(offset, 4)); |
81 *index = (offset - Array::data_offset())/4; | 67 *index = (offset - Array::data_offset())/4; |
82 return end; | 68 return end; |
83 } | 69 } |
84 | 70 |
85 | 71 |
86 RawICData* CallPattern::IcData() { | 72 RawICData* CallPattern::IcData() { |
87 UNIMPLEMENTED(); | 73 UNIMPLEMENTED(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 112 |
127 | 113 |
128 void JumpPattern::SetTargetAddress(uword target_address) const { | 114 void JumpPattern::SetTargetAddress(uword target_address) const { |
129 UNIMPLEMENTED(); | 115 UNIMPLEMENTED(); |
130 } | 116 } |
131 | 117 |
132 } // namespace dart | 118 } // namespace dart |
133 | 119 |
134 #endif // defined TARGET_ARCH_MIPS | 120 #endif // defined TARGET_ARCH_MIPS |
135 | 121 |
OLD | NEW |