Index: runtime/vm/assembler_arm64.cc |
=================================================================== |
--- runtime/vm/assembler_arm64.cc (revision 36461) |
+++ runtime/vm/assembler_arm64.cc (working copy) |
@@ -1227,11 +1227,8 @@ |
void Assembler::UpdateAllocationStats(intptr_t cid, |
- Register temp_reg, |
Register pp, |
Heap::Space space) { |
- ASSERT(temp_reg != kNoRegister); |
- ASSERT(temp_reg != TMP); |
ASSERT(cid > 0); |
Isolate* isolate = Isolate::Current(); |
ClassTable* class_table = isolate->class_table(); |
@@ -1242,34 +1239,30 @@ |
const uword count_field_offset = (space == Heap::kNew) ? |
ClassHeapStats::allocated_since_gc_new_space_offset() : |
ClassHeapStats::allocated_since_gc_old_space_offset(); |
- LoadImmediate(temp_reg, class_heap_stats_table_address + class_offset, pp); |
- const Address& count_address = Address(temp_reg, count_field_offset); |
+ LoadImmediate(TMP2, class_heap_stats_table_address + class_offset, pp); |
+ const Address& count_address = Address(TMP2, count_field_offset); |
ldr(TMP, count_address); |
AddImmediate(TMP, TMP, 1, pp); |
str(TMP, count_address); |
} else { |
- ASSERT(temp_reg != kNoRegister); |
const uword class_offset = cid * sizeof(ClassHeapStats); // NOLINT |
const uword count_field_offset = (space == Heap::kNew) ? |
ClassHeapStats::allocated_since_gc_new_space_offset() : |
ClassHeapStats::allocated_since_gc_old_space_offset(); |
- LoadImmediate(temp_reg, class_table->ClassStatsTableAddress(), pp); |
- ldr(temp_reg, Address(temp_reg)); |
- AddImmediate(temp_reg, temp_reg, class_offset, pp); |
- ldr(TMP, Address(temp_reg, count_field_offset)); |
+ LoadImmediate(TMP2, class_table->ClassStatsTableAddress(), pp); |
+ ldr(TMP, Address(TMP2)); |
+ AddImmediate(TMP2, TMP, class_offset, pp); |
+ ldr(TMP, Address(TMP2, count_field_offset)); |
AddImmediate(TMP, TMP, 1, pp); |
- str(TMP, Address(temp_reg, count_field_offset)); |
+ str(TMP, Address(TMP2, count_field_offset)); |
} |
} |
void Assembler::UpdateAllocationStatsWithSize(intptr_t cid, |
Register size_reg, |
- Register temp_reg, |
Register pp, |
Heap::Space space) { |
- ASSERT(temp_reg != kNoRegister); |
- ASSERT(temp_reg != TMP); |
ASSERT(cid > 0); |
Isolate* isolate = Isolate::Current(); |
ClassTable* class_table = isolate->class_table(); |
@@ -1283,9 +1276,9 @@ |
const uword size_field_offset = (space == Heap::kNew) ? |
ClassHeapStats::allocated_size_since_gc_new_space_offset() : |
ClassHeapStats::allocated_size_since_gc_old_space_offset(); |
- LoadImmediate(temp_reg, class_heap_stats_table_address + class_offset, pp); |
- const Address& count_address = Address(temp_reg, count_field_offset); |
- const Address& size_address = Address(temp_reg, size_field_offset); |
+ LoadImmediate(TMP2, class_heap_stats_table_address + class_offset, pp); |
+ const Address& count_address = Address(TMP2, count_field_offset); |
+ const Address& size_address = Address(TMP2, size_field_offset); |
ldr(TMP, count_address); |
AddImmediate(TMP, TMP, 1, pp); |
str(TMP, count_address); |
@@ -1293,7 +1286,6 @@ |
add(TMP, TMP, Operand(size_reg)); |
str(TMP, size_address); |
} else { |
- ASSERT(temp_reg != kNoRegister); |
const uword class_offset = cid * sizeof(ClassHeapStats); // NOLINT |
const uword count_field_offset = (space == Heap::kNew) ? |
ClassHeapStats::allocated_since_gc_new_space_offset() : |
@@ -1301,15 +1293,15 @@ |
const uword size_field_offset = (space == Heap::kNew) ? |
ClassHeapStats::allocated_size_since_gc_new_space_offset() : |
ClassHeapStats::allocated_size_since_gc_old_space_offset(); |
- LoadImmediate(temp_reg, class_table->ClassStatsTableAddress(), pp); |
- ldr(temp_reg, Address(temp_reg)); |
- AddImmediate(temp_reg, temp_reg, class_offset, pp); |
- ldr(TMP, Address(temp_reg, count_field_offset)); |
+ LoadImmediate(TMP2, class_table->ClassStatsTableAddress(), pp); |
+ ldr(TMP, Address(TMP2)); |
+ AddImmediate(TMP2, TMP, class_offset, pp); |
+ ldr(TMP, Address(TMP2, count_field_offset)); |
AddImmediate(TMP, TMP, 1, pp); |
- str(TMP, Address(temp_reg, count_field_offset)); |
- ldr(TMP, Address(temp_reg, size_field_offset)); |
+ str(TMP, Address(TMP2, count_field_offset)); |
+ ldr(TMP, Address(TMP2, size_field_offset)); |
add(TMP, TMP, Operand(size_reg)); |
- str(TMP, Address(temp_reg, size_field_offset)); |
+ str(TMP, Address(TMP2, size_field_offset)); |
} |
} |
@@ -1317,7 +1309,6 @@ |
void Assembler::TryAllocate(const Class& cls, |
Label* failure, |
Register instance_reg, |
- Register temp_reg, |
Register pp) { |
ASSERT(failure != NULL); |
if (FLAG_inline_alloc) { |
@@ -1342,7 +1333,7 @@ |
ASSERT(instance_size >= kHeapObjectTag); |
AddImmediate( |
instance_reg, instance_reg, -instance_size + kHeapObjectTag, pp); |
- UpdateAllocationStats(cls.id(), temp_reg, pp); |
+ UpdateAllocationStats(cls.id(), pp); |
uword tags = 0; |
tags = RawObject::SizeTag::update(instance_size, tags); |