| 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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 buffer_.Store<int32_t>(position, encoded); | 348 buffer_.Store<int32_t>(position, encoded); |
| 349 label->position_ = DecodeBranchOffset(next); | 349 label->position_ = DecodeBranchOffset(next); |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 label->BindTo(bound_pc); | 352 label->BindTo(bound_pc); |
| 353 delay_slot_available_ = false; | 353 delay_slot_available_ = false; |
| 354 } | 354 } |
| 355 | 355 |
| 356 | 356 |
| 357 void Assembler::LoadWordFromPoolOffset(Register rd, int32_t offset) { | 357 void Assembler::LoadWordFromPoolOffset(Register rd, int32_t offset) { |
| 358 ASSERT(allow_constant_pool()); | 358 ASSERT(constant_pool_allowed()); |
| 359 ASSERT(!in_delay_slot_); | 359 ASSERT(!in_delay_slot_); |
| 360 ASSERT(rd != PP); | 360 ASSERT(rd != PP); |
| 361 if (Address::CanHoldOffset(offset)) { | 361 if (Address::CanHoldOffset(offset)) { |
| 362 lw(rd, Address(PP, offset)); | 362 lw(rd, Address(PP, offset)); |
| 363 } else { | 363 } else { |
| 364 const int16_t offset_low = Utils::Low16Bits(offset); // Signed. | 364 const int16_t offset_low = Utils::Low16Bits(offset); // Signed. |
| 365 offset -= offset_low; | 365 offset -= offset_low; |
| 366 const uint16_t offset_high = Utils::High16Bits(offset); // Unsigned. | 366 const uint16_t offset_high = Utils::High16Bits(offset); // Unsigned. |
| 367 if (offset_high != 0) { | 367 if (offset_high != 0) { |
| 368 lui(rd, Immediate(offset_high)); | 368 lui(rd, Immediate(offset_high)); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // Load common VM constants from the thread. This works also in places where | 462 // Load common VM constants from the thread. This works also in places where |
| 463 // no constant pool is set up (e.g. intrinsic code). | 463 // no constant pool is set up (e.g. intrinsic code). |
| 464 if (Thread::CanLoadFromThread(object)) { | 464 if (Thread::CanLoadFromThread(object)) { |
| 465 lw(rd, Address(THR, Thread::OffsetFromThread(object))); | 465 lw(rd, Address(THR, Thread::OffsetFromThread(object))); |
| 466 return; | 466 return; |
| 467 } | 467 } |
| 468 ASSERT(!in_delay_slot_); | 468 ASSERT(!in_delay_slot_); |
| 469 // Smis and VM heap objects are never relocated; do not use object pool. | 469 // Smis and VM heap objects are never relocated; do not use object pool. |
| 470 if (object.IsSmi()) { | 470 if (object.IsSmi()) { |
| 471 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); | 471 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); |
| 472 } else if (object.InVMHeap() || !allow_constant_pool()) { | 472 } else if (object.InVMHeap() || !constant_pool_allowed()) { |
| 473 // Make sure that class CallPattern is able to decode this load immediate. | 473 // Make sure that class CallPattern is able to decode this load immediate. |
| 474 int32_t object_raw = reinterpret_cast<int32_t>(object.raw()); | 474 int32_t object_raw = reinterpret_cast<int32_t>(object.raw()); |
| 475 const uint16_t object_low = Utils::Low16Bits(object_raw); | 475 const uint16_t object_low = Utils::Low16Bits(object_raw); |
| 476 const uint16_t object_high = Utils::High16Bits(object_raw); | 476 const uint16_t object_high = Utils::High16Bits(object_raw); |
| 477 lui(rd, Immediate(object_high)); | 477 lui(rd, Immediate(object_high)); |
| 478 ori(rd, rd, Immediate(object_low)); | 478 ori(rd, rd, Immediate(object_low)); |
| 479 } else { | 479 } else { |
| 480 // Make sure that class CallPattern is able to decode this load from the | 480 // Make sure that class CallPattern is able to decode this load from the |
| 481 // object pool. | 481 // object pool. |
| 482 const int32_t offset = ObjectPool::element_offset( | 482 const int32_t offset = ObjectPool::element_offset( |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1267 Label stop; | 1267 Label stop; |
| 1268 b(&stop); | 1268 b(&stop); |
| 1269 Emit(reinterpret_cast<int32_t>(message)); | 1269 Emit(reinterpret_cast<int32_t>(message)); |
| 1270 Bind(&stop); | 1270 Bind(&stop); |
| 1271 break_(Instr::kStopMessageCode); | 1271 break_(Instr::kStopMessageCode); |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 } // namespace dart | 1274 } // namespace dart |
| 1275 | 1275 |
| 1276 #endif // defined TARGET_ARCH_MIPS | 1276 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |