| 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/runtime_entry.h" | 9 #include "vm/runtime_entry.h" |
| 10 #include "vm/simulator.h" | 10 #include "vm/simulator.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 and_(ro, ro, TMP1); | 110 and_(ro, ro, TMP1); |
| 111 } else { | 111 } else { |
| 112 addu(rd, rs, rt); | 112 addu(rd, rs, rt); |
| 113 xor_(ro, rd, rs); | 113 xor_(ro, rd, rs); |
| 114 xor_(TMP1, rd, rt); | 114 xor_(TMP1, rd, rt); |
| 115 and_(ro, TMP1, ro); | 115 and_(ro, TMP1, ro); |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 | 119 |
| 120 void Assembler::SubuDetectOverflow(Register rd, Register rs, Register rt, |
| 121 Register ro) { |
| 122 ASSERT(rd != ro); |
| 123 ASSERT(rd != TMP1); |
| 124 ASSERT(ro != TMP1); |
| 125 ASSERT(ro != rs); |
| 126 ASSERT(ro != rt); |
| 127 ASSERT(rs != TMP1); |
| 128 ASSERT(rt != TMP1); |
| 129 |
| 130 // This happens with some crankshaft code. Since Subu works fine if |
| 131 // left == right, let's not make that restriction here. |
| 132 if (rs == rt) { |
| 133 mov(rd, ZR); |
| 134 mov(ro, ZR); |
| 135 return; |
| 136 } |
| 137 |
| 138 if (rd == rs) { |
| 139 mov(TMP1, rs); // Preserve left. |
| 140 subu(rd, rs, rt); // Left is overwritten. |
| 141 xor_(ro, rd, TMP1); // scratch is original left. |
| 142 xor_(TMP1, TMP1, rs); // scratch is original left. |
| 143 and_(ro, TMP1, ro); |
| 144 } else if (rd == rt) { |
| 145 mov(TMP1, rt); // Preserve right. |
| 146 subu(rd, rs, rt); // Right is overwritten. |
| 147 xor_(ro, rd, rs); |
| 148 xor_(TMP1, rs, TMP1); // Original right. |
| 149 and_(ro, TMP1, ro); |
| 150 } else { |
| 151 subu(rd, rs, rt); |
| 152 xor_(ro, rd, rs); |
| 153 xor_(TMP1, rs, rt); |
| 154 and_(ro, TMP1, ro); |
| 155 } |
| 156 } |
| 157 |
| 158 |
| 120 void Assembler::LoadObject(Register rd, const Object& object) { | 159 void Assembler::LoadObject(Register rd, const Object& object) { |
| 121 // Smi's and VM heap objects are never relocated; do not use object pool. | 160 // Smi's and VM heap objects are never relocated; do not use object pool. |
| 122 if (object.IsSmi()) { | 161 if (object.IsSmi()) { |
| 123 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); | 162 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); |
| 124 } else if (object.InVMHeap()) { | 163 } else if (object.InVMHeap()) { |
| 125 // Make sure that class CallPattern is able to decode this load immediate. | 164 // Make sure that class CallPattern is able to decode this load immediate. |
| 126 int32_t object_raw = reinterpret_cast<int32_t>(object.raw()); | 165 int32_t object_raw = reinterpret_cast<int32_t>(object.raw()); |
| 127 const uint16_t object_low = Utils::Low16Bits(object_raw); | 166 const uint16_t object_low = Utils::Low16Bits(object_raw); |
| 128 const uint16_t object_high = Utils::High16Bits(object_raw); | 167 const uint16_t object_high = Utils::High16Bits(object_raw); |
| 129 lui(rd, Immediate(object_high)); | 168 lui(rd, Immediate(object_high)); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 b(&stop); | 385 b(&stop); |
| 347 Emit(reinterpret_cast<int32_t>(message)); | 386 Emit(reinterpret_cast<int32_t>(message)); |
| 348 Bind(&stop); | 387 Bind(&stop); |
| 349 break_(Instr::kStopMessageCode); | 388 break_(Instr::kStopMessageCode); |
| 350 } | 389 } |
| 351 | 390 |
| 352 } // namespace dart | 391 } // namespace dart |
| 353 | 392 |
| 354 #endif // defined TARGET_ARCH_MIPS | 393 #endif // defined TARGET_ARCH_MIPS |
| 355 | 394 |
| OLD | NEW |