Commit 1359017f authored by chunyang.dai's avatar chunyang.dai Committed by Commit bot

X87: HydrogenCodeStubs consume stack arguments via descriptor.

port 3334b830 (r20813).

original commit message:

    HydrogenCodeStubs consume stack arguments via descriptor.

    All of this is controlled by the CallDescriptor. It's simply the case
    that if you specify less registers than the function arity calls for,
    the rest are assumed to be on the stack.

    Bailout handlers accept these constant stack arguments too.

BUG=

Review URL: https://codereview.chromium.org/1258553002

Cr-Commit-Position: refs/heads/master@{#29836}
parent 7d02830e
......@@ -354,11 +354,20 @@ void NamedStoreHandlerCompiler::GenerateRestoreName(Handle<Name> name) {
}
void NamedStoreHandlerCompiler::GeneratePushMap(Register map_reg,
Register scratch) {
// Get the return address, push the argument and then continue.
__ pop(scratch);
__ push(map_reg);
__ push(scratch);
}
void NamedStoreHandlerCompiler::GenerateRestoreMap(Handle<Map> transition,
Register map_reg,
Register scratch,
Label* miss) {
Handle<WeakCell> cell = Map::WeakCellForMap(transition);
Register map_reg = StoreTransitionDescriptor::MapRegister();
DCHECK(!map_reg.is(scratch));
__ LoadWeakValue(map_reg, cell, miss);
if (transition->CanBeDeprecated()) {
......
......@@ -37,7 +37,7 @@ static void InitializeArrayConstructorDescriptor(
JS_FUNCTION_STUB_MODE);
} else {
descriptor->Initialize(eax, deopt_handler, constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
JS_FUNCTION_STUB_MODE);
}
}
......@@ -56,7 +56,7 @@ static void InitializeInternalArrayConstructorDescriptor(
JS_FUNCTION_STUB_MODE);
} else {
descriptor->Initialize(eax, deopt_handler, constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
JS_FUNCTION_STUB_MODE);
}
}
......
......@@ -32,7 +32,9 @@ const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return edi; }
const Register VectorStoreICDescriptor::VectorRegister() { return ebx; }
const Register StoreTransitionDescriptor::MapRegister() { return ebx; }
const Register StoreTransitionDescriptor::MapRegister() {
return FLAG_vector_stores ? no_reg : ebx;
}
const Register LoadGlobalViaContextDescriptor::DepthRegister() { return edx; }
......@@ -69,6 +71,20 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return eax; }
const Register GrowArrayElementsDescriptor::KeyRegister() { return ebx; }
void StoreTransitionDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(),
MapRegister()};
// When FLAG_vector_stores is true, we want to pass the map register on the
// stack instead of in a register.
DCHECK(FLAG_vector_stores || !MapRegister().is(no_reg));
int register_count = FLAG_vector_stores ? 3 : 4;
data->InitializePlatformSpecific(register_count, registers);
}
void FastNewClosureDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {ebx};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment