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

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

Issue 338353005: Fixes field access on MIPS for classes with many fields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/flow_graph_compiler_mips.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" 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/longjump.h" 9 #include "vm/longjump.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 // Restore T0. 581 // Restore T0.
582 lw(T0, Address(SP, 1 * kWordSize)); 582 lw(T0, Address(SP, 1 * kWordSize));
583 addiu(SP, SP, Immediate(2 * kWordSize)); 583 addiu(SP, SP, Immediate(2 * kWordSize));
584 } else { 584 } else {
585 addiu(SP, SP, Immediate(1 * kWordSize)); 585 addiu(SP, SP, Immediate(1 * kWordSize));
586 } 586 }
587 Bind(&done); 587 Bind(&done);
588 } 588 }
589 589
590 590
591 void Assembler::StoreIntoObjectOffset(Register object,
592 int32_t offset,
593 Register value,
594 bool can_value_be_smi) {
595 if (Address::CanHoldOffset(offset - kHeapObjectTag)) {
596 StoreIntoObject(
597 object, FieldAddress(object, offset), value, can_value_be_smi);
598 } else {
599 AddImmediate(TMP, object, offset - kHeapObjectTag);
600 StoreIntoObject(object, Address(TMP), value, can_value_be_smi);
601 }
602 }
603
604
591 void Assembler::StoreIntoObjectNoBarrier(Register object, 605 void Assembler::StoreIntoObjectNoBarrier(Register object,
592 const Address& dest, 606 const Address& dest,
593 Register value) { 607 Register value) {
594 ASSERT(!in_delay_slot_); 608 ASSERT(!in_delay_slot_);
595 sw(value, dest); 609 sw(value, dest);
596 #if defined(DEBUG) 610 #if defined(DEBUG)
597 Label done; 611 Label done;
598 StoreIntoObjectFilter(object, value, &done); 612 StoreIntoObjectFilter(object, value, &done);
599 Stop("Store buffer update is required"); 613 Stop("Store buffer update is required");
600 Bind(&done); 614 Bind(&done);
601 #endif // defined(DEBUG) 615 #endif // defined(DEBUG)
602 // No store buffer update. 616 // No store buffer update.
603 } 617 }
604 618
605 619
620 void Assembler::StoreIntoObjectNoBarrierOffset(Register object,
621 int32_t offset,
622 Register value) {
623 if (Address::CanHoldOffset(offset - kHeapObjectTag)) {
624 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value);
625 } else {
626 AddImmediate(TMP, object, offset - kHeapObjectTag);
627 StoreIntoObjectNoBarrier(object, Address(TMP), value);
628 }
629 }
630
631
606 void Assembler::StoreIntoObjectNoBarrier(Register object, 632 void Assembler::StoreIntoObjectNoBarrier(Register object,
607 const Address& dest, 633 const Address& dest,
608 const Object& value) { 634 const Object& value) {
609 ASSERT(!in_delay_slot_); 635 ASSERT(!in_delay_slot_);
610 ASSERT(value.IsSmi() || value.InVMHeap() || 636 ASSERT(value.IsSmi() || value.InVMHeap() ||
611 (value.IsOld() && value.IsNotTemporaryScopedHandle())); 637 (value.IsOld() && value.IsNotTemporaryScopedHandle()));
612 // No store buffer update. 638 // No store buffer update.
613 LoadObject(TMP, value); 639 LoadObject(TMP, value);
614 sw(TMP, dest); 640 sw(TMP, dest);
615 } 641 }
616 642
617 643
644 void Assembler::StoreIntoObjectNoBarrierOffset(Register object,
645 int32_t offset,
646 const Object& value) {
647 if (Address::CanHoldOffset(offset - kHeapObjectTag)) {
648 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value);
649 } else {
650 AddImmediate(TMP, object, offset - kHeapObjectTag);
651 StoreIntoObjectNoBarrier(object, Address(TMP), value);
652 }
653 }
654
655
618 void Assembler::LoadClassId(Register result, Register object) { 656 void Assembler::LoadClassId(Register result, Register object) {
619 ASSERT(RawObject::kClassIdTagPos == 16); 657 ASSERT(RawObject::kClassIdTagPos == 16);
620 ASSERT(RawObject::kClassIdTagSize == 16); 658 ASSERT(RawObject::kClassIdTagSize == 16);
621 const intptr_t class_id_offset = Object::tags_offset() + 659 const intptr_t class_id_offset = Object::tags_offset() +
622 RawObject::kClassIdTagPos / kBitsPerByte; 660 RawObject::kClassIdTagPos / kBitsPerByte;
623 lhu(result, FieldAddress(object, class_id_offset)); 661 lhu(result, FieldAddress(object, class_id_offset));
624 } 662 }
625 663
626 664
627 void Assembler::LoadClassById(Register result, Register class_id) { 665 void Assembler::LoadClassById(Register result, Register class_id) {
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 Emit(reinterpret_cast<int32_t>(message)); 1141 Emit(reinterpret_cast<int32_t>(message));
1104 Bind(&msg); 1142 Bind(&msg);
1105 break_(Instr::kMsgMessageCode); 1143 break_(Instr::kMsgMessageCode);
1106 } 1144 }
1107 #endif 1145 #endif
1108 } 1146 }
1109 1147
1110 } // namespace dart 1148 } // namespace dart
1111 1149
1112 #endif // defined TARGET_ARCH_MIPS 1150 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698