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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 1268783003: Simplify constant pool usage in x64 code generator (by removing extra argument (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 5 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/runtime_entry_x64.cc ('k') | runtime/vm/stub_code_x64_test.cc » ('j') | 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 ba8caa245c809c787e331a319157988b8130dfb0..16cee8121fe03f636a1a608d6f59e18b5abb1b09 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -276,7 +276,7 @@ void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) {
__ EnterStubFrame();
__ pushq(R10); // Preserve arguments descriptor array.
// Setup space on stack for return value.
- __ PushObject(Object::null_object(), PP);
+ __ PushObject(Object::null_object());
__ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
__ popq(RAX); // Get Code object result.
__ popq(R10); // Restore arguments descriptor array.
@@ -296,7 +296,7 @@ void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
__ EnterStubFrame();
__ pushq(R10); // Preserve arguments descriptor array.
// Setup space on stack for return value.
- __ PushObject(Object::null_object(), PP);
+ __ PushObject(Object::null_object());
__ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
__ popq(RAX); // Get Code object.
__ popq(R10); // Restore arguments descriptor array.
@@ -313,7 +313,7 @@ void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
void StubCode::GenerateFixAllocationStubTargetStub(Assembler* assembler) {
__ EnterStubFrame();
// Setup space on stack for return value.
- __ PushObject(Object::null_object(), PP);
+ __ PushObject(Object::null_object());
__ CallRuntime(kFixAllocationStubTargetRuntimeEntry, 0);
__ popq(RAX); // Get Code object.
__ movq(RAX, FieldAddress(RAX, Code::instructions_offset()));
@@ -328,7 +328,7 @@ void StubCode::GenerateFixAllocationStubTargetStub(Assembler* assembler) {
// R10: smi-tagged argument count, may be zero.
// RBP[kParamEndSlotFromFp + 1]: last argument.
static void PushArgumentsArray(Assembler* assembler) {
- __ LoadObject(R12, Object::null_object(), PP);
+ __ LoadObject(R12, Object::null_object());
// Allocate array to store arguments of caller.
__ movq(RBX, R12); // Null element type for raw Array.
const ExternalLabel array_label(StubCode::AllocateArrayEntryPoint());
@@ -547,7 +547,7 @@ void StubCode::GenerateMegamorphicMissStub(Assembler* assembler) {
__ pushq(R10);
// Space for the result of the runtime call.
- __ PushObject(Object::null_object(), PP);
+ __ PushObject(Object::null_object());
__ pushq(RAX); // Receiver.
__ pushq(RBX); // IC data.
__ pushq(R10); // Arguments descriptor.
@@ -580,9 +580,6 @@ void StubCode::GenerateMegamorphicMissStub(Assembler* assembler) {
// NOTE: R10 cannot be clobbered here as the caller relies on it being saved.
// The newly allocated object is returned in RAX.
void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
- // Must load pool pointer before being able to patch.
- Register new_pp = R13;
- __ LoadPoolPointer(new_pp);
Label slow_case;
// Compute the size to be allocated, it is based on the array length
// and is computed as:
@@ -674,7 +671,7 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
// RCX: new object end address.
// RDI: iterator which initially points to the start of the variable
// data area to be initialized.
- __ LoadObject(R12, Object::null_object(), PP);
+ __ LoadObject(R12, Object::null_object());
__ leaq(RDI, FieldAddress(RAX, sizeof(RawArray)));
Label done;
Label init_loop;
@@ -700,7 +697,7 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
// calling into the runtime.
__ EnterStubFrame();
// Setup space on stack for return value.
- __ PushObject(Object::null_object(), PP);
+ __ PushObject(Object::null_object());
__ pushq(R10); // Array length as Smi.
__ pushq(RBX); // Element type.
__ CallRuntime(kAllocateArrayRuntimeEntry, 2);
@@ -744,7 +741,7 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
// We now load the pool pointer(PP) as we are about to invoke dart code and we
// could potentially invoke some intrinsic functions which need the PP to be
// set up.
- __ LoadPoolPointer(PP);
+ __ LoadPoolPointer();
// If any additional (or fewer) values are pushed, the offsets in
// kExitLinkSlotFromEntryFp will need to be changed.
@@ -838,6 +835,7 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
// Restore C++ ABI callee-saved registers.
__ PopRegisters(CallingConventions::kCalleeSaveCpuRegisters,
CallingConventions::kCalleeSaveXmmRegisters);
+ __ set_constant_pool_allowed(false);
// Restore the frame pointer.
__ LeaveFrame();
@@ -852,7 +850,7 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
// Output:
// RAX: new allocated RawContext object.
void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
- __ LoadObject(R12, Object::null_object(), PP);
+ __ LoadObject(R12, Object::null_object());
if (FLAG_inline_alloc) {
Label slow_case;
// First compute the rounded instance size.
@@ -1065,7 +1063,7 @@ void StubCode::GenerateAllocationStubForClass(
const int kInlineInstanceSize = 12; // In words.
const intptr_t instance_size = cls.instance_size();
ASSERT(instance_size > 0);
- __ LoadObject(R12, Object::null_object(), PP);
+ __ LoadObject(R12, Object::null_object());
if (is_cls_parameterized) {
__ movq(RDX, Address(RSP, kObjectTypeArgumentsOffset));
// RDX: instantiated type arguments.
@@ -1161,7 +1159,7 @@ void StubCode::GenerateAllocationStubForClass(
// Create a stub frame.
__ EnterStubFrame(); // Uses PP to access class object.
__ pushq(R12); // Setup space on stack for return value.
- __ PushObject(cls, PP); // Push class of object to be allocated.
+ __ PushObject(cls); // Push class of object to be allocated.
if (is_cls_parameterized) {
__ pushq(RDX); // Push type arguments of object to be allocated.
} else {
@@ -1194,7 +1192,7 @@ void StubCode::GenerateCallClosureNoSuchMethodStub(Assembler* assembler) {
__ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
__ movq(RAX, Address(RBP, R13, TIMES_4, kParamEndSlotFromFp * kWordSize));
- __ LoadObject(R12, Object::null_object(), PP);
+ __ LoadObject(R12, Object::null_object());
__ pushq(R12); // Setup space on stack for result from noSuchMethod.
__ pushq(RAX); // Receiver.
__ pushq(R10); // Arguments descriptor array.
@@ -1281,10 +1279,10 @@ static void EmitFastSmiOp(Assembler* assembler,
Label done, is_true;
__ cmpq(RAX, RCX);
__ j(EQUAL, &is_true, Assembler::kNearJump);
- __ LoadObject(RAX, Bool::False(), PP);
+ __ LoadObject(RAX, Bool::False());
__ jmp(&done, Assembler::kNearJump);
__ Bind(&is_true);
- __ LoadObject(RAX, Bool::True(), PP);
+ __ LoadObject(RAX, Bool::True());
__ Bind(&done);
break;
}
@@ -1452,7 +1450,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(
__ j(NOT_EQUAL, &loop, Assembler::kNearJump);
__ Comment("IC miss");
- __ LoadObject(R12, Object::null_object(), PP);
+ __ LoadObject(R12, Object::null_object());
// Compute address of arguments (first read number of arguments from
// arguments descriptor array and then compute address on the stack).
__ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
@@ -1770,7 +1768,7 @@ void StubCode::GenerateICCallBreakpointStub(Assembler* assembler) {
__ pushq(RBX);
// Room for result. Debugger stub returns address of the
// unpatched runtime stub.
- __ LoadObject(R12, Object::null_object(), PP);
+ __ LoadObject(R12, Object::null_object());
__ pushq(R12); // Room for result.
__ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
__ popq(RAX); // Address of original.
@@ -1785,7 +1783,7 @@ void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) {
__ EnterStubFrame();
// Room for result. Debugger stub returns address of the
// unpatched runtime stub.
- __ LoadObject(R12, Object::null_object(), PP);
+ __ LoadObject(R12, Object::null_object());
__ pushq(R12); // Room for result.
__ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
__ popq(RAX); // Address of original.
@@ -1825,9 +1823,9 @@ static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) {
const intptr_t kInstanceOffsetInBytes = 2 * kWordSize;
const intptr_t kCacheOffsetInBytes = 3 * kWordSize;
__ movq(RAX, Address(RSP, kInstanceOffsetInBytes));
- __ LoadObject(R12, Object::null_object(), PP);
+ __ LoadObject(R12, Object::null_object());
if (n > 1) {
- __ LoadClass(R10, RAX, kNoRegister);
+ __ LoadClass(R10, RAX);
// Compute instance type arguments into R13.
Label has_no_type_arguments;
__ movq(R13, R12);
@@ -1976,7 +1974,7 @@ void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
// R10: argument descriptor (preserved).
void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
__ EnterStubFrame();
- __ LoadObject(R12, Object::null_object(), PP);
+ __ LoadObject(R12, Object::null_object());
__ pushq(R10);
__ pushq(R12); // Setup space on stack for return value.
__ pushq(RDI);
@@ -2122,7 +2120,7 @@ void StubCode::EmitMegamorphicLookup(
__ jmp(&loop);
__ Bind(&update);
- __ AddImmediate(RCX, Immediate(Smi::RawValue(1)), PP);
+ __ AddImmediate(RCX, Immediate(Smi::RawValue(1)));
__ Bind(&loop);
__ andq(RCX, RBX);
const intptr_t base = Array::data_offset();
@@ -2145,7 +2143,7 @@ void StubCode::EmitMegamorphicLookup(
// TODO(srdjan): Evaluate performance impact of moving the instruction below
// to the call site, instead of having it here.
__ AddImmediate(
- target, Immediate(Instructions::HeaderSize() - kHeapObjectTag), PP);
+ target, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
}
« no previous file with comments | « runtime/vm/runtime_entry_x64.cc ('k') | runtime/vm/stub_code_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698