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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 10450014: Request for comments on overall approach. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix scavenger and freelist handling Created 8 years, 7 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
« runtime/vm/raw_object.cc ('K') | « runtime/vm/stub_code_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 2858eebb3a29754161250ba2d8c86cbdea5a4687..8cdba5d3ad5eed34fe91362570472bfd14a0172c 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -294,7 +294,7 @@ static void MegamorphicLookup(Assembler* assembler) {
__ j(EQUAL, &null_receiver, Assembler::kNearJump);
__ testq(RAX, Immediate(kSmiTagMask));
__ j(ZERO, &smi_receiver, Assembler::kNearJump);
- __ movq(RAX, FieldAddress(RAX, Object::class_offset()));
+ __ GetClassOf(RAX, RAX);
__ jmp(&class_in_rax, Assembler::kNearJump);
__ Bind(&smi_receiver);
// For Smis we need to get the class from the isolate.
@@ -665,11 +665,6 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
// Set the length field.
__ StoreIntoObject(RAX, FieldAddress(RAX, Array::length_offset()), R10);
- // Store class value for array.
- __ movq(RBX, FieldAddress(CTX, Context::isolate_offset()));
- __ movq(RBX, Address(RBX, Isolate::object_store_offset()));
- __ movq(RBX, Address(RBX, ObjectStore::array_class_offset()));
- __ StoreIntoObject(RAX, FieldAddress(RAX, Array::class_offset()), RBX);
// Calculate the size tag.
// RAX: new object start as a tagged pointer.
// R12: new object end address.
@@ -755,7 +750,7 @@ void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
__ j(ZERO, &not_closure, Assembler::kNearJump); // Not a closure, but a smi.
// Verify that the class of the object is a closure class by checking that
// class.signature_function() is not null.
- __ movq(RAX, FieldAddress(R13, Object::class_offset()));
+ __ GetClassOf(RAX, R13);
__ movq(RAX, FieldAddress(RAX, Class::signature_function_offset()));
__ cmpq(RAX, raw_null);
// Actual class is not a closure class.
@@ -990,13 +985,6 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
__ movq(Address(RDI, 0), R13);
__ addq(RAX, Immediate(kHeapObjectTag));
- // Initialize the class field in the context object.
- // RAX: new object.
- // R10: number of context variables.
- __ LoadObject(R13, context_class); // Load up class field of context.
- __ StoreIntoObject(RAX,
- FieldAddress(RAX, Context::class_offset()),
- R13);
// Calculate the size tag.
// RAX: new object.
// R10: number of context variables.
@@ -1156,8 +1144,6 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
RDX);
const Class& ita_cls =
Class::ZoneHandle(Object::instantiated_type_arguments_class());
- __ LoadObject(RDX, ita_cls);
- __ movq(Address(RCX, Instance::class_offset()), RDX); // Set its class.
// Set the tags.
uword tags = 0;
tags = RawObject::SizeTag::update(type_args_size, tags);
@@ -1174,12 +1160,10 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
// RDI: new object type arguments.
}
- // Initialize the class field in the object.
// RAX: new object start.
// RBX: next object start.
// RDI: new object type arguments (if is_cls_parameterized).
__ LoadObject(RDX, cls); // Load class of object to be allocated.
- __ movq(Address(RAX, Instance::class_offset()), RDX);
// Set the tags.
uword tags = 0;
tags = RawObject::SizeTag::update(instance_size, tags);
@@ -1330,11 +1314,8 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
__ movq(RDI, Immediate(heap->TopAddress()));
__ movq(Address(RDI, 0), R13);
- // Initialize the class field in the object.
// RAX: new closure object.
// RBX: new context object (only if is_implicit_closure).
- __ LoadObject(R10, cls); // Load signature class of closure.
- __ movq(Address(RAX, Closure::class_offset()), R10);
// Set the tags.
uword tags = 0;
tags = RawObject::SizeTag::update(closure_size, tags);
@@ -1359,10 +1340,7 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
} else if (is_implicit_instance_closure) {
// Initialize the new context capturing the receiver.
- // Set the class field to the Context class.
const Class& context_class = Class::ZoneHandle(Object::context_class());
- __ LoadObject(R13, context_class);
- __ movq(Address(RBX, Context::class_offset()), R13);
// Set the tags.
uword tags = 0;
tags = RawObject::SizeTag::update(context_size, tags);
@@ -1670,7 +1648,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(Assembler* assembler,
__ ret();
__ Bind(&not_smi);
- __ movq(RAX, FieldAddress(RAX, Object::class_offset()));
+ __ GetClassOf(RAX, RAX);
__ ret();
}
@@ -1768,7 +1746,7 @@ static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) {
const intptr_t kInstanceOffsetInBytes = 2 * kWordSize;
const intptr_t kCacheOffsetInBytes = 3 * kWordSize;
__ movq(RAX, Address(RSP, kInstanceOffsetInBytes));
- __ movq(R10, FieldAddress(RAX, Object::class_offset()));
+ __ GetClassOf(R10, RAX);
// RAX: instance, R10: instance class.
if (n > 1) {
// Compute instance type arguments into R13.
« runtime/vm/raw_object.cc ('K') | « runtime/vm/stub_code_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698