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

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

Issue 251083007: Removes loads from PP from stubs on arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 } else { 604 } else {
605 LoadImmediate(TMP2, imm, pp); 605 LoadImmediate(TMP2, imm, pp);
606 cmp(rn, Operand(TMP2)); 606 cmp(rn, Operand(TMP2));
607 } 607 }
608 } 608 }
609 609
610 610
611 void Assembler::LoadFromOffset( 611 void Assembler::LoadFromOffset(
612 Register dest, Register base, int32_t offset, OperandSize sz) { 612 Register dest, Register base, int32_t offset, OperandSize sz) {
613 ASSERT(base != TMP2); 613 ASSERT(base != TMP2);
614 if (Address::CanHoldOffset(offset)) { 614 if (Address::CanHoldOffset(offset, Address::Offset, sz)) {
615 ldr(dest, Address(base, offset), sz); 615 ldr(dest, Address(base, offset, Address::Offset, sz), sz);
616 } else { 616 } else {
617 // Since offset is 32-bits, it won't be loaded from the pool. 617 // Since offset is 32-bits, it won't be loaded from the pool.
618 AddImmediate(TMP2, base, offset, kNoRegister); 618 AddImmediate(TMP2, base, offset, kNoRegister);
619 ldr(dest, Address(TMP2), sz); 619 ldr(dest, Address(TMP2), sz);
620 } 620 }
621 } 621 }
622 622
623 623
624 void Assembler::StoreToOffset( 624 void Assembler::StoreToOffset(
625 Register src, Register base, int32_t offset, OperandSize sz) { 625 Register src, Register base, int32_t offset, OperandSize sz) {
626 ASSERT(src != TMP2); 626 ASSERT(src != TMP2);
627 ASSERT(base != TMP2); 627 ASSERT(base != TMP2);
628 if (Address::CanHoldOffset(offset)) { 628 if (Address::CanHoldOffset(offset, Address::Offset, sz)) {
629 str(src, Address(base, offset), sz); 629 str(src, Address(base, offset, Address::Offset, sz), sz);
630 } else { 630 } else {
631 // Since offset is 32-bits, it won't be loaded from the pool. 631 // Since offset is 32-bits, it won't be loaded from the pool.
632 AddImmediate(TMP2, base, offset, kNoRegister); 632 AddImmediate(TMP2, base, offset, kNoRegister);
633 str(src, Address(TMP2), sz); 633 str(src, Address(TMP2), sz);
634 } 634 }
635 } 635 }
636 636
637 637
638 // Store into object. 638 // Store into object.
639 // Preserves object and value registers. 639 // Preserves object and value registers.
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 void Assembler::LeaveStubFrame() { 916 void Assembler::LeaveStubFrame() {
917 // Restore and untag PP. 917 // Restore and untag PP.
918 LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize); 918 LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize);
919 sub(PP, PP, Operand(kHeapObjectTag)); 919 sub(PP, PP, Operand(kHeapObjectTag));
920 LeaveFrame(); 920 LeaveFrame();
921 } 921 }
922 922
923 923
924 void Assembler::UpdateAllocationStats(intptr_t cid, 924 void Assembler::UpdateAllocationStats(intptr_t cid,
925 Register temp_reg, 925 Register temp_reg,
926 Register pp,
926 Heap::Space space) { 927 Heap::Space space) {
927 ASSERT(temp_reg != kNoRegister); 928 ASSERT(temp_reg != kNoRegister);
928 ASSERT(temp_reg != TMP); 929 ASSERT(temp_reg != TMP);
929 ASSERT(cid > 0); 930 ASSERT(cid > 0);
930 Isolate* isolate = Isolate::Current(); 931 Isolate* isolate = Isolate::Current();
931 ClassTable* class_table = isolate->class_table(); 932 ClassTable* class_table = isolate->class_table();
932 if (cid < kNumPredefinedCids) { 933 if (cid < kNumPredefinedCids) {
933 const uword class_heap_stats_table_address = 934 const uword class_heap_stats_table_address =
934 class_table->PredefinedClassHeapStatsTableAddress(); 935 class_table->PredefinedClassHeapStatsTableAddress();
935 const uword class_offset = cid * sizeof(ClassHeapStats); // NOLINT 936 const uword class_offset = cid * sizeof(ClassHeapStats); // NOLINT
936 const uword count_field_offset = (space == Heap::kNew) ? 937 const uword count_field_offset = (space == Heap::kNew) ?
937 ClassHeapStats::allocated_since_gc_new_space_offset() : 938 ClassHeapStats::allocated_since_gc_new_space_offset() :
938 ClassHeapStats::allocated_since_gc_old_space_offset(); 939 ClassHeapStats::allocated_since_gc_old_space_offset();
939 LoadImmediate(temp_reg, class_heap_stats_table_address + class_offset, PP); 940 LoadImmediate(temp_reg, class_heap_stats_table_address + class_offset, pp);
940 const Address& count_address = Address(temp_reg, count_field_offset); 941 const Address& count_address = Address(temp_reg, count_field_offset);
941 ldr(TMP, count_address); 942 ldr(TMP, count_address);
942 AddImmediate(TMP, TMP, 1, PP); 943 AddImmediate(TMP, TMP, 1, pp);
943 str(TMP, count_address); 944 str(TMP, count_address);
944 } else { 945 } else {
945 ASSERT(temp_reg != kNoRegister); 946 ASSERT(temp_reg != kNoRegister);
946 const uword class_offset = cid * sizeof(ClassHeapStats); // NOLINT 947 const uword class_offset = cid * sizeof(ClassHeapStats); // NOLINT
947 const uword count_field_offset = (space == Heap::kNew) ? 948 const uword count_field_offset = (space == Heap::kNew) ?
948 ClassHeapStats::allocated_since_gc_new_space_offset() : 949 ClassHeapStats::allocated_since_gc_new_space_offset() :
949 ClassHeapStats::allocated_since_gc_old_space_offset(); 950 ClassHeapStats::allocated_since_gc_old_space_offset();
950 LoadImmediate(temp_reg, class_table->ClassStatsTableAddress(), PP); 951 LoadImmediate(temp_reg, class_table->ClassStatsTableAddress(), pp);
951 ldr(temp_reg, Address(temp_reg)); 952 ldr(temp_reg, Address(temp_reg));
952 AddImmediate(temp_reg, temp_reg, class_offset, PP); 953 AddImmediate(temp_reg, temp_reg, class_offset, pp);
953 ldr(TMP, Address(temp_reg, count_field_offset)); 954 ldr(TMP, Address(temp_reg, count_field_offset));
954 AddImmediate(TMP, TMP, 1, PP); 955 AddImmediate(TMP, TMP, 1, pp);
955 str(TMP, Address(temp_reg, count_field_offset)); 956 str(TMP, Address(temp_reg, count_field_offset));
956 } 957 }
957 } 958 }
958 959
959 } // namespace dart 960 } // namespace dart
960 961
961 #endif // defined TARGET_ARCH_ARM64 962 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698