| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 } else { | 471 } else { |
| 472 // Make sure that class CallPattern is able to decode this load from the | 472 // Make sure that class CallPattern is able to decode this load from the |
| 473 // object pool. | 473 // object pool. |
| 474 const int32_t offset = | 474 const int32_t offset = |
| 475 ObjectPool::element_offset(object_pool_wrapper_.FindObject(object)); | 475 ObjectPool::element_offset(object_pool_wrapper_.FindObject(object)); |
| 476 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag); | 476 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag); |
| 477 } | 477 } |
| 478 } | 478 } |
| 479 | 479 |
| 480 | 480 |
| 481 void Assembler::LoadUniqueObject(Register rd, const Object& object) { |
| 482 ASSERT(!in_delay_slot_); |
| 483 // Smis and VM heap objects are never relocated; do not use object pool. |
| 484 if (object.IsSmi()) { |
| 485 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); |
| 486 } else if (object.InVMHeap() || !allow_constant_pool()) { |
| 487 // Make sure that class CallPattern is able to decode this load immediate. |
| 488 int32_t object_raw = reinterpret_cast<int32_t>(object.raw()); |
| 489 const uint16_t object_low = Utils::Low16Bits(object_raw); |
| 490 const uint16_t object_high = Utils::High16Bits(object_raw); |
| 491 lui(rd, Immediate(object_high)); |
| 492 ori(rd, rd, Immediate(object_low)); |
| 493 } else { |
| 494 // Make sure that class CallPattern is able to decode this load from the |
| 495 // object pool. |
| 496 const int32_t offset = |
| 497 ObjectPool::element_offset(object_pool_wrapper_.AddObject(object)); |
| 498 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag); |
| 499 } |
| 500 } |
| 501 |
| 502 |
| 481 void Assembler::LoadExternalLabel(Register rd, | 503 void Assembler::LoadExternalLabel(Register rd, |
| 482 const ExternalLabel* label, | 504 const ExternalLabel* label, |
| 483 Patchability patchable) { | 505 Patchability patchable) { |
| 484 const int32_t offset = ObjectPool::element_offset( | 506 const int32_t offset = ObjectPool::element_offset( |
| 485 object_pool_wrapper_.FindExternalLabel(label, patchable)); | 507 object_pool_wrapper_.FindExternalLabel(label, patchable)); |
| 486 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag); | 508 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag); |
| 487 } | 509 } |
| 488 | 510 |
| 489 | 511 |
| 490 void Assembler::PushObject(const Object& object) { | 512 void Assembler::PushObject(const Object& object) { |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 Label stop; | 1245 Label stop; |
| 1224 b(&stop); | 1246 b(&stop); |
| 1225 Emit(reinterpret_cast<int32_t>(message)); | 1247 Emit(reinterpret_cast<int32_t>(message)); |
| 1226 Bind(&stop); | 1248 Bind(&stop); |
| 1227 break_(Instr::kStopMessageCode); | 1249 break_(Instr::kStopMessageCode); |
| 1228 } | 1250 } |
| 1229 | 1251 |
| 1230 } // namespace dart | 1252 } // namespace dart |
| 1231 | 1253 |
| 1232 #endif // defined TARGET_ARCH_MIPS | 1254 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |