| 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..12dcee9ad56c358420465658671a63bfb95093f9 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.
|
| + __ movl(EDI, EBX);
|
| + __ subl(EDI, EAX);
|
| + __ UpdateAllocationStatsWithSize(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.
|
| + __ subl(EBX, EAX);
|
| + __ UpdateAllocationStatsWithSize(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);
|
| + __ UpdateAllocationStats(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.
|
| + __ UpdateAllocationStatsWithSize(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);
|
|
|
|
|