Index: src/builtins/builtins-handler.cc |
diff --git a/src/builtins/builtins-handler.cc b/src/builtins/builtins-handler.cc |
index d48e564255ffa38190a07d3ba49b0e5b0d7a9e5d..42b35d0d2f7778e6384fe108a88d033750cb5cff 100644 |
--- a/src/builtins/builtins-handler.cc |
+++ b/src/builtins/builtins-handler.cc |
@@ -108,8 +108,34 @@ void Builtins::Generate_LoadIC_Miss(compiler::CodeAssemblerState* state) { |
slot, vector); |
} |
-void Builtins::Generate_LoadIC_Normal(MacroAssembler* masm) { |
- LoadIC::GenerateNormal(masm); |
+TF_BUILTIN(LoadIC_Normal, CodeStubAssembler) { |
+ typedef LoadWithVectorDescriptor Descriptor; |
+ |
+ Node* receiver = Parameter(Descriptor::kReceiver); |
+ Node* name = Parameter(Descriptor::kName); |
+ Node* context = Parameter(Descriptor::kContext); |
+ |
+ Label slow(this); |
+ { |
+ Node* properties = LoadProperties(receiver); |
+ Variable var_name_index(this, MachineType::PointerRepresentation()); |
+ Label found(this, &var_name_index); |
+ NameDictionaryLookup<NameDictionary>(properties, name, &found, |
+ &var_name_index, &slow); |
+ Bind(&found); |
+ { |
+ Variable var_details(this, MachineRepresentation::kWord32); |
+ Variable var_value(this, MachineRepresentation::kTagged); |
+ LoadPropertyFromNameDictionary(properties, var_name_index.value(), |
+ &var_details, &var_value); |
+ Node* value = CallGetterIfAccessor(var_value.value(), var_details.value(), |
+ context, receiver, &slow); |
+ Return(value); |
+ } |
+ } |
+ |
+ Bind(&slow); |
+ TailCallRuntime(Runtime::kGetProperty, context, receiver, name); |
} |
void Builtins::Generate_LoadIC_Slow(compiler::CodeAssemblerState* state) { |
@@ -140,8 +166,47 @@ void Builtins::Generate_StoreIC_Miss(compiler::CodeAssemblerState* state) { |
vector, receiver, name); |
} |
-void Builtins::Generate_StoreIC_Normal(MacroAssembler* masm) { |
- StoreIC::GenerateNormal(masm); |
+TF_BUILTIN(StoreIC_Normal, CodeStubAssembler) { |
+ typedef StoreWithVectorDescriptor Descriptor; |
+ |
+ Node* receiver = Parameter(Descriptor::kReceiver); |
+ Node* name = Parameter(Descriptor::kName); |
+ Node* value = Parameter(Descriptor::kValue); |
+ Node* slot = Parameter(Descriptor::kSlot); |
+ Node* vector = Parameter(Descriptor::kVector); |
+ Node* context = Parameter(Descriptor::kContext); |
+ |
+ Label slow(this); |
+ { |
+ Node* properties = LoadProperties(receiver); |
+ Variable var_name_index(this, MachineType::PointerRepresentation()); |
+ Label found(this, &var_name_index); |
+ NameDictionaryLookup<NameDictionary>(properties, name, &found, |
+ &var_name_index, &slow); |
+ Bind(&found); |
+ { |
+ const int kNameToDetailsOffset = (NameDictionary::kEntryDetailsIndex - |
+ NameDictionary::kEntryKeyIndex) * |
+ kPointerSize; |
+ Node* details = LoadFixedArrayElement(properties, var_name_index.value(), |
+ kNameToDetailsOffset); |
+ // Check that the property is a writable data property (no accessor). |
+ const int kTypeAndReadOnlyMask = PropertyDetails::KindField::kMask | |
+ PropertyDetails::kAttributesReadOnlyMask; |
+ STATIC_ASSERT(kData == 0); |
+ GotoIf(IsSetSmi(details, kTypeAndReadOnlyMask), &slow); |
+ const int kNameToValueOffset = |
+ (NameDictionary::kEntryValueIndex - NameDictionary::kEntryKeyIndex) * |
+ kPointerSize; |
+ StoreFixedArrayElement(properties, var_name_index.value(), value, |
+ UPDATE_WRITE_BARRIER, kNameToValueOffset); |
+ Return(value); |
+ } |
+ } |
+ |
+ Bind(&slow); |
+ TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, vector, |
+ receiver, name); |
} |
void Builtins::Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { |