OLD | NEW |
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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 ClassHeapStats::allocated_since_gc_old_space_offset(); | 950 ClassHeapStats::allocated_since_gc_old_space_offset(); |
951 LoadImmediate(temp_reg, class_table->ClassStatsTableAddress(), pp); | 951 LoadImmediate(temp_reg, class_table->ClassStatsTableAddress(), pp); |
952 ldr(temp_reg, Address(temp_reg)); | 952 ldr(temp_reg, Address(temp_reg)); |
953 AddImmediate(temp_reg, temp_reg, class_offset, pp); | 953 AddImmediate(temp_reg, temp_reg, class_offset, pp); |
954 ldr(TMP, Address(temp_reg, count_field_offset)); | 954 ldr(TMP, Address(temp_reg, count_field_offset)); |
955 AddImmediate(TMP, TMP, 1, pp); | 955 AddImmediate(TMP, TMP, 1, pp); |
956 str(TMP, Address(temp_reg, count_field_offset)); | 956 str(TMP, Address(temp_reg, count_field_offset)); |
957 } | 957 } |
958 } | 958 } |
959 | 959 |
| 960 |
| 961 void Assembler::UpdateAllocationStatsWithSize(intptr_t cid, |
| 962 Register size_reg, |
| 963 Register temp_reg, |
| 964 Register pp, |
| 965 Heap::Space space) { |
| 966 ASSERT(temp_reg != kNoRegister); |
| 967 ASSERT(temp_reg != TMP); |
| 968 ASSERT(cid > 0); |
| 969 Isolate* isolate = Isolate::Current(); |
| 970 ClassTable* class_table = isolate->class_table(); |
| 971 if (cid < kNumPredefinedCids) { |
| 972 const uword class_heap_stats_table_address = |
| 973 class_table->PredefinedClassHeapStatsTableAddress(); |
| 974 const uword class_offset = cid * sizeof(ClassHeapStats); // NOLINT |
| 975 const uword count_field_offset = (space == Heap::kNew) ? |
| 976 ClassHeapStats::allocated_since_gc_new_space_offset() : |
| 977 ClassHeapStats::allocated_since_gc_old_space_offset(); |
| 978 const uword size_field_offset = (space == Heap::kNew) ? |
| 979 ClassHeapStats::allocated_size_since_gc_new_space_offset() : |
| 980 ClassHeapStats::allocated_size_since_gc_old_space_offset(); |
| 981 LoadImmediate(temp_reg, class_heap_stats_table_address + class_offset, pp); |
| 982 const Address& count_address = Address(temp_reg, count_field_offset); |
| 983 const Address& size_address = Address(temp_reg, size_field_offset); |
| 984 ldr(TMP, count_address); |
| 985 AddImmediate(TMP, TMP, 1, pp); |
| 986 str(TMP, count_address); |
| 987 ldr(TMP, size_address); |
| 988 add(TMP, TMP, Operand(size_reg)); |
| 989 str(TMP, size_address); |
| 990 } else { |
| 991 ASSERT(temp_reg != kNoRegister); |
| 992 const uword class_offset = cid * sizeof(ClassHeapStats); // NOLINT |
| 993 const uword count_field_offset = (space == Heap::kNew) ? |
| 994 ClassHeapStats::allocated_since_gc_new_space_offset() : |
| 995 ClassHeapStats::allocated_since_gc_old_space_offset(); |
| 996 const uword size_field_offset = (space == Heap::kNew) ? |
| 997 ClassHeapStats::allocated_size_since_gc_new_space_offset() : |
| 998 ClassHeapStats::allocated_size_since_gc_old_space_offset(); |
| 999 LoadImmediate(temp_reg, class_table->ClassStatsTableAddress(), pp); |
| 1000 ldr(temp_reg, Address(temp_reg)); |
| 1001 AddImmediate(temp_reg, temp_reg, class_offset, pp); |
| 1002 ldr(TMP, Address(temp_reg, count_field_offset)); |
| 1003 AddImmediate(TMP, TMP, 1, pp); |
| 1004 str(TMP, Address(temp_reg, count_field_offset)); |
| 1005 ldr(TMP, Address(temp_reg, size_field_offset)); |
| 1006 add(TMP, TMP, Operand(size_reg)); |
| 1007 str(TMP, Address(temp_reg, size_field_offset)); |
| 1008 } |
| 1009 } |
| 1010 |
960 } // namespace dart | 1011 } // namespace dart |
961 | 1012 |
962 #endif // defined TARGET_ARCH_ARM64 | 1013 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |