Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: src/builtins/builtins-handler.cc

Issue 2622003004: [ic] Port {Load,Store}IC_Normal to TF (Closed)
Patch Set: fix nit Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins.h ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/builtins/builtins.h ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698