Chromium Code Reviews| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 xor_(ro, rd, rs); | 452 xor_(ro, rd, rs); |
| 453 xor_(TMP, rs, rt); | 453 xor_(TMP, rs, rt); |
| 454 and_(ro, TMP, ro); | 454 and_(ro, TMP, ro); |
| 455 } | 455 } |
| 456 } | 456 } |
| 457 | 457 |
| 458 | 458 |
| 459 void Assembler::LoadObjectHelper(Register rd, | 459 void Assembler::LoadObjectHelper(Register rd, |
| 460 const Object& object, | 460 const Object& object, |
| 461 bool is_unique) { | 461 bool is_unique) { |
| 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). | |
| 464 if (Thread::CanLoadFromThread(object)) { | |
| 465 lw(rd, Address(THR, Thread::OffsetFromThread(object))); | |
| 466 return; | |
| 467 } | |
| 462 ASSERT(!in_delay_slot_); | 468 ASSERT(!in_delay_slot_); |
| 463 // 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. |
| 464 if (object.IsSmi()) { | 470 if (object.IsSmi()) { |
| 465 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); | 471 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); |
| 466 } else if (object.InVMHeap() || !allow_constant_pool()) { | 472 } else if (object.InVMHeap() || !allow_constant_pool()) { |
|
koda
2015/07/08 14:50:34
Oh, we actually have the check here, so I guess it
Florian Schneider
2015/07/09 08:50:36
Done.
| |
| 467 // 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. |
| 468 int32_t object_raw = reinterpret_cast<int32_t>(object.raw()); | 474 int32_t object_raw = reinterpret_cast<int32_t>(object.raw()); |
| 469 const uint16_t object_low = Utils::Low16Bits(object_raw); | 475 const uint16_t object_low = Utils::Low16Bits(object_raw); |
| 470 const uint16_t object_high = Utils::High16Bits(object_raw); | 476 const uint16_t object_high = Utils::High16Bits(object_raw); |
| 471 lui(rd, Immediate(object_high)); | 477 lui(rd, Immediate(object_high)); |
| 472 ori(rd, rd, Immediate(object_low)); | 478 ori(rd, rd, Immediate(object_low)); |
| 473 } else { | 479 } else { |
| 474 // 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 |
| 475 // object pool. | 481 // object pool. |
| 476 const int32_t offset = ObjectPool::element_offset( | 482 const int32_t offset = ObjectPool::element_offset( |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 561 // Preserve T0. | 567 // Preserve T0. |
| 562 addiu(SP, SP, Immediate(-2 * kWordSize)); | 568 addiu(SP, SP, Immediate(-2 * kWordSize)); |
| 563 sw(T0, Address(SP, 1 * kWordSize)); | 569 sw(T0, Address(SP, 1 * kWordSize)); |
| 564 } else { | 570 } else { |
| 565 addiu(SP, SP, Immediate(-1 * kWordSize)); | 571 addiu(SP, SP, Immediate(-1 * kWordSize)); |
| 566 } | 572 } |
| 567 sw(RA, Address(SP, 0 * kWordSize)); | 573 sw(RA, Address(SP, 0 * kWordSize)); |
| 568 if (object != T0) { | 574 if (object != T0) { |
| 569 mov(T0, object); | 575 mov(T0, object); |
| 570 } | 576 } |
| 571 StubCode* stub_code = Isolate::Current()->stub_code(); | 577 lw(T9, Address(THR, Thread::update_store_buffer_entry_point_offset())); |
| 572 BranchLink(&stub_code->UpdateStoreBufferLabel()); | 578 jalr(T9); |
| 573 lw(RA, Address(SP, 0 * kWordSize)); | 579 lw(RA, Address(SP, 0 * kWordSize)); |
| 574 if (value != T0) { | 580 if (value != T0) { |
| 575 // Restore T0. | 581 // Restore T0. |
| 576 lw(T0, Address(SP, 1 * kWordSize)); | 582 lw(T0, Address(SP, 1 * kWordSize)); |
| 577 addiu(SP, SP, Immediate(2 * kWordSize)); | 583 addiu(SP, SP, Immediate(2 * kWordSize)); |
| 578 } else { | 584 } else { |
| 579 addiu(SP, SP, Immediate(1 * kWordSize)); | 585 addiu(SP, SP, Immediate(1 * kWordSize)); |
| 580 } | 586 } |
| 581 Bind(&done); | 587 Bind(&done); |
| 582 } | 588 } |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1236 Label stop; | 1242 Label stop; |
| 1237 b(&stop); | 1243 b(&stop); |
| 1238 Emit(reinterpret_cast<int32_t>(message)); | 1244 Emit(reinterpret_cast<int32_t>(message)); |
| 1239 Bind(&stop); | 1245 Bind(&stop); |
| 1240 break_(Instr::kStopMessageCode); | 1246 break_(Instr::kStopMessageCode); |
| 1241 } | 1247 } |
| 1242 | 1248 |
| 1243 } // namespace dart | 1249 } // namespace dart |
| 1244 | 1250 |
| 1245 #endif // defined TARGET_ARCH_MIPS | 1251 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |