Chromium Code Reviews| Index: src/arm/code-stubs-arm.cc |
| diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
| index 4eb08a1eebb0d7b0145166244f28414b497f604c..35333c11f37c8c9e6c307919cf5f2f7a7281c4dd 100644 |
| --- a/src/arm/code-stubs-arm.cc |
| +++ b/src/arm/code-stubs-arm.cc |
| @@ -193,18 +193,6 @@ void CompareNilICStub::InitializeInterfaceDescriptor( |
| } |
| -void BinaryOpICStub::InitializeInterfaceDescriptor( |
| - Isolate* isolate, |
| - CodeStubInterfaceDescriptor* descriptor) { |
| - static Register registers[] = { r1, r0 }; |
| - descriptor->register_param_count_ = 2; |
| - descriptor->register_params_ = registers; |
| - descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); |
| - descriptor->SetMissHandler( |
| - ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate)); |
| -} |
| - |
| - |
| static void InitializeArrayConstructorDescriptor( |
| Isolate* isolate, |
| CodeStubInterfaceDescriptor* descriptor, |
| @@ -339,6 +327,29 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( |
| } |
| +void BinaryOpICStub::InitializeInterfaceDescriptor( |
| + Isolate* isolate, |
| + CodeStubInterfaceDescriptor* descriptor) { |
| + static Register registers[] = { r1, r0 }; |
| + descriptor->register_param_count_ = 2; |
| + descriptor->register_params_ = registers; |
| + descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); |
| + descriptor->SetMissHandler( |
| + ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate)); |
| +} |
|
Hannes Payer (out of office)
2013/12/11 13:12:22
why did you move this code?
Benedikt Meurer
2013/12/11 13:55:43
Probably by accident.
|
| + |
| + |
| +void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( |
| + Isolate* isolate, |
| + CodeStubInterfaceDescriptor* descriptor) { |
| + static Register registers[] = { r2, r1, r0 }; |
| + descriptor->register_param_count_ = 3; |
| + descriptor->register_params_ = registers; |
| + descriptor->deoptimization_handler_ = |
| + FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite); |
| +} |
| + |
| + |
| void NewStringAddStub::InitializeInterfaceDescriptor( |
| Isolate* isolate, |
| CodeStubInterfaceDescriptor* descriptor) { |
| @@ -1652,6 +1663,7 @@ void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { |
| ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| CreateAllocationSiteStub::GenerateAheadOfTime(isolate); |
| BinaryOpICStub::GenerateAheadOfTime(isolate); |
| + BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(isolate); |
| } |
| @@ -4367,6 +4379,38 @@ void StringCompareStub::Generate(MacroAssembler* masm) { |
| } |
| +void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
| + // ----------- S t a t e ------------- |
| + // -- r1 : left |
| + // -- r0 : right |
| + // -- lr : return address |
| + // ----------------------------------- |
| + Isolate* isolate = masm->isolate(); |
| + |
| + // Load r2 with the allocation site. We stick an undefined dummy value here |
| + // and replace it with the real allocation site later when we instantiate this |
| + // stub in BinaryOpICWithAllocationSiteStub::GetCodeCopyFromTemplate(). |
| + __ Move(r2, handle(isolate->heap()->undefined_value())); |
| + |
| + // Make sure that we actually patched the allocation site. |
| + if (FLAG_debug_code) { |
| + __ tst(r2, Operand(kSmiTagMask)); |
| + __ Assert(ne, kExpectedAllocationSite); |
| + __ push(r2); |
| + __ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset)); |
| + __ LoadRoot(ip, Heap::kAllocationSiteMapRootIndex); |
| + __ cmp(r2, ip); |
| + __ pop(r2); |
| + __ Assert(eq, kExpectedAllocationSite); |
| + } |
| + |
| + // Tail call into the stub that handles binary operations with allocation |
| + // sites. |
| + BinaryOpWithAllocationSiteStub stub(state_); |
| + __ TailCallStub(&stub); |
| +} |
| + |
| + |
| void StringAddStub::Generate(MacroAssembler* masm) { |
| Label call_runtime, call_builtin; |
| Builtins::JavaScript builtin_id = Builtins::ADD; |