Index: runtime/vm/stub_code_ia32.cc |
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc |
index 1d6ee7c81e4a2eb0c6b96655e0517ed3ca2e1110..5fc60244de372dfc116568b4c057e5c867b1b0f3 100644 |
--- a/runtime/vm/stub_code_ia32.cc |
+++ b/runtime/vm/stub_code_ia32.cc |
@@ -601,24 +601,22 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) { |
// EBX: allocation size. |
const intptr_t cid = kArrayCid; |
- Heap::Space space = Heap::kNew; |
- __ movl(EDI, Address(THR, Thread::heap_offset())); |
- __ movl(EAX, Address(EDI, Heap::TopOffset(space))); |
+ NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); |
+ __ movl(EAX, Address(THR, Thread::top_offset())); |
__ addl(EBX, EAX); |
__ j(CARRY, &slow_case); |
// Check if the allocation fits into the remaining space. |
// EAX: potential new object start. |
// EBX: potential next object start. |
- // EDI: heap. |
// ECX: array element type. |
// EDX: array length as Smi). |
- __ cmpl(EBX, Address(EDI, Heap::EndOffset(space))); |
+ __ cmpl(EBX, Address(THR, Thread::end_offset())); |
__ j(ABOVE_EQUAL, &slow_case); |
// Successfully allocated the object(s), now update top to point to |
// next object start and initialize the object. |
- __ movl(Address(EDI, Heap::TopOffset(space)), EBX); |
+ __ movl(Address(THR, Thread::top_offset()), EBX); |
__ subl(EBX, EAX); |
__ addl(EAX, Immediate(kHeapObjectTag)); |
NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, EBX, EDI, space)); |
@@ -826,15 +824,14 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) { |
// Now allocate the object. |
// EDX: number of context variables. |
const intptr_t cid = kContextCid; |
- Heap::Space space = Heap::kNew; |
- __ movl(ECX, Address(THR, Thread::heap_offset())); |
- __ movl(EAX, Address(ECX, Heap::TopOffset(space))); |
+ NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); |
+ __ movl(EAX, Address(THR, Thread::top_offset())); |
__ addl(EBX, EAX); |
// Check if the allocation fits into the remaining space. |
// EAX: potential new object. |
// EBX: potential next object start. |
// EDX: number of context variables. |
- __ cmpl(EBX, Address(ECX, Heap::EndOffset(space))); |
+ __ cmpl(EBX, Address(THR, Thread::end_offset())); |
if (FLAG_use_slow_path) { |
__ jmp(&slow_case); |
} else { |
@@ -851,7 +848,7 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) { |
// EAX: new object. |
// EBX: next object start. |
// EDX: number of context variables. |
- __ movl(Address(ECX, Heap::TopOffset(space)), EBX); |
+ __ movl(Address(THR, Thread::top_offset()), EBX); |
// EBX: Size of allocation in bytes. |
__ subl(EBX, EAX); |
__ addl(EAX, Immediate(kHeapObjectTag)); |
@@ -1034,21 +1031,19 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler, |
// Allocate the object and update top to point to |
// next object start and initialize the allocated object. |
// EDX: instantiated type arguments (if is_cls_parameterized). |
- Heap::Space space = Heap::kNew; |
- __ movl(EDI, Address(THR, Thread::heap_offset())); |
- __ movl(EAX, Address(EDI, Heap::TopOffset(space))); |
+ NOT_IN_PRODUCT(Heap::Space space = Heap::kNew); |
+ __ movl(EAX, Address(THR, Thread::top_offset())); |
__ leal(EBX, Address(EAX, instance_size)); |
// Check if the allocation fits into the remaining space. |
// EAX: potential new object start. |
// EBX: potential next object start. |
- // EDI: heap. |
- __ cmpl(EBX, Address(EDI, Heap::EndOffset(space))); |
+ __ cmpl(EBX, Address(THR, Thread::end_offset())); |
if (FLAG_use_slow_path) { |
__ jmp(&slow_case); |
} else { |
__ j(ABOVE_EQUAL, &slow_case); |
} |
- __ movl(Address(EDI, Heap::TopOffset(space)), EBX); |
+ __ movl(Address(THR, Thread::top_offset()), EBX); |
NOT_IN_PRODUCT(__ UpdateAllocationStats(cls.id(), ECX, space)); |
// EAX: new object start (untagged). |