| Index: src/arm/code-stubs-arm.cc
|
| diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc
|
| index 5e0e69e8a9a463e0af021387c9a5ce1045cf1af0..981c5481ea514ebe5199576fbc408bc4a05e8eba 100644
|
| --- a/src/arm/code-stubs-arm.cc
|
| +++ b/src/arm/code-stubs-arm.cc
|
| @@ -17,7 +17,7 @@ namespace internal {
|
|
|
| void FastNewClosureStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r2 };
|
| + Register registers[] = { cp, r2 };
|
| descriptor->Initialize(
|
| ARRAY_SIZE(registers), registers,
|
| Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry);
|
| @@ -26,21 +26,21 @@ void FastNewClosureStub::InitializeInterfaceDescriptor(
|
|
|
| void FastNewContextStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r1 };
|
| + Register registers[] = { cp, r1 };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers);
|
| }
|
|
|
|
|
| void ToNumberStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r0 };
|
| + Register registers[] = { cp, r0 };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers);
|
| }
|
|
|
|
|
| void NumberToStringStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r0 };
|
| + Register registers[] = { cp, r0 };
|
| descriptor->Initialize(
|
| ARRAY_SIZE(registers), registers,
|
| Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry);
|
| @@ -49,9 +49,10 @@ void NumberToStringStub::InitializeInterfaceDescriptor(
|
|
|
| void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r3, r2, r1 };
|
| + Register registers[] = { cp, r3, r2, r1 };
|
| Representation representations[] = {
|
| Representation::Tagged(),
|
| + Representation::Tagged(),
|
| Representation::Smi(),
|
| Representation::Tagged() };
|
| descriptor->Initialize(
|
| @@ -64,7 +65,7 @@ void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
|
|
|
| void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r3, r2, r1, r0 };
|
| + Register registers[] = { cp, r3, r2, r1, r0 };
|
| descriptor->Initialize(
|
| ARRAY_SIZE(registers), registers,
|
| Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry);
|
| @@ -73,14 +74,14 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
|
|
|
| void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r2, r3 };
|
| + Register registers[] = { cp, r2, r3 };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers);
|
| }
|
|
|
|
|
| void RegExpConstructResultStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r2, r1, r0 };
|
| + Register registers[] = { cp, r2, r1, r0 };
|
| descriptor->Initialize(
|
| ARRAY_SIZE(registers), registers,
|
| Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry);
|
| @@ -89,7 +90,7 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor(
|
|
|
| void TransitionElementsKindStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r0, r1 };
|
| + Register registers[] = { cp, r0, r1 };
|
| Address entry =
|
| Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry;
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| @@ -99,7 +100,7 @@ void TransitionElementsKindStub::InitializeInterfaceDescriptor(
|
|
|
| void CompareNilICStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r0 };
|
| + Register registers[] = { cp, r0 };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| FUNCTION_ADDR(CompareNilIC_Miss));
|
| descriptor->SetMissHandler(
|
| @@ -107,10 +108,14 @@ void CompareNilICStub::InitializeInterfaceDescriptor(
|
| }
|
|
|
|
|
| +const Register InterfaceDescriptor::ContextRegister() { return cp; }
|
| +
|
| +
|
| static void InitializeArrayConstructorDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor,
|
| int constant_stack_parameter_count) {
|
| // register state
|
| + // cp -- context
|
| // r0 -- number of arguments
|
| // r1 -- function
|
| // r2 -- allocation site with elements kind
|
| @@ -118,7 +123,7 @@ static void InitializeArrayConstructorDescriptor(
|
| Runtime::kArrayConstructor)->entry;
|
|
|
| if (constant_stack_parameter_count == 0) {
|
| - Register registers[] = { r1, r2 };
|
| + Register registers[] = { cp, r1, r2 };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| deopt_handler,
|
| NULL,
|
| @@ -126,10 +131,11 @@ static void InitializeArrayConstructorDescriptor(
|
| JS_FUNCTION_STUB_MODE);
|
| } else {
|
| // stack param count needs (constructor pointer, and single argument)
|
| - Register registers[] = { r1, r2, r0 };
|
| + Register registers[] = { cp, r1, r2, r0 };
|
| Representation representations[] = {
|
| Representation::Tagged(),
|
| Representation::Tagged(),
|
| + Representation::Tagged(),
|
| Representation::Integer32() };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| r0,
|
| @@ -146,13 +152,14 @@ static void InitializeInternalArrayConstructorDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor,
|
| int constant_stack_parameter_count) {
|
| // register state
|
| + // cp -- context
|
| // r0 -- number of arguments
|
| // r1 -- constructor function
|
| Address deopt_handler = Runtime::FunctionForId(
|
| Runtime::kInternalArrayConstructor)->entry;
|
|
|
| if (constant_stack_parameter_count == 0) {
|
| - Register registers[] = { r1 };
|
| + Register registers[] = { cp, r1 };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| deopt_handler,
|
| NULL,
|
| @@ -160,9 +167,10 @@ static void InitializeInternalArrayConstructorDescriptor(
|
| JS_FUNCTION_STUB_MODE);
|
| } else {
|
| // stack param count needs (constructor pointer, and single argument)
|
| - Register registers[] = { r1, r0 };
|
| + Register registers[] = { cp, r1, r0 };
|
| Representation representations[] = {
|
| Representation::Tagged(),
|
| + Representation::Tagged(),
|
| Representation::Integer32() };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| r0,
|
| @@ -195,7 +203,7 @@ void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
|
|
|
| void ToBooleanStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r0 };
|
| + Register registers[] = { cp, r0 };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| FUNCTION_ADDR(ToBooleanIC_Miss));
|
| descriptor->SetMissHandler(
|
| @@ -223,7 +231,7 @@ void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
|
|
|
| void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r0, r3, r1, r2 };
|
| + Register registers[] = { cp, r0, r3, r1, r2 };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
|
| }
|
| @@ -231,7 +239,7 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
|
|
|
| void BinaryOpICStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r1, r0 };
|
| + Register registers[] = { cp, r1, r0 };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| FUNCTION_ADDR(BinaryOpIC_Miss));
|
| descriptor->SetMissHandler(
|
| @@ -241,7 +249,7 @@ void BinaryOpICStub::InitializeInterfaceDescriptor(
|
|
|
| void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r2, r1, r0 };
|
| + Register registers[] = { cp, r2, r1, r0 };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite));
|
| }
|
| @@ -249,7 +257,7 @@ void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
|
|
|
| void StringAddStub::InitializeInterfaceDescriptor(
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| - Register registers[] = { r1, r0 };
|
| + Register registers[] = { cp, r1, r0 };
|
| descriptor->Initialize(
|
| ARRAY_SIZE(registers), registers,
|
| Runtime::FunctionForId(Runtime::kStringAdd)->entry);
|
| @@ -257,23 +265,23 @@ void StringAddStub::InitializeInterfaceDescriptor(
|
|
|
|
|
| void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
|
| - static PlatformCallInterfaceDescriptor default_descriptor =
|
| - PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
|
| + static PlatformInterfaceDescriptor default_descriptor =
|
| + PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
|
|
|
| - static PlatformCallInterfaceDescriptor noInlineDescriptor =
|
| - PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
|
| + static PlatformInterfaceDescriptor noInlineDescriptor =
|
| + PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
|
|
|
| {
|
| CallInterfaceDescriptor* descriptor =
|
| isolate->call_descriptor(Isolate::ArgumentAdaptorCall);
|
| - Register registers[] = { r1, // JSFunction
|
| - cp, // context
|
| + Register registers[] = { cp, // context
|
| + r1, // JSFunction
|
| r0, // actual number of arguments
|
| r2, // expected number of arguments
|
| };
|
| Representation representations[] = {
|
| - Representation::Tagged(), // JSFunction
|
| Representation::Tagged(), // context
|
| + Representation::Tagged(), // JSFunction
|
| Representation::Integer32(), // actual number of arguments
|
| Representation::Integer32(), // expected number of arguments
|
| };
|
| @@ -322,18 +330,18 @@ void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
|
| {
|
| CallInterfaceDescriptor* descriptor =
|
| isolate->call_descriptor(Isolate::ApiFunctionCall);
|
| - Register registers[] = { r0, // callee
|
| + Register registers[] = { cp, // context
|
| + r0, // callee
|
| r4, // call_data
|
| r2, // holder
|
| r1, // api_function_address
|
| - cp, // context
|
| };
|
| Representation representations[] = {
|
| + Representation::Tagged(), // context
|
| Representation::Tagged(), // callee
|
| Representation::Tagged(), // call_data
|
| Representation::Tagged(), // holder
|
| Representation::External(), // api_function_address
|
| - Representation::Tagged(), // context
|
| };
|
| descriptor->Initialize(ARRAY_SIZE(registers), registers,
|
| representations, &default_descriptor);
|
| @@ -363,18 +371,19 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
|
| isolate()->counters()->code_stubs()->Increment();
|
|
|
| CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
|
| - int param_count = descriptor->register_param_count();
|
| + int param_count = descriptor->GetEnvironmentParameterCount();
|
| {
|
| // Call the runtime system in a fresh internal frame.
|
| FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
| - ASSERT(descriptor->register_param_count() == 0 ||
|
| - r0.is(descriptor->GetParameterRegister(param_count - 1)));
|
| + ASSERT(param_count == 0 ||
|
| + r0.is(descriptor->GetEnvironmentParameterRegister(
|
| + param_count - 1)));
|
| // Push arguments
|
| for (int i = 0; i < param_count; ++i) {
|
| - __ push(descriptor->GetParameterRegister(i));
|
| + __ push(descriptor->GetEnvironmentParameterRegister(i));
|
| }
|
| ExternalReference miss = descriptor->miss_handler();
|
| - __ CallExternalReference(miss, descriptor->register_param_count());
|
| + __ CallExternalReference(miss, param_count);
|
| }
|
|
|
| __ Ret();
|
|
|