Index: runtime/vm/assembler_arm.cc |
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc |
index 2ddf07cabf435c09e468409aa7f02e2b98a799f2..6ae73b14040933dd1bbf7f00e21bfd922104d0e1 100644 |
--- a/runtime/vm/assembler_arm.cc |
+++ b/runtime/vm/assembler_arm.cc |
@@ -3146,23 +3146,24 @@ void Assembler::TryAllocate(const Class& cls, |
Register temp_reg) { |
ASSERT(failure != NULL); |
if (FLAG_inline_alloc) { |
- Heap* heap = Isolate::Current()->heap(); |
+ ASSERT(instance_reg != temp_reg); |
+ ASSERT(temp_reg != IP); |
const intptr_t instance_size = cls.instance_size(); |
- LoadImmediate(instance_reg, heap->TopAddress()); |
- ldr(instance_reg, Address(instance_reg, 0)); |
+ |
+ LoadImmediate(temp_reg, Isolate::Current()->heap()->NewSpaceAddress()); |
+ |
+ ldr(instance_reg, Address(temp_reg, Scavenger::top_offset())); |
AddImmediate(instance_reg, instance_size); |
// instance_reg: potential next object start. |
- LoadImmediate(IP, heap->EndAddress()); |
- ldr(IP, Address(IP, 0)); |
+ ldr(IP, Address(temp_reg, Scavenger::end_offset())); |
cmp(IP, Operand(instance_reg)); |
// fail if heap end unsigned less than or equal to instance_reg. |
b(failure, LS); |
// Successfully allocated the object, now update top to point to |
// next object start and store the class in the class field of object. |
- LoadImmediate(IP, heap->TopAddress()); |
- str(instance_reg, Address(IP, 0)); |
+ str(instance_reg, Address(temp_reg, Scavenger::top_offset())); |
ASSERT(instance_size >= kHeapObjectTag); |
AddImmediate(instance_reg, -instance_size + kHeapObjectTag); |