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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if (instr->OpcodeField() == LUI) { |
62 ASSERT(instr->RtField() == *reg); | 62 ASSERT(instr->RtField() == *reg); |
63 offset |= (instr->UImmField() << 16); | 63 // Offset is signed, so add the upper 16 bits. |
| 64 offset += (instr->UImmField() << 16); |
64 } else { | 65 } else { |
65 ASSERT(instr->OpcodeField() == ORI); | 66 ASSERT(instr->OpcodeField() == ORI); |
66 ASSERT(instr->RtField() == *reg); | 67 ASSERT(instr->RtField() == *reg); |
| 68 ASSERT(offset == 0); |
| 69 // Offset is 0 here, so just grab the lower offset bits. |
67 offset |= instr->UImmField(); | 70 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 } | 71 } |
78 } | 72 } |
79 offset += kHeapObjectTag; | 73 offset += kHeapObjectTag; |
80 ASSERT(Utils::IsAligned(offset, 4)); | 74 ASSERT(Utils::IsAligned(offset, 4)); |
81 *index = (offset - Array::data_offset())/4; | 75 *index = (offset - Array::data_offset())/4; |
82 return end; | 76 return end; |
83 } | 77 } |
84 | 78 |
85 | 79 |
86 RawICData* CallPattern::IcData() { | 80 RawICData* CallPattern::IcData() { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 120 |
127 | 121 |
128 void JumpPattern::SetTargetAddress(uword target_address) const { | 122 void JumpPattern::SetTargetAddress(uword target_address) const { |
129 UNIMPLEMENTED(); | 123 UNIMPLEMENTED(); |
130 } | 124 } |
131 | 125 |
132 } // namespace dart | 126 } // namespace dart |
133 | 127 |
134 #endif // defined TARGET_ARCH_MIPS | 128 #endif // defined TARGET_ARCH_MIPS |
135 | 129 |
OLD | NEW |