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

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

Issue 2504913002: Revert of [refactoring] Split CodeAssemblerState out of CodeAssembler (Closed)
Patch Set: Created 4 years, 1 month 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-global.cc ('k') | src/builtins/builtins-internal.cc » ('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 2da5a176da77528f01c8c0aec7d25356907ac4d7..88597f8add9afc32824c39405d3d7661ae5495d7 100644
--- a/src/builtins/builtins-handler.cc
+++ b/src/builtins/builtins-handler.cc
@@ -12,19 +12,18 @@
namespace internal {
void Builtins::Generate_KeyedLoadIC_Megamorphic_TF(
- compiler::CodeAssemblerState* state) {
+ CodeStubAssembler* assembler) {
typedef compiler::Node Node;
typedef LoadWithVectorDescriptor Descriptor;
- CodeStubAssembler assembler(state);
- Node* receiver = assembler.Parameter(Descriptor::kReceiver);
- Node* name = assembler.Parameter(Descriptor::kName);
- Node* slot = assembler.Parameter(Descriptor::kSlot);
- Node* vector = assembler.Parameter(Descriptor::kVector);
- Node* context = assembler.Parameter(Descriptor::kContext);
+ Node* receiver = assembler->Parameter(Descriptor::kReceiver);
+ Node* name = assembler->Parameter(Descriptor::kName);
+ Node* slot = assembler->Parameter(Descriptor::kSlot);
+ Node* vector = assembler->Parameter(Descriptor::kVector);
+ Node* context = assembler->Parameter(Descriptor::kContext);
CodeStubAssembler::LoadICParameters p(context, receiver, name, slot, vector);
- assembler.KeyedLoadICGeneric(&p);
+ assembler->KeyedLoadICGeneric(&p);
}
void Builtins::Generate_KeyedLoadIC_Miss(MacroAssembler* masm) {
@@ -42,14 +41,30 @@
KeyedStoreIC::GenerateMegamorphic(masm, STRICT);
}
+void KeyedStoreICMegamorphic(CodeStubAssembler* assembler, LanguageMode mode) {
+ typedef compiler::Node Node;
+ typedef StoreWithVectorDescriptor Descriptor;
+
+ Node* receiver = assembler->Parameter(Descriptor::kReceiver);
+ Node* name = assembler->Parameter(Descriptor::kName);
+ Node* value = assembler->Parameter(Descriptor::kValue);
+ Node* slot = assembler->Parameter(Descriptor::kSlot);
+ Node* vector = assembler->Parameter(Descriptor::kVector);
+ Node* context = assembler->Parameter(Descriptor::kContext);
+
+ CodeStubAssembler::StoreICParameters p(context, receiver, name, value, slot,
+ vector);
+ KeyedStoreGenericGenerator::Generate(assembler, &p, mode);
+}
+
void Builtins::Generate_KeyedStoreIC_Megamorphic_TF(
- compiler::CodeAssemblerState* state) {
- KeyedStoreGenericGenerator::Generate(state, SLOPPY);
+ CodeStubAssembler* assembler) {
+ KeyedStoreICMegamorphic(assembler, SLOPPY);
}
void Builtins::Generate_KeyedStoreIC_Megamorphic_Strict_TF(
- compiler::CodeAssemblerState* state) {
- KeyedStoreGenericGenerator::Generate(state, STRICT);
+ CodeStubAssembler* assembler) {
+ KeyedStoreICMegamorphic(assembler, STRICT);
}
void Builtins::Generate_KeyedStoreIC_Miss(MacroAssembler* masm) {
@@ -60,79 +75,76 @@
KeyedStoreIC::GenerateSlow(masm);
}
-void Builtins::Generate_LoadGlobalIC_Miss(compiler::CodeAssemblerState* state) {
+void Builtins::Generate_LoadGlobalIC_Miss(CodeStubAssembler* assembler) {
typedef compiler::Node Node;
typedef LoadGlobalWithVectorDescriptor Descriptor;
- CodeStubAssembler assembler(state);
- Node* slot = assembler.Parameter(Descriptor::kSlot);
- Node* vector = assembler.Parameter(Descriptor::kVector);
- Node* context = assembler.Parameter(Descriptor::kContext);
+ Node* slot = assembler->Parameter(Descriptor::kSlot);
+ Node* vector = assembler->Parameter(Descriptor::kVector);
+ Node* context = assembler->Parameter(Descriptor::kContext);
- assembler.TailCallRuntime(Runtime::kLoadGlobalIC_Miss, context, slot, vector);
+ assembler->TailCallRuntime(Runtime::kLoadGlobalIC_Miss, context, slot,
+ vector);
}
-void Builtins::Generate_LoadGlobalIC_Slow(compiler::CodeAssemblerState* state) {
+void Builtins::Generate_LoadGlobalIC_Slow(CodeStubAssembler* assembler) {
typedef compiler::Node Node;
typedef LoadGlobalWithVectorDescriptor Descriptor;
- CodeStubAssembler assembler(state);
- Node* slot = assembler.Parameter(Descriptor::kSlot);
- Node* vector = assembler.Parameter(Descriptor::kVector);
- Node* context = assembler.Parameter(Descriptor::kContext);
+ Node* slot = assembler->Parameter(Descriptor::kSlot);
+ Node* vector = assembler->Parameter(Descriptor::kVector);
+ Node* context = assembler->Parameter(Descriptor::kContext);
- assembler.TailCallRuntime(Runtime::kLoadGlobalIC_Slow, context, slot, vector);
+ assembler->TailCallRuntime(Runtime::kLoadGlobalIC_Slow, context, slot,
+ vector);
}
void Builtins::Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) {
NamedLoadHandlerCompiler::GenerateLoadViaGetterForDeopt(masm);
}
-void Builtins::Generate_LoadIC_Miss(compiler::CodeAssemblerState* state) {
+void Builtins::Generate_LoadIC_Miss(CodeStubAssembler* assembler) {
typedef compiler::Node Node;
typedef LoadWithVectorDescriptor Descriptor;
- CodeStubAssembler assembler(state);
- Node* receiver = assembler.Parameter(Descriptor::kReceiver);
- Node* name = assembler.Parameter(Descriptor::kName);
- Node* slot = assembler.Parameter(Descriptor::kSlot);
- Node* vector = assembler.Parameter(Descriptor::kVector);
- Node* context = assembler.Parameter(Descriptor::kContext);
+ Node* receiver = assembler->Parameter(Descriptor::kReceiver);
+ Node* name = assembler->Parameter(Descriptor::kName);
+ Node* slot = assembler->Parameter(Descriptor::kSlot);
+ Node* vector = assembler->Parameter(Descriptor::kVector);
+ Node* context = assembler->Parameter(Descriptor::kContext);
- assembler.TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name,
- slot, vector);
+ assembler->TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name,
+ slot, vector);
}
void Builtins::Generate_LoadIC_Normal(MacroAssembler* masm) {
LoadIC::GenerateNormal(masm);
}
-void Builtins::Generate_LoadIC_Slow(compiler::CodeAssemblerState* state) {
+void Builtins::Generate_LoadIC_Slow(CodeStubAssembler* assembler) {
typedef compiler::Node Node;
typedef LoadWithVectorDescriptor Descriptor;
- CodeStubAssembler assembler(state);
- Node* receiver = assembler.Parameter(Descriptor::kReceiver);
- Node* name = assembler.Parameter(Descriptor::kName);
- Node* context = assembler.Parameter(Descriptor::kContext);
+ Node* receiver = assembler->Parameter(Descriptor::kReceiver);
+ Node* name = assembler->Parameter(Descriptor::kName);
+ Node* context = assembler->Parameter(Descriptor::kContext);
- assembler.TailCallRuntime(Runtime::kGetProperty, context, receiver, name);
+ assembler->TailCallRuntime(Runtime::kGetProperty, context, receiver, name);
}
-void Builtins::Generate_StoreIC_Miss(compiler::CodeAssemblerState* state) {
+void Builtins::Generate_StoreIC_Miss(CodeStubAssembler* assembler) {
typedef compiler::Node Node;
typedef StoreWithVectorDescriptor Descriptor;
- CodeStubAssembler assembler(state);
- Node* receiver = assembler.Parameter(Descriptor::kReceiver);
- Node* name = assembler.Parameter(Descriptor::kName);
- Node* value = assembler.Parameter(Descriptor::kValue);
- Node* slot = assembler.Parameter(Descriptor::kSlot);
- Node* vector = assembler.Parameter(Descriptor::kVector);
- Node* context = assembler.Parameter(Descriptor::kContext);
+ Node* receiver = assembler->Parameter(Descriptor::kReceiver);
+ Node* name = assembler->Parameter(Descriptor::kName);
+ Node* value = assembler->Parameter(Descriptor::kValue);
+ Node* slot = assembler->Parameter(Descriptor::kSlot);
+ Node* vector = assembler->Parameter(Descriptor::kVector);
+ Node* context = assembler->Parameter(Descriptor::kContext);
- assembler.TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot,
- vector, receiver, name);
+ assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot,
+ vector, receiver, name);
}
void Builtins::Generate_StoreIC_Normal(MacroAssembler* masm) {
@@ -144,33 +156,30 @@
}
namespace {
-void Generate_StoreIC_Slow(compiler::CodeAssemblerState* state,
+void Generate_StoreIC_Slow(CodeStubAssembler* assembler,
LanguageMode language_mode) {
typedef compiler::Node Node;
typedef StoreWithVectorDescriptor Descriptor;
- CodeStubAssembler assembler(state);
- Node* receiver = assembler.Parameter(Descriptor::kReceiver);
- Node* name = assembler.Parameter(Descriptor::kName);
- Node* value = assembler.Parameter(Descriptor::kValue);
- Node* context = assembler.Parameter(Descriptor::kContext);
- Node* lang_mode = assembler.SmiConstant(Smi::FromInt(language_mode));
+ Node* receiver = assembler->Parameter(Descriptor::kReceiver);
+ Node* name = assembler->Parameter(Descriptor::kName);
+ Node* value = assembler->Parameter(Descriptor::kValue);
+ Node* context = assembler->Parameter(Descriptor::kContext);
+ Node* lang_mode = assembler->SmiConstant(Smi::FromInt(language_mode));
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
- assembler.TailCallRuntime(Runtime::kSetProperty, context, receiver, name,
- value, lang_mode);
+ assembler->TailCallRuntime(Runtime::kSetProperty, context, receiver, name,
+ value, lang_mode);
}
} // anonymous namespace
-void Builtins::Generate_StoreIC_SlowSloppy(
- compiler::CodeAssemblerState* state) {
- Generate_StoreIC_Slow(state, SLOPPY);
+void Builtins::Generate_StoreIC_SlowSloppy(CodeStubAssembler* assembler) {
+ Generate_StoreIC_Slow(assembler, SLOPPY);
}
-void Builtins::Generate_StoreIC_SlowStrict(
- compiler::CodeAssemblerState* state) {
- Generate_StoreIC_Slow(state, STRICT);
+void Builtins::Generate_StoreIC_SlowStrict(CodeStubAssembler* assembler) {
+ Generate_StoreIC_Slow(assembler, STRICT);
}
} // namespace internal
« no previous file with comments | « src/builtins/builtins-global.cc ('k') | src/builtins/builtins-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698