Index: src/ic/arm/ic-arm.cc |
diff --git a/src/ic/arm/ic-arm.cc b/src/ic/arm/ic-arm.cc |
index 129ab70cadfb0953c9999a516ff1aaa27ccd8d4d..fad0737a1ccd23530970bad0617079e8d4575ea0 100644 |
--- a/src/ic/arm/ic-arm.cc |
+++ b/src/ic/arm/ic-arm.cc |
@@ -19,133 +19,6 @@ namespace internal { |
#define __ ACCESS_MASM(masm) |
-// Helper function used from LoadIC GenerateNormal. |
-// |
-// elements: Property dictionary. It is not clobbered if a jump to the miss |
-// label is done. |
-// name: Property name. It is not clobbered if a jump to the miss label is |
-// done |
-// result: Register for the result. It is only updated if a jump to the miss |
-// label is not done. Can be the same as elements or name clobbering |
-// one of these in the case of not jumping to the miss label. |
-// The two scratch registers need to be different from elements, name and |
-// result. |
-// The generated code assumes that the receiver has slow properties, |
-// is not a global object and does not have interceptors. |
-static void GenerateDictionaryLoad(MacroAssembler* masm, Label* miss, |
- Register elements, Register name, |
- Register result, Register scratch1, |
- Register scratch2) { |
- // Main use of the scratch registers. |
- // scratch1: Used as temporary and to hold the capacity of the property |
- // dictionary. |
- // scratch2: Used as temporary. |
- Label done; |
- |
- // Probe the dictionary. |
- NameDictionaryLookupStub::GeneratePositiveLookup(masm, miss, &done, elements, |
- name, scratch1, scratch2); |
- |
- // If probing finds an entry check that the value is a normal |
- // property. |
- __ bind(&done); // scratch2 == elements + 4 * index |
- const int kElementsStartOffset = |
- NameDictionary::kHeaderSize + |
- NameDictionary::kElementsStartIndex * kPointerSize; |
- const int kDetailsOffset = kElementsStartOffset + 2 * kPointerSize; |
- __ ldr(scratch1, FieldMemOperand(scratch2, kDetailsOffset)); |
- __ tst(scratch1, Operand(PropertyDetails::TypeField::kMask << kSmiTagSize)); |
- __ b(ne, miss); |
- |
- // Get the value at the masked, scaled index and return. |
- __ ldr(result, |
- FieldMemOperand(scratch2, kElementsStartOffset + 1 * kPointerSize)); |
-} |
- |
- |
-// Helper function used from StoreIC::GenerateNormal. |
-// |
-// elements: Property dictionary. It is not clobbered if a jump to the miss |
-// label is done. |
-// name: Property name. It is not clobbered if a jump to the miss label is |
-// done |
-// value: The value to store. |
-// The two scratch registers need to be different from elements, name and |
-// result. |
-// The generated code assumes that the receiver has slow properties, |
-// is not a global object and does not have interceptors. |
-static void GenerateDictionaryStore(MacroAssembler* masm, Label* miss, |
- Register elements, Register name, |
- Register value, Register scratch1, |
- Register scratch2) { |
- // Main use of the scratch registers. |
- // scratch1: Used as temporary and to hold the capacity of the property |
- // dictionary. |
- // scratch2: Used as temporary. |
- Label done; |
- |
- // Probe the dictionary. |
- NameDictionaryLookupStub::GeneratePositiveLookup(masm, miss, &done, elements, |
- name, scratch1, scratch2); |
- |
- // If probing finds an entry in the dictionary check that the value |
- // is a normal property that is not read only. |
- __ bind(&done); // scratch2 == elements + 4 * index |
- const int kElementsStartOffset = |
- NameDictionary::kHeaderSize + |
- NameDictionary::kElementsStartIndex * kPointerSize; |
- const int kDetailsOffset = kElementsStartOffset + 2 * kPointerSize; |
- const int kTypeAndReadOnlyMask = |
- (PropertyDetails::TypeField::kMask | |
- PropertyDetails::AttributesField::encode(READ_ONLY)) |
- << kSmiTagSize; |
- __ ldr(scratch1, FieldMemOperand(scratch2, kDetailsOffset)); |
- __ tst(scratch1, Operand(kTypeAndReadOnlyMask)); |
- __ b(ne, miss); |
- |
- // Store the value at the masked, scaled index and return. |
- const int kValueOffset = kElementsStartOffset + kPointerSize; |
- __ add(scratch2, scratch2, Operand(kValueOffset - kHeapObjectTag)); |
- __ str(value, MemOperand(scratch2)); |
- |
- // Update the write barrier. Make sure not to clobber the value. |
- __ mov(scratch1, value); |
- __ RecordWrite(elements, scratch2, scratch1, kLRHasNotBeenSaved, |
- kDontSaveFPRegs); |
-} |
- |
-void LoadIC::GenerateNormal(MacroAssembler* masm) { |
- Register dictionary = r0; |
- DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); |
- DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); |
- |
- Label slow; |
- |
- __ ldr(dictionary, FieldMemOperand(LoadDescriptor::ReceiverRegister(), |
- JSObject::kPropertiesOffset)); |
- GenerateDictionaryLoad(masm, &slow, dictionary, |
- LoadDescriptor::NameRegister(), r0, r3, r4); |
- __ Ret(); |
- |
- // Dictionary load failed, go slow (but don't miss). |
- __ bind(&slow); |
- GenerateRuntimeGetProperty(masm); |
-} |
- |
- |
-// A register that isn't one of the parameters to the load ic. |
-static const Register LoadIC_TempRegister() { return r3; } |
- |
-void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
- // The return address is in lr. |
- |
- __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
- __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
- |
- // Do tail-call to runtime routine. |
- __ TailCallRuntime(Runtime::kGetProperty); |
-} |
- |
static void StoreIC_PushArgs(MacroAssembler* masm) { |
__ Push(StoreWithVectorDescriptor::ValueRegister(), |
StoreWithVectorDescriptor::SlotRegister(), |
@@ -169,39 +42,6 @@ void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { |
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow); |
} |
-void StoreIC::GenerateMiss(MacroAssembler* masm) { |
- StoreIC_PushArgs(masm); |
- |
- // Perform tail call to the entry. |
- __ TailCallRuntime(Runtime::kStoreIC_Miss); |
-} |
- |
- |
-void StoreIC::GenerateNormal(MacroAssembler* masm) { |
- Label miss; |
- Register receiver = StoreDescriptor::ReceiverRegister(); |
- Register name = StoreDescriptor::NameRegister(); |
- Register value = StoreDescriptor::ValueRegister(); |
- Register dictionary = r5; |
- DCHECK(receiver.is(r1)); |
- DCHECK(name.is(r2)); |
- DCHECK(value.is(r0)); |
- DCHECK(StoreWithVectorDescriptor::VectorRegister().is(r3)); |
- DCHECK(StoreWithVectorDescriptor::SlotRegister().is(r4)); |
- |
- __ ldr(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
- |
- GenerateDictionaryStore(masm, &miss, dictionary, name, value, r6, r9); |
- Counters* counters = masm->isolate()->counters(); |
- __ IncrementCounter(counters->ic_store_normal_hit(), 1, r6, r9); |
- __ Ret(); |
- |
- __ bind(&miss); |
- __ IncrementCounter(counters->ic_store_normal_miss(), 1, r6, r9); |
- GenerateMiss(masm); |
-} |
- |
- |
#undef __ |