X87: Get CallInterfaceDescriptor directly from CodeStub.

port r23778.

original commit message:

  Get CallInterfaceDescriptor directly from CodeStub.

BUG=
R=weiliang.lin@intel.com

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

Patch from Jing Bao <jing.bao@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23894 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent baa5a2d6
...@@ -21,8 +21,7 @@ namespace internal { ...@@ -21,8 +21,7 @@ namespace internal {
static void InitializeArrayConstructorDescriptor( static void InitializeArrayConstructorDescriptor(
Isolate* isolate, CodeStub::Major major, Isolate* isolate, CodeStubDescriptor* descriptor,
CodeStubInterfaceDescriptor* descriptor,
int constant_stack_parameter_count) { int constant_stack_parameter_count) {
// register state // register state
// eax -- number of arguments // eax -- number of arguments
...@@ -32,22 +31,17 @@ static void InitializeArrayConstructorDescriptor( ...@@ -32,22 +31,17 @@ static void InitializeArrayConstructorDescriptor(
Runtime::kArrayConstructor)->entry; Runtime::kArrayConstructor)->entry;
if (constant_stack_parameter_count == 0) { if (constant_stack_parameter_count == 0) {
ArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); descriptor->Initialize(deopt_handler, constant_stack_parameter_count,
descriptor->Initialize(major, call_descriptor, deopt_handler,
constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE); JS_FUNCTION_STUB_MODE);
} else { } else {
ArrayConstructorDescriptor call_descriptor(isolate); descriptor->Initialize(eax, deopt_handler, constant_stack_parameter_count,
descriptor->Initialize(major, call_descriptor, eax, deopt_handler,
constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
} }
} }
static void InitializeInternalArrayConstructorDescriptor( static void InitializeInternalArrayConstructorDescriptor(
Isolate* isolate, CodeStub::Major major, Isolate* isolate, CodeStubDescriptor* descriptor,
CodeStubInterfaceDescriptor* descriptor,
int constant_stack_parameter_count) { int constant_stack_parameter_count) {
// register state // register state
// eax -- number of arguments // eax -- number of arguments
...@@ -56,66 +50,60 @@ static void InitializeInternalArrayConstructorDescriptor( ...@@ -56,66 +50,60 @@ static void InitializeInternalArrayConstructorDescriptor(
Runtime::kInternalArrayConstructor)->entry; Runtime::kInternalArrayConstructor)->entry;
if (constant_stack_parameter_count == 0) { if (constant_stack_parameter_count == 0) {
InternalArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); descriptor->Initialize(deopt_handler, constant_stack_parameter_count,
descriptor->Initialize(major, call_descriptor, deopt_handler,
constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE); JS_FUNCTION_STUB_MODE);
} else { } else {
InternalArrayConstructorDescriptor call_descriptor(isolate); descriptor->Initialize(eax, deopt_handler, constant_stack_parameter_count,
descriptor->Initialize(major, call_descriptor, eax, deopt_handler,
constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
} }
} }
void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( void ArrayNoArgumentConstructorStub::InitializeDescriptor(
CodeStubInterfaceDescriptor* descriptor) { CodeStubDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 0); InitializeArrayConstructorDescriptor(isolate(), descriptor, 0);
} }
void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( void ArraySingleArgumentConstructorStub::InitializeDescriptor(
CodeStubInterfaceDescriptor* descriptor) { CodeStubDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 1); InitializeArrayConstructorDescriptor(isolate(), descriptor, 1);
} }
void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( void ArrayNArgumentsConstructorStub::InitializeDescriptor(
CodeStubInterfaceDescriptor* descriptor) { CodeStubDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, -1); InitializeArrayConstructorDescriptor(isolate(), descriptor, -1);
} }
void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( void InternalArrayNoArgumentConstructorStub::InitializeDescriptor(
CodeStubInterfaceDescriptor* descriptor) { CodeStubDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate(), MajorKey(), InitializeInternalArrayConstructorDescriptor(isolate(), descriptor, 0);
descriptor, 0);
} }
void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( void InternalArraySingleArgumentConstructorStub::InitializeDescriptor(
CodeStubInterfaceDescriptor* descriptor) { CodeStubDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate(), MajorKey(), InitializeInternalArrayConstructorDescriptor(isolate(), descriptor, 1);
descriptor, 1);
} }
void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( void InternalArrayNArgumentsConstructorStub::InitializeDescriptor(
CodeStubInterfaceDescriptor* descriptor) { CodeStubDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate(), MajorKey(), InitializeInternalArrayConstructorDescriptor(isolate(), descriptor, -1);
descriptor, -1);
} }
#define __ ACCESS_MASM(masm) #define __ ACCESS_MASM(masm)
void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm,
ExternalReference miss) {
// Update the static counter each time a new code stub is generated. // Update the static counter each time a new code stub is generated.
isolate()->counters()->code_stubs()->Increment(); isolate()->counters()->code_stubs()->Increment();
CodeStubInterfaceDescriptor descriptor(this); CallInterfaceDescriptor descriptor = GetCallInterfaceDescriptor();
int param_count = descriptor.GetEnvironmentParameterCount(); int param_count = descriptor.GetEnvironmentParameterCount();
{ {
// Call the runtime system in a fresh internal frame. // Call the runtime system in a fresh internal frame.
...@@ -126,7 +114,6 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { ...@@ -126,7 +114,6 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
for (int i = 0; i < param_count; ++i) { for (int i = 0; i < param_count; ++i) {
__ push(descriptor.GetEnvironmentParameterRegister(i)); __ push(descriptor.GetEnvironmentParameterRegister(i));
} }
ExternalReference miss = descriptor.miss_handler();
__ CallExternalReference(miss, param_count); __ CallExternalReference(miss, param_count);
} }
......
...@@ -194,7 +194,7 @@ void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { ...@@ -194,7 +194,7 @@ void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
void Deoptimizer::SetPlatformCompiledStubRegisters( void Deoptimizer::SetPlatformCompiledStubRegisters(
FrameDescription* output_frame, CodeStubInterfaceDescriptor* descriptor) { FrameDescription* output_frame, CodeStubDescriptor* descriptor) {
intptr_t handler = intptr_t handler =
reinterpret_cast<intptr_t>(descriptor->deoptimization_handler()); reinterpret_cast<intptr_t>(descriptor->deoptimization_handler());
int params = descriptor->GetHandlerParameterCount(); int params = descriptor->GetHandlerParameterCount();
......
...@@ -2490,7 +2490,8 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { ...@@ -2490,7 +2490,8 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
return DefineAsSpilled(result, spill_index); return DefineAsSpilled(result, spill_index);
} else { } else {
DCHECK(info()->IsStub()); DCHECK(info()->IsStub());
CodeStubInterfaceDescriptor descriptor(info()->code_stub()); CallInterfaceDescriptor descriptor =
info()->code_stub()->GetCallInterfaceDescriptor();
int index = static_cast<int>(instr->index()); int index = static_cast<int>(instr->index());
Register reg = descriptor.GetEnvironmentParameterRegister(index); Register reg = descriptor.GetEnvironmentParameterRegister(index);
return DefineFixed(result, reg); return DefineFixed(result, reg);
......
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