| Index: src/arm/code-stubs-arm.cc
|
| diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc
|
| index 033413ba775aea2894da1573fd1ac5516c1b4513..2df80fb3eac45d06c0b572529363d97a3da7e506 100644
|
| --- a/src/arm/code-stubs-arm.cc
|
| +++ b/src/arm/code-stubs-arm.cc
|
| @@ -17,181 +17,128 @@ namespace internal {
|
|
|
| void FastNewClosureStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r2 };
|
| - descriptor->register_param_count_ = 1;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry;
|
| + Register registers[] = { r2 };
|
| + descriptor->Initialize(
|
| + ARRAY_SIZE(registers), registers,
|
| + Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry);
|
| }
|
|
|
|
|
| void FastNewContextStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r1 };
|
| - descriptor->register_param_count_ = 1;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ = NULL;
|
| + Register registers[] = { r1 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers);
|
| }
|
|
|
|
|
| void ToNumberStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r0 };
|
| - descriptor->register_param_count_ = 1;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ = NULL;
|
| + Register registers[] = { r0 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers);
|
| }
|
|
|
|
|
| void NumberToStringStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r0 };
|
| - descriptor->register_param_count_ = 1;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry;
|
| + Register registers[] = { r0 };
|
| + descriptor->Initialize(
|
| + ARRAY_SIZE(registers), registers,
|
| + Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry);
|
| }
|
|
|
|
|
| void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r3, r2, r1 };
|
| - descriptor->register_param_count_ = 3;
|
| - descriptor->register_params_ = registers;
|
| - static Representation representations[] = {
|
| + Register registers[] = { r3, r2, r1 };
|
| + Representation representations[] = {
|
| Representation::Tagged(),
|
| Representation::Smi(),
|
| Representation::Tagged() };
|
| - descriptor->register_param_representations_ = representations;
|
| - descriptor->deoptimization_handler_ =
|
| + descriptor->Initialize(
|
| + ARRAY_SIZE(registers), registers,
|
| Runtime::FunctionForId(
|
| - Runtime::kHiddenCreateArrayLiteralStubBailout)->entry;
|
| + Runtime::kHiddenCreateArrayLiteralStubBailout)->entry,
|
| + representations);
|
| }
|
|
|
|
|
| void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r3, r2, r1, r0 };
|
| - descriptor->register_param_count_ = 4;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry;
|
| + Register registers[] = { r3, r2, r1, r0 };
|
| + descriptor->Initialize(
|
| + ARRAY_SIZE(registers), registers,
|
| + Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry);
|
| }
|
|
|
|
|
| void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r2, r3 };
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ = NULL;
|
| -}
|
| -
|
| -
|
| -void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
|
| - CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r1, r0 };
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
|
| -}
|
| -
|
| -
|
| -void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
|
| - CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r1, r0 };
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
|
| + Register registers[] = { r2, r3 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers);
|
| }
|
|
|
|
|
| void RegExpConstructResultStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r2, r1, r0 };
|
| - descriptor->register_param_count_ = 3;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry;
|
| -}
|
| -
|
| -
|
| -void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor(
|
| - CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r1, r0 };
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry;
|
| + Register registers[] = { r2, r1, r0 };
|
| + descriptor->Initialize(
|
| + ARRAY_SIZE(registers), registers,
|
| + Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry);
|
| }
|
|
|
|
|
| void LoadFieldStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r0 };
|
| - descriptor->register_param_count_ = 1;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ = NULL;
|
| + Register registers[] = { r0 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers);
|
| }
|
|
|
|
|
| void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r1 };
|
| - descriptor->register_param_count_ = 1;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ = NULL;
|
| + Register registers[] = { r1 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers);
|
| }
|
|
|
|
|
| void StringLengthStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r0, r2 };
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ = NULL;
|
| + Register registers[] = { r0, r2 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers);
|
| }
|
|
|
|
|
| void KeyedStringLengthStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r1, r0 };
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ = NULL;
|
| + Register registers[] = { r1, r0 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers);
|
| }
|
|
|
|
|
| void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r2, r1, r0 };
|
| - descriptor->register_param_count_ = 3;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
|
| + Register registers[] = { r2, r1, r0 };
|
| + descriptor->Initialize(
|
| + ARRAY_SIZE(registers), registers,
|
| + FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure));
|
| }
|
|
|
|
|
| void TransitionElementsKindStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r0, r1 };
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers;
|
| + Register registers[] = { r0, r1 };
|
| Address entry =
|
| Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry;
|
| - descriptor->deoptimization_handler_ = FUNCTION_ADDR(entry);
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + FUNCTION_ADDR(entry));
|
| }
|
|
|
|
|
| void CompareNilICStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r0 };
|
| - descriptor->register_param_count_ = 1;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - FUNCTION_ADDR(CompareNilIC_Miss);
|
| + Register registers[] = { r0 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + FUNCTION_ADDR(CompareNilIC_Miss));
|
| descriptor->SetMissHandler(
|
| ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
|
| }
|
| @@ -204,29 +151,31 @@ static void InitializeArrayConstructorDescriptor(
|
| // r0 -- number of arguments
|
| // r1 -- function
|
| // r2 -- allocation site with elements kind
|
| - static Register registers_variable_args[] = { r1, r2, r0 };
|
| - static Register registers_no_args[] = { r1, r2 };
|
| + Address deopt_handler = Runtime::FunctionForId(
|
| + Runtime::kHiddenArrayConstructor)->entry;
|
|
|
| if (constant_stack_parameter_count == 0) {
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers_no_args;
|
| + Register registers[] = { r1, r2 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + deopt_handler,
|
| + NULL,
|
| + constant_stack_parameter_count,
|
| + JS_FUNCTION_STUB_MODE);
|
| } else {
|
| // stack param count needs (constructor pointer, and single argument)
|
| - descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
|
| - descriptor->stack_parameter_count_ = r0;
|
| - descriptor->register_param_count_ = 3;
|
| - descriptor->register_params_ = registers_variable_args;
|
| - static Representation representations[] = {
|
| + Register registers[] = { r1, r2, r0 };
|
| + Representation representations[] = {
|
| Representation::Tagged(),
|
| Representation::Tagged(),
|
| Representation::Integer32() };
|
| - descriptor->register_param_representations_ = representations;
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + r0,
|
| + deopt_handler,
|
| + representations,
|
| + constant_stack_parameter_count,
|
| + JS_FUNCTION_STUB_MODE,
|
| + PASS_ARGUMENTS);
|
| }
|
| -
|
| - descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
| - descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
|
| - descriptor->deoptimization_handler_ =
|
| - Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry;
|
| }
|
|
|
|
|
| @@ -236,28 +185,30 @@ static void InitializeInternalArrayConstructorDescriptor(
|
| // register state
|
| // r0 -- number of arguments
|
| // r1 -- constructor function
|
| - static Register registers_variable_args[] = { r1, r0 };
|
| - static Register registers_no_args[] = { r1 };
|
| + Address deopt_handler = Runtime::FunctionForId(
|
| + Runtime::kHiddenInternalArrayConstructor)->entry;
|
|
|
| if (constant_stack_parameter_count == 0) {
|
| - descriptor->register_param_count_ = 1;
|
| - descriptor->register_params_ = registers_no_args;
|
| + Register registers[] = { r1 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + deopt_handler,
|
| + NULL,
|
| + constant_stack_parameter_count,
|
| + JS_FUNCTION_STUB_MODE);
|
| } else {
|
| // stack param count needs (constructor pointer, and single argument)
|
| - descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
|
| - descriptor->stack_parameter_count_ = r0;
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers_variable_args;
|
| - static Representation representations[] = {
|
| + Register registers[] = { r1, r0 };
|
| + Representation representations[] = {
|
| Representation::Tagged(),
|
| Representation::Integer32() };
|
| - descriptor->register_param_representations_ = representations;
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + r0,
|
| + deopt_handler,
|
| + representations,
|
| + constant_stack_parameter_count,
|
| + JS_FUNCTION_STUB_MODE,
|
| + PASS_ARGUMENTS);
|
| }
|
| -
|
| - descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
| - descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
|
| - descriptor->deoptimization_handler_ =
|
| - Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry;
|
| }
|
|
|
|
|
| @@ -281,11 +232,9 @@ void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
|
|
|
| void ToBooleanStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r0 };
|
| - descriptor->register_param_count_ = 1;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - FUNCTION_ADDR(ToBooleanIC_Miss);
|
| + Register registers[] = { r0 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + FUNCTION_ADDR(ToBooleanIC_Miss));
|
| descriptor->SetMissHandler(
|
| ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
|
| }
|
| @@ -311,30 +260,25 @@ void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
|
|
|
| void StoreGlobalStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r1, r2, r0 };
|
| - descriptor->register_param_count_ = 3;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - FUNCTION_ADDR(StoreIC_MissFromStubFailure);
|
| + Register registers[] = { r1, r2, r0 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + FUNCTION_ADDR(StoreIC_MissFromStubFailure));
|
| }
|
|
|
|
|
| void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r0, r3, r1, r2 };
|
| - descriptor->register_param_count_ = 4;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss);
|
| + Register registers[] = { r0, r3, r1, r2 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
|
| }
|
|
|
|
|
| void BinaryOpICStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r1, r0 };
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss);
|
| + Register registers[] = { r1, r0 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + FUNCTION_ADDR(BinaryOpIC_Miss));
|
| descriptor->SetMissHandler(
|
| ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
|
| }
|
| @@ -342,21 +286,18 @@ void BinaryOpICStub::InitializeInterfaceDescriptor(
|
|
|
| void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r2, r1, r0 };
|
| - descriptor->register_param_count_ = 3;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite);
|
| + Register registers[] = { r2, r1, r0 };
|
| + descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| + FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite));
|
| }
|
|
|
|
|
| void StringAddStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - static Register registers[] = { r1, r0 };
|
| - descriptor->register_param_count_ = 2;
|
| - descriptor->register_params_ = registers;
|
| - descriptor->deoptimization_handler_ =
|
| - Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry;
|
| + Register registers[] = { r1, r0 };
|
| + descriptor->Initialize(
|
| + ARRAY_SIZE(registers), registers,
|
| + Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry);
|
| }
|
|
|
|
|
| @@ -477,18 +418,18 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
|
| isolate()->counters()->code_stubs()->Increment();
|
|
|
| CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
|
| - int param_count = descriptor->register_param_count_;
|
| + int param_count = descriptor->register_param_count();
|
| {
|
| // Call the runtime system in a fresh internal frame.
|
| FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
| - ASSERT(descriptor->register_param_count_ == 0 ||
|
| - r0.is(descriptor->register_params_[param_count - 1]));
|
| + ASSERT(descriptor->register_param_count() == 0 ||
|
| + r0.is(descriptor->GetParameterRegister(param_count - 1)));
|
| // Push arguments
|
| for (int i = 0; i < param_count; ++i) {
|
| - __ push(descriptor->register_params_[i]);
|
| + __ push(descriptor->GetParameterRegister(i));
|
| }
|
| ExternalReference miss = descriptor->miss_handler();
|
| - __ CallExternalReference(miss, descriptor->register_param_count_);
|
| + __ CallExternalReference(miss, descriptor->register_param_count());
|
| }
|
|
|
| __ Ret();
|
|
|