Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(866)

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 2980033002: Moves the top_ and end_ words of the Scavenger into mutator thread. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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).
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698