| Index: runtime/vm/stub_code_ia32.cc
|
| diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
|
| index 3addb330fba30198b9974b71d3897ad10c41b81e..32505f36de9041d461022829e17b5e69d6cb4769 100644
|
| --- a/runtime/vm/stub_code_ia32.cc
|
| +++ b/runtime/vm/stub_code_ia32.cc
|
| @@ -623,7 +623,7 @@ void StubCode::GeneratePatchableAllocateArrayStub(Assembler* assembler,
|
|
|
| Heap* heap = isolate->heap();
|
| const intptr_t cid = kArrayCid;
|
| - Heap::Space space = heap->SpaceForAllocation(cid);
|
| + Heap::Space space = Heap::SpaceForAllocation(cid);
|
| __ movl(EAX, Address::Absolute(heap->TopAddress(space)));
|
| __ movl(EBX, EAX);
|
|
|
| @@ -841,8 +841,6 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
|
| Immediate(reinterpret_cast<intptr_t>(Object::null()));
|
| if (FLAG_inline_alloc) {
|
| Label slow_case;
|
| - Isolate* isolate = Isolate::Current();
|
| - Heap* heap = isolate->heap();
|
| // First compute the rounded instance size.
|
| // EDX: number of context variables.
|
| intptr_t fixed_size = (sizeof(RawContext) + kObjectAlignment - 1);
|
| @@ -852,14 +850,16 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
|
| // Now allocate the object.
|
| // EDX: number of context variables.
|
| const intptr_t cid = kContextCid;
|
| - Heap::Space space = heap->SpaceForAllocation(cid);
|
| - __ movl(EAX, Address::Absolute(heap->TopAddress(space)));
|
| + Heap::Space space = Heap::SpaceForAllocation(cid);
|
| + __ LoadIsolate(ECX);
|
| + __ movl(ECX, Address(ECX, Isolate::heap_offset()));
|
| + __ movl(EAX, Address(ECX, Heap::TopOffset(space)));
|
| __ 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::Absolute(heap->EndAddress(space)));
|
| + __ cmpl(EBX, Address(ECX, Heap::EndOffset(space)));
|
| if (FLAG_use_slow_path) {
|
| __ jmp(&slow_case);
|
| } else {
|
| @@ -876,11 +876,13 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
|
| // EAX: new object.
|
| // EBX: next object start.
|
| // EDX: number of context variables.
|
| - __ movl(Address::Absolute(heap->TopAddress(space)), EBX);
|
| + __ movl(Address(ECX, Heap::TopOffset(space)), EBX);
|
| __ addl(EAX, Immediate(kHeapObjectTag));
|
| // EBX: Size of allocation in bytes.
|
| __ subl(EBX, EAX);
|
| - __ UpdateAllocationStatsWithSize(cid, EBX, kNoRegister, space);
|
| + // Generate isolate-independent code to allow sharing between isolates.
|
| + __ UpdateAllocationStatsWithSize(cid, EBX, EDI, space,
|
| + /* inline_isolate = */ false);
|
|
|
| // Calculate the size tag.
|
| // EAX: new object.
|
| @@ -1065,7 +1067,7 @@ void StubCode::GenerateAllocationStubForClass(
|
| // next object start and initialize the allocated object.
|
| // EDX: instantiated type arguments (if is_cls_parameterized).
|
| Heap* heap = Isolate::Current()->heap();
|
| - Heap::Space space = heap->SpaceForAllocation(cls.id());
|
| + Heap::Space space = Heap::SpaceForAllocation(cls.id());
|
| __ movl(EAX, Address::Absolute(heap->TopAddress(space)));
|
| __ leal(EBX, Address(EAX, instance_size));
|
| // Check if the allocation fits into the remaining space.
|
|
|