Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: runtime/vm/assembler_mips.cc

Issue 1227733002: VM: Load common VM constants from Thread on ARM and MIPS. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: added back assertion Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()) {
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));
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698