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

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 2951333002: Moves the top_ and end_ words of the Scavenger into mutator thread. (Closed)
Patch Set: Address comments from CL 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
Index: runtime/vm/stub_code_ia32.cc
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index 240d1fd19025736ee9315d29a9c07ba5141e1557..c65a21e5280ad194acbb5de700df2247663de0f3 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -621,8 +621,7 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
const intptr_t cid = kArrayCid;
Heap::Space space = Heap::kNew;
- __ movl(EDI, Address(THR, Thread::heap_offset()));
- __ movl(EAX, Address(EDI, Heap::TopOffset(space)));
+ __ movl(EAX, Address(THR, Thread::top_offset()));
__ addl(EBX, EAX);
__ j(CARRY, &slow_case);
@@ -632,12 +631,12 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
// 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));
@@ -848,14 +847,13 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
// 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)));
+ __ 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 {
@@ -872,7 +870,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));
@@ -1058,20 +1056,19 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
// 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)));
+ __ 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).

Powered by Google App Engine
This is Rietveld 408576698