Index: runtime/vm/stub_code_ia32.cc |
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc |
index 49df45c1b5d515be4b3c0bb1cbaf6d07c7798346..491f10d6c68559952a375aa3f30a4a2c302967ab 100644 |
--- a/runtime/vm/stub_code_ia32.cc |
+++ b/runtime/vm/stub_code_ia32.cc |
@@ -588,6 +588,10 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) { |
// EDI: Points to new space object. |
__ movl(Address(EDI, Scavenger::top_offset()), EBX); |
__ addl(EAX, Immediate(kHeapObjectTag)); |
+ // EDI: Size of allocation in bytes. |
Ivan Posva
2013/12/12 13:53:24
At this point EDI does not contain the size of the
|
+ __ movl(EDI, EBX); |
+ __ subl(EDI, EAX); |
+ __ BumpAllocationCount(Heap::kNew, kArrayCid, EDI, kNoRegister); |
// EAX: new object start as a tagged pointer. |
// EBX: new object end address. |
@@ -930,6 +934,9 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) { |
// EDX: number of context variables. |
__ movl(Address::Absolute(heap->TopAddress()), EBX); |
__ addl(EAX, Immediate(kHeapObjectTag)); |
+ // EBX: Size of allocation in bytes. |
Ivan Posva
2013/12/12 13:53:24
ditto
|
+ __ subl(EBX, EAX); |
+ __ BumpAllocationCount(Heap::kNew, context_class.id(), EBX, kNoRegister); |
// Calculate the size tag. |
// EAX: new object. |
@@ -1131,12 +1138,13 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler, |
if (FLAG_use_slow_path) { |
__ jmp(&slow_case); |
} else { |
- __ j(ABOVE_EQUAL, &slow_case, Assembler::kNearJump); |
+ __ 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::Absolute(heap->TopAddress()), EBX); |
+ __ BumpAllocationCount(Heap::kNew, cls.id(), EDI); |
if (is_cls_parameterized) { |
// Initialize the type arguments field in the object. |
@@ -1301,6 +1309,10 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler, |
// Successfully allocated the object, now update top to point to |
// next object start and initialize the object. |
__ movl(Address::Absolute(heap->TopAddress()), EBX); |
+ // EBX: Size of allocation in bytes. |
+ __ subl(EBX, EAX); |
+ // EDX: Clobbered. |
Ivan Posva
2013/12/12 13:53:24
This should not be necessary if the list of live r
|
+ __ BumpAllocationCount(Heap::kNew, cls.id(), EBX, EDX); |
// EAX: new closure object. |
// ECX: new context object (only if is_implicit_closure). |
@@ -1313,7 +1325,6 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler, |
// Initialize the function field in the object. |
// EAX: new closure object. |
// ECX: new context object (only if is_implicit_closure). |
- // EBX: next object start. |
__ LoadObject(EDX, func); // Load function of closure to be allocated. |
__ movl(Address(EAX, Closure::function_offset()), EDX); |