Index: src/ic/x64/ic-x64.cc |
diff --git a/src/ic/x64/ic-x64.cc b/src/ic/x64/ic-x64.cc |
index de8782510db74b310b80660b151f673d5ee6beb3..587ebd3daa7aab0ebddeabf52bd20d103013c741 100644 |
--- a/src/ic/x64/ic-x64.cc |
+++ b/src/ic/x64/ic-x64.cc |
@@ -18,143 +18,6 @@ namespace internal { |
#define __ ACCESS_MASM(masm) |
-// Helper function used to load a property from a dictionary backing storage. |
-// This function may return false negatives, so miss_label |
-// must always call a backup property load that is complete. |
-// This function is safe to call if name is not an internalized string, |
-// 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. |
- // |
- // r0 - used to hold the capacity of the property dictionary. |
- // |
- // r1 - used to hold the index into the property dictionary. |
- // |
- // result - holds the result on exit if the load succeeded. |
- |
- Label done; |
- |
- // Probe the dictionary. |
- NameDictionaryLookupStub::GeneratePositiveLookup(masm, miss_label, &done, |
- elements, name, r0, r1); |
- |
- // If probing finds an entry in the dictionary, r1 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, r1, times_pointer_size, |
- kDetailsOffset - kHeapObjectTag), |
- Smi::FromInt(PropertyDetails::TypeField::kMask)); |
- __ j(not_zero, miss_label); |
- |
- // Get the value at the masked, scaled index. |
- const int kValueOffset = kElementsStartOffset + kPointerSize; |
- __ movp(result, Operand(elements, r1, times_pointer_size, |
- kValueOffset - kHeapObjectTag)); |
-} |
- |
- |
-// Helper function used to store a property to a dictionary backing |
-// storage. This function may fail to store a property even though 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 an internalized string, 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 scratch0, |
- Register scratch1) { |
- // 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. |
- // |
- // scratch0 - used during the positive dictionary lookup and is clobbered. |
- // |
- // scratch1 - used for index into the property dictionary and is clobbered. |
- Label done; |
- |
- // Probe the dictionary. |
- NameDictionaryLookupStub::GeneratePositiveLookup( |
- masm, miss_label, &done, elements, name, scratch0, scratch1); |
- |
- // If probing finds an entry in the dictionary, scratch0 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); |
- __ Test(Operand(elements, scratch1, times_pointer_size, |
- kDetailsOffset - kHeapObjectTag), |
- Smi::FromInt(kTypeAndReadOnlyMask)); |
- __ j(not_zero, miss_label); |
- |
- // Store the value at the masked, scaled index. |
- const int kValueOffset = kElementsStartOffset + kPointerSize; |
- __ leap(scratch1, Operand(elements, scratch1, times_pointer_size, |
- kValueOffset - kHeapObjectTag)); |
- __ movp(Operand(scratch1, 0), value); |
- |
- // Update write barrier. Make sure not to clobber the value. |
- __ movp(scratch0, value); |
- __ RecordWrite(elements, scratch1, scratch0, kDontSaveFPRegs); |
-} |
- |
-void LoadIC::GenerateNormal(MacroAssembler* masm) { |
- Register dictionary = rax; |
- DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); |
- DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); |
- |
- Label slow; |
- |
- __ movp(dictionary, FieldOperand(LoadDescriptor::ReceiverRegister(), |
- JSObject::kPropertiesOffset)); |
- GenerateDictionaryLoad(masm, &slow, dictionary, |
- LoadDescriptor::NameRegister(), rbx, rdi, rax); |
- __ ret(0); |
- |
- // Dictionary load failed, go slow (but don't miss). |
- __ bind(&slow); |
- LoadIC::GenerateRuntimeGetProperty(masm); |
-} |
- |
-void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
- // The return address is on the stack. |
- Register receiver = LoadDescriptor::ReceiverRegister(); |
- Register name = LoadDescriptor::NameRegister(); |
- |
- DCHECK(!rbx.is(receiver) && !rbx.is(name)); |
- |
- __ PopReturnAddressTo(rbx); |
- __ Push(receiver); |
- __ Push(name); |
- __ PushReturnAddressFrom(rbx); |
- |
- // Do tail-call to runtime routine. |
- __ TailCallRuntime(Runtime::kGetProperty); |
-} |
- |
static void StoreIC_PushArgs(MacroAssembler* masm) { |
Register receiver = StoreWithVectorDescriptor::ReceiverRegister(); |
Register name = StoreWithVectorDescriptor::NameRegister(); |
@@ -173,38 +36,6 @@ static void StoreIC_PushArgs(MacroAssembler* masm) { |
__ PushReturnAddressFrom(temp); |
} |
- |
-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) { |
- Register receiver = StoreDescriptor::ReceiverRegister(); |
- Register name = StoreDescriptor::NameRegister(); |
- Register value = StoreDescriptor::ValueRegister(); |
- Register dictionary = r11; |
- DCHECK(!AreAliased(dictionary, StoreWithVectorDescriptor::VectorRegister(), |
- StoreWithVectorDescriptor::SlotRegister())); |
- |
- Label miss; |
- |
- __ movp(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
- GenerateDictionaryStore(masm, &miss, dictionary, name, value, r8, r9); |
- Counters* counters = masm->isolate()->counters(); |
- __ IncrementCounter(counters->ic_store_normal_hit(), 1); |
- __ ret(0); |
- |
- __ bind(&miss); |
- __ IncrementCounter(counters->ic_store_normal_miss(), 1); |
- GenerateMiss(masm); |
-} |
- |
- |
void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
// Return address is on the stack. |
StoreIC_PushArgs(masm); |