X87: HydrogenCodeStubs consume stack arguments via descriptor.

port 3334b830a5 (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}
This commit is contained in:
chunyang.dai 2015-07-24 02:57:39 -07:00 committed by Commit bot
parent 7d02830e74
commit 1359017f80
3 changed files with 29 additions and 4 deletions

View File

@ -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, void NamedStoreHandlerCompiler::GenerateRestoreMap(Handle<Map> transition,
Register map_reg,
Register scratch, Register scratch,
Label* miss) { Label* miss) {
Handle<WeakCell> cell = Map::WeakCellForMap(transition); Handle<WeakCell> cell = Map::WeakCellForMap(transition);
Register map_reg = StoreTransitionDescriptor::MapRegister();
DCHECK(!map_reg.is(scratch)); DCHECK(!map_reg.is(scratch));
__ LoadWeakValue(map_reg, cell, miss); __ LoadWeakValue(map_reg, cell, miss);
if (transition->CanBeDeprecated()) { if (transition->CanBeDeprecated()) {

View File

@ -37,7 +37,7 @@ static void InitializeArrayConstructorDescriptor(
JS_FUNCTION_STUB_MODE); JS_FUNCTION_STUB_MODE);
} else { } else {
descriptor->Initialize(eax, deopt_handler, constant_stack_parameter_count, 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); JS_FUNCTION_STUB_MODE);
} else { } else {
descriptor->Initialize(eax, deopt_handler, constant_stack_parameter_count, descriptor->Initialize(eax, deopt_handler, constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); JS_FUNCTION_STUB_MODE);
} }
} }

View File

@ -32,7 +32,9 @@ const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return edi; }
const Register VectorStoreICDescriptor::VectorRegister() { return ebx; } 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; } const Register LoadGlobalViaContextDescriptor::DepthRegister() { return edx; }
@ -69,6 +71,20 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return eax; }
const Register GrowArrayElementsDescriptor::KeyRegister() { return ebx; } 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( void FastNewClosureDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {ebx}; Register registers[] = {ebx};