Index: src/ic/ia32/ic-ia32.cc |
diff --git a/src/ic/ia32/ic-ia32.cc b/src/ic/ia32/ic-ia32.cc |
index b9360ced91bb4389e5c2dcc3eff05805edfdaa36..4bf0eaee923144792b06de2ee4d8007a82239b64 100644 |
--- a/src/ic/ia32/ic-ia32.cc |
+++ b/src/ic/ia32/ic-ia32.cc |
@@ -18,141 +18,6 @@ namespace internal { |
#define __ ACCESS_MASM(masm) |
-// Helper function used to load a property from a dictionary backing |
-// storage. This function may fail to load a property even though it is |
-// in the dictionary, so code at miss_label must always call a backup |
-// property load that is complete. This function is safe to call if |
-// name is not internalized, and will jump to the miss_label in that |
-// case. 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_label, |
- Register elements, Register name, |
- Register r0, Register r1, Register result) { |
- // Register use: |
- // |
- // elements - holds the property dictionary on entry and is unchanged. |
- // |
- // name - holds the name of the property on entry and is unchanged. |
- // |
- // Scratch registers: |
- // |
- // r0 - used for the index into the property dictionary |
- // |
- // r1 - used to hold the capacity of the property dictionary. |
- // |
- // result - holds the result on exit. |
- |
- Label done; |
- |
- // Probe the dictionary. |
- NameDictionaryLookupStub::GeneratePositiveLookup(masm, miss_label, &done, |
- elements, name, r0, r1); |
- |
- // If probing finds an entry in the dictionary, r0 contains the |
- // index into the dictionary. Check that the value is a normal |
- // property. |
- __ bind(&done); |
- const int kElementsStartOffset = |
- NameDictionary::kHeaderSize + |
- NameDictionary::kElementsStartIndex * kPointerSize; |
- const int kDetailsOffset = kElementsStartOffset + 2 * kPointerSize; |
- __ test(Operand(elements, r0, times_4, kDetailsOffset - kHeapObjectTag), |
- Immediate(PropertyDetails::TypeField::kMask << kSmiTagSize)); |
- __ j(not_zero, miss_label); |
- |
- // Get the value at the masked, scaled index. |
- const int kValueOffset = kElementsStartOffset + kPointerSize; |
- __ mov(result, Operand(elements, r0, times_4, kValueOffset - kHeapObjectTag)); |
-} |
- |
- |
-// Helper function used to store a property to a dictionary backing |
-// storage. This function may fail to store a property eventhough it |
-// is in the dictionary, so code at miss_label must always call a |
-// backup property store that is complete. This function is safe to |
-// call if name is not internalized, and will jump to the miss_label in |
-// that case. 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_label, |
- Register elements, Register name, |
- Register value, Register r0, Register r1) { |
- // Register use: |
- // |
- // elements - holds the property dictionary on entry and is clobbered. |
- // |
- // name - holds the name of the property on entry and is unchanged. |
- // |
- // value - holds the value to store and is unchanged. |
- // |
- // r0 - used for index into the property dictionary and is clobbered. |
- // |
- // r1 - used to hold the capacity of the property dictionary and is clobbered. |
- Label done; |
- |
- |
- // Probe the dictionary. |
- NameDictionaryLookupStub::GeneratePositiveLookup(masm, miss_label, &done, |
- elements, name, r0, r1); |
- |
- // If probing finds an entry in the dictionary, r0 contains the |
- // index into the dictionary. Check that the value is a normal |
- // property that is not read only. |
- __ bind(&done); |
- 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; |
- __ test(Operand(elements, r0, times_4, kDetailsOffset - kHeapObjectTag), |
- Immediate(kTypeAndReadOnlyMask)); |
- __ j(not_zero, miss_label); |
- |
- // Store the value at the masked, scaled index. |
- const int kValueOffset = kElementsStartOffset + kPointerSize; |
- __ lea(r0, Operand(elements, r0, times_4, kValueOffset - kHeapObjectTag)); |
- __ mov(Operand(r0, 0), value); |
- |
- // Update write barrier. Make sure not to clobber the value. |
- __ mov(r1, value); |
- __ RecordWrite(elements, r0, r1, kDontSaveFPRegs); |
-} |
- |
-void LoadIC::GenerateNormal(MacroAssembler* masm) { |
- Register dictionary = eax; |
- DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); |
- DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); |
- |
- Label slow; |
- |
- __ mov(dictionary, FieldOperand(LoadDescriptor::ReceiverRegister(), |
- JSObject::kPropertiesOffset)); |
- GenerateDictionaryLoad(masm, &slow, dictionary, |
- LoadDescriptor::NameRegister(), edi, ebx, eax); |
- __ ret(0); |
- |
- // Dictionary load failed, go slow (but don't miss). |
- __ bind(&slow); |
- GenerateRuntimeGetProperty(masm); |
-} |
- |
-void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
- // Return address is on the stack. |
- Register receiver = LoadDescriptor::ReceiverRegister(); |
- Register name = LoadDescriptor::NameRegister(); |
- DCHECK(!ebx.is(receiver) && !ebx.is(name)); |
- |
- __ pop(ebx); |
- __ push(receiver); |
- __ push(name); |
- __ push(ebx); |
- |
- // Do tail-call to runtime routine. |
- __ TailCallRuntime(Runtime::kGetProperty); |
-} |
- |
static void StoreIC_PushArgs(MacroAssembler* masm) { |
Register receiver = StoreWithVectorDescriptor::ReceiverRegister(); |
Register name = StoreWithVectorDescriptor::NameRegister(); |
@@ -171,50 +36,6 @@ static void StoreIC_PushArgs(MacroAssembler* masm) { |
__ push(return_address); |
} |
- |
-void StoreIC::GenerateMiss(MacroAssembler* masm) { |
- // Return address is on the stack. |
- StoreIC_PushArgs(masm); |
- |
- // Perform tail call to the entry. |
- __ TailCallRuntime(Runtime::kStoreIC_Miss); |
-} |
- |
- |
-void StoreIC::GenerateNormal(MacroAssembler* masm) { |
- typedef StoreWithVectorDescriptor Descriptor; |
- Label restore_miss; |
- Register receiver = Descriptor::ReceiverRegister(); |
- Register name = Descriptor::NameRegister(); |
- Register value = Descriptor::ValueRegister(); |
- // Since the slot and vector values are passed on the stack we can use |
- // respective registers as scratch registers. |
- Register scratch1 = Descriptor::VectorRegister(); |
- Register scratch2 = Descriptor::SlotRegister(); |
- |
- __ LoadParameterFromStack<Descriptor>(value, Descriptor::kValue); |
- |
- // A lot of registers are needed for storing to slow case objects. |
- // Push and restore receiver but rely on GenerateDictionaryStore preserving |
- // the value and name. |
- __ push(receiver); |
- |
- Register dictionary = receiver; |
- __ mov(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
- GenerateDictionaryStore(masm, &restore_miss, dictionary, name, value, |
- scratch1, scratch2); |
- __ Drop(1); |
- Counters* counters = masm->isolate()->counters(); |
- __ IncrementCounter(counters->ic_store_normal_hit(), 1); |
- __ ret(Descriptor::kStackArgumentsCount * kPointerSize); |
- |
- __ bind(&restore_miss); |
- __ pop(receiver); |
- __ IncrementCounter(counters->ic_store_normal_miss(), 1); |
- GenerateMiss(masm); |
-} |
- |
- |
void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
// Return address is on the stack. |
StoreIC_PushArgs(masm); |