Commit 89f5efb7 authored by jkummerow's avatar jkummerow Committed by Commit bot

[ic] Clean up handler boilerplate

- builtins-ic.cc takes the place of the AccessorAssembler shim
- AccessorAssemblerImpl can then be renamed
- some cleanup in code-factory.cc
- drop old _TF name suffixes
- fix Generate##Name##Impl in TF_BUILTIN macro

Review-Url: https://codereview.chromium.org/2647493002
Cr-Commit-Position: refs/heads/master@{#42520}
parent 5e44cc79
......@@ -1455,7 +1455,6 @@ v8_source_set("v8_base") {
"src/ic/access-compiler-data.h",
"src/ic/access-compiler.cc",
"src/ic/access-compiler.h",
"src/ic/accessor-assembler-impl.h",
"src/ic/accessor-assembler.cc",
"src/ic/accessor-assembler.h",
"src/ic/call-optimization.cc",
......
......@@ -5,7 +5,6 @@
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/ic/accessor-assembler.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
#include "src/ic/keyed-store-generic.h"
......@@ -13,45 +12,35 @@
namespace v8 {
namespace internal {
void Builtins::Generate_KeyedLoadIC_Megamorphic_TF(
compiler::CodeAssemblerState* state) {
AccessorAssembler::GenerateKeyedLoadICMegamorphic(state);
}
void Builtins::Generate_KeyedLoadIC_Miss(compiler::CodeAssemblerState* state) {
typedef compiler::Node Node;
TF_BUILTIN(KeyedLoadIC_Miss, CodeStubAssembler) {
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 = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
Node* slot = Parameter(Descriptor::kSlot);
Node* vector = Parameter(Descriptor::kVector);
Node* context = Parameter(Descriptor::kContext);
assembler.TailCallRuntime(Runtime::kKeyedLoadIC_Miss, context, receiver, name,
slot, vector);
TailCallRuntime(Runtime::kKeyedLoadIC_Miss, context, receiver, name, slot,
vector);
}
void Builtins::Generate_KeyedLoadIC_Slow(compiler::CodeAssemblerState* state) {
typedef compiler::Node Node;
TF_BUILTIN(KeyedLoadIC_Slow, CodeStubAssembler) {
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 = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
Node* context = Parameter(Descriptor::kContext);
assembler.TailCallRuntime(Runtime::kKeyedGetProperty, context, receiver,
name);
TailCallRuntime(Runtime::kKeyedGetProperty, context, receiver, name);
}
void Builtins::Generate_KeyedStoreIC_Megamorphic_TF(
void Builtins::Generate_KeyedStoreIC_Megamorphic(
compiler::CodeAssemblerState* state) {
KeyedStoreGenericGenerator::Generate(state, SLOPPY);
}
void Builtins::Generate_KeyedStoreIC_Megamorphic_Strict_TF(
void Builtins::Generate_KeyedStoreIC_Megamorphic_Strict(
compiler::CodeAssemblerState* state) {
KeyedStoreGenericGenerator::Generate(state, STRICT);
}
......@@ -64,48 +53,40 @@ void Builtins::Generate_KeyedStoreIC_Slow(MacroAssembler* masm) {
KeyedStoreIC::GenerateSlow(masm);
}
void Builtins::Generate_LoadGlobalIC_Miss(compiler::CodeAssemblerState* state) {
typedef compiler::Node Node;
TF_BUILTIN(LoadGlobalIC_Miss, CodeStubAssembler) {
typedef LoadGlobalWithVectorDescriptor Descriptor;
CodeStubAssembler assembler(state);
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* name = Parameter(Descriptor::kName);
Node* slot = Parameter(Descriptor::kSlot);
Node* vector = Parameter(Descriptor::kVector);
Node* context = Parameter(Descriptor::kContext);
assembler.TailCallRuntime(Runtime::kLoadGlobalIC_Miss, context, name, slot,
vector);
TailCallRuntime(Runtime::kLoadGlobalIC_Miss, context, name, slot, vector);
}
void Builtins::Generate_LoadGlobalIC_Slow(compiler::CodeAssemblerState* state) {
typedef compiler::Node Node;
TF_BUILTIN(LoadGlobalIC_Slow, CodeStubAssembler) {
typedef LoadGlobalWithVectorDescriptor Descriptor;
CodeStubAssembler assembler(state);
Node* name = assembler.Parameter(Descriptor::kName);
Node* context = assembler.Parameter(Descriptor::kContext);
Node* name = Parameter(Descriptor::kName);
Node* context = Parameter(Descriptor::kContext);
assembler.TailCallRuntime(Runtime::kLoadGlobalIC_Slow, context, name);
TailCallRuntime(Runtime::kLoadGlobalIC_Slow, context, name);
}
void Builtins::Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) {
NamedLoadHandlerCompiler::GenerateLoadViaGetterForDeopt(masm);
}
void Builtins::Generate_LoadIC_Miss(compiler::CodeAssemblerState* state) {
typedef compiler::Node Node;
TF_BUILTIN(LoadIC_Miss, CodeStubAssembler) {
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 = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
Node* slot = Parameter(Descriptor::kSlot);
Node* vector = Parameter(Descriptor::kVector);
Node* context = Parameter(Descriptor::kContext);
assembler.TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name,
slot, vector);
TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name, slot, vector);
}
TF_BUILTIN(LoadIC_Normal, CodeStubAssembler) {
......@@ -138,32 +119,28 @@ TF_BUILTIN(LoadIC_Normal, CodeStubAssembler) {
TailCallRuntime(Runtime::kGetProperty, context, receiver, name);
}
void Builtins::Generate_LoadIC_Slow(compiler::CodeAssemblerState* state) {
typedef compiler::Node Node;
TF_BUILTIN(LoadIC_Slow, CodeStubAssembler) {
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 = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
Node* context = Parameter(Descriptor::kContext);
assembler.TailCallRuntime(Runtime::kGetProperty, context, receiver, name);
TailCallRuntime(Runtime::kGetProperty, context, receiver, name);
}
void Builtins::Generate_StoreIC_Miss(compiler::CodeAssemblerState* state) {
typedef compiler::Node Node;
TF_BUILTIN(StoreIC_Miss, CodeStubAssembler) {
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 = 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);
assembler.TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot,
vector, receiver, name);
TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, vector,
receiver, name);
}
TF_BUILTIN(StoreIC_Normal, CodeStubAssembler) {
......
......@@ -4,75 +4,47 @@
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/ic/accessor-assembler.h"
namespace v8 {
namespace internal {
TF_BUILTIN(LoadIC, CodeStubAssembler) {
AccessorAssembler::GenerateLoadIC(state());
}
TF_BUILTIN(KeyedLoadIC, CodeStubAssembler) {
AccessorAssembler::GenerateKeyedLoadICTF(state());
}
TF_BUILTIN(LoadICTrampoline, CodeStubAssembler) {
AccessorAssembler::GenerateLoadICTrampoline(state());
}
TF_BUILTIN(KeyedLoadICTrampoline, CodeStubAssembler) {
AccessorAssembler::GenerateKeyedLoadICTrampolineTF(state());
}
TF_BUILTIN(StoreIC, CodeStubAssembler) {
AccessorAssembler::GenerateStoreIC(state());
}
TF_BUILTIN(StoreICTrampoline, CodeStubAssembler) {
AccessorAssembler::GenerateStoreICTrampoline(state());
}
TF_BUILTIN(StoreICStrict, CodeStubAssembler) {
AccessorAssembler::GenerateStoreIC(state());
}
TF_BUILTIN(StoreICStrictTrampoline, CodeStubAssembler) {
AccessorAssembler::GenerateStoreICTrampoline(state());
}
TF_BUILTIN(KeyedStoreIC, CodeStubAssembler) {
AccessorAssembler::GenerateKeyedStoreICTF(state(), SLOPPY);
}
TF_BUILTIN(KeyedStoreICTrampoline, CodeStubAssembler) {
AccessorAssembler::GenerateKeyedStoreICTrampolineTF(state(), SLOPPY);
}
TF_BUILTIN(KeyedStoreICStrict, CodeStubAssembler) {
AccessorAssembler::GenerateKeyedStoreICTF(state(), STRICT);
}
TF_BUILTIN(KeyedStoreICStrictTrampoline, CodeStubAssembler) {
AccessorAssembler::GenerateKeyedStoreICTrampolineTF(state(), STRICT);
}
TF_BUILTIN(LoadGlobalIC, CodeStubAssembler) {
AccessorAssembler::GenerateLoadGlobalIC(state(), NOT_INSIDE_TYPEOF);
}
TF_BUILTIN(LoadGlobalICInsideTypeof, CodeStubAssembler) {
AccessorAssembler::GenerateLoadGlobalIC(state(), INSIDE_TYPEOF);
}
TF_BUILTIN(LoadGlobalICTrampoline, CodeStubAssembler) {
AccessorAssembler::GenerateLoadGlobalICTrampoline(state(), NOT_INSIDE_TYPEOF);
}
TF_BUILTIN(LoadGlobalICInsideTypeofTrampoline, CodeStubAssembler) {
AccessorAssembler::GenerateLoadGlobalICTrampoline(state(), INSIDE_TYPEOF);
}
#define IC_BUILTIN(Name) \
void Builtins::Generate_##Name(compiler::CodeAssemblerState* state) { \
AccessorAssembler assembler(state); \
assembler.Generate##Name(); \
}
#define IC_BUILTIN_PARAM(BuiltinName, GeneratorName, parameter) \
void Builtins::Generate_##BuiltinName(compiler::CodeAssemblerState* state) { \
AccessorAssembler assembler(state); \
assembler.Generate##GeneratorName(parameter); \
}
IC_BUILTIN(LoadIC)
IC_BUILTIN(KeyedLoadIC)
IC_BUILTIN(LoadICTrampoline)
IC_BUILTIN(LoadField)
IC_BUILTIN(KeyedLoadICTrampoline)
IC_BUILTIN(KeyedLoadIC_Megamorphic)
IC_BUILTIN(StoreIC)
IC_BUILTIN(StoreICTrampoline)
IC_BUILTIN_PARAM(StoreICStrict, StoreIC, /* no param */)
IC_BUILTIN_PARAM(StoreICStrictTrampoline, StoreICTrampoline, /* no param */)
IC_BUILTIN_PARAM(KeyedStoreIC, KeyedStoreIC, SLOPPY)
IC_BUILTIN_PARAM(KeyedStoreICTrampoline, KeyedStoreICTrampoline, SLOPPY)
IC_BUILTIN_PARAM(KeyedStoreICStrict, KeyedStoreIC, STRICT)
IC_BUILTIN_PARAM(KeyedStoreICStrictTrampoline, KeyedStoreICTrampoline, STRICT)
IC_BUILTIN_PARAM(LoadGlobalIC, LoadGlobalIC, NOT_INSIDE_TYPEOF)
IC_BUILTIN_PARAM(LoadGlobalICInsideTypeof, LoadGlobalIC, INSIDE_TYPEOF)
IC_BUILTIN_PARAM(LoadGlobalICTrampoline, LoadGlobalICTrampoline,
NOT_INSIDE_TYPEOF)
IC_BUILTIN_PARAM(LoadGlobalICInsideTypeofTrampoline, LoadGlobalICTrampoline,
INSIDE_TYPEOF)
IC_BUILTIN_PARAM(LoadICProtoArray, LoadICProtoArray, false)
IC_BUILTIN_PARAM(LoadICProtoArrayThrowIfNonexistent, LoadICProtoArray, true)
} // namespace internal
} // namespace v8
......@@ -121,13 +121,13 @@ class BuiltinArguments : public Arguments {
public: \
explicit Name##Assembler(compiler::CodeAssemblerState* state) \
: AssemblerBase(state) {} \
void Generate##NameImpl(); \
void Generate##Name##Impl(); \
}; \
void Builtins::Generate_##Name(compiler::CodeAssemblerState* state) { \
Name##Assembler assembler(state); \
assembler.Generate##NameImpl(); \
assembler.Generate##Name##Impl(); \
} \
void Name##Assembler::Generate##NameImpl()
void Name##Assembler::Generate##Name##Impl()
// ----------------------------------------------------------------------------
......
......@@ -212,18 +212,21 @@ namespace internal {
TFS(GetSuperConstructor, BUILTIN, kNoExtraICState, TypeConversion) \
\
/* Handlers */ \
TFS(KeyedLoadIC_Megamorphic_TF, KEYED_LOAD_IC, kNoExtraICState, \
LoadWithVector) \
TFS(LoadICProtoArray, HANDLER, Code::LOAD_IC, LoadICProtoArray) \
TFS(LoadICProtoArrayThrowIfNonexistent, HANDLER, Code::LOAD_IC, \
LoadICProtoArray) \
TFS(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState, LoadWithVector) \
TFS(KeyedLoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \
TFS(KeyedLoadIC_Slow, HANDLER, Code::KEYED_LOAD_IC, LoadWithVector) \
TFS(KeyedStoreIC_Megamorphic_TF, KEYED_STORE_IC, kNoExtraICState, \
TFS(KeyedStoreIC_Megamorphic, KEYED_STORE_IC, kNoExtraICState, \
StoreWithVector) \
TFS(KeyedStoreIC_Megamorphic_Strict_TF, KEYED_STORE_IC, \
TFS(KeyedStoreIC_Megamorphic_Strict, KEYED_STORE_IC, \
StoreICState::kStrictModeState, StoreWithVector) \
ASM(KeyedStoreIC_Miss) \
ASH(KeyedStoreIC_Slow, HANDLER, Code::KEYED_STORE_IC) \
TFS(LoadGlobalIC_Miss, BUILTIN, kNoExtraICState, LoadGlobalWithVector) \
TFS(LoadGlobalIC_Slow, HANDLER, Code::LOAD_GLOBAL_IC, LoadGlobalWithVector) \
TFS(LoadField, HANDLER, Code::LOAD_IC, LoadField) \
ASH(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \
TFS(LoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \
TFS(LoadIC_Normal, HANDLER, Code::LOAD_IC, LoadWithVector) \
......
......@@ -33,6 +33,16 @@ Callable CodeFactory::LoadIC(Isolate* isolate) {
LoadDescriptor(isolate));
}
// static
Callable CodeFactory::LoadICProtoArray(Isolate* isolate,
bool throw_if_nonexistent) {
return Callable(
throw_if_nonexistent
? isolate->builtins()->LoadICProtoArrayThrowIfNonexistent()
: isolate->builtins()->LoadICProtoArray(),
LoadICProtoArrayDescriptor(isolate));
}
// static
Callable CodeFactory::ApiGetter(Isolate* isolate) {
CallApiGetterStub stub(isolate);
......@@ -75,12 +85,6 @@ Callable CodeFactory::KeyedLoadICInOptimizedCode(Isolate* isolate) {
LoadWithVectorDescriptor(isolate));
}
// static
Callable CodeFactory::KeyedLoadIC_Megamorphic(Isolate* isolate) {
return Callable(isolate->builtins()->KeyedLoadIC_Megamorphic_TF(),
LoadWithVectorDescriptor(isolate));
}
// static
Callable CodeFactory::CallIC(Isolate* isolate, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
......@@ -133,11 +137,10 @@ Callable CodeFactory::KeyedStoreICInOptimizedCode(Isolate* isolate,
// static
Callable CodeFactory::KeyedStoreIC_Megamorphic(Isolate* isolate,
LanguageMode language_mode) {
return Callable(
language_mode == STRICT
? isolate->builtins()->KeyedStoreIC_Megamorphic_Strict_TF()
: isolate->builtins()->KeyedStoreIC_Megamorphic_TF(),
StoreWithVectorDescriptor(isolate));
return Callable(language_mode == STRICT
? isolate->builtins()->KeyedStoreIC_Megamorphic_Strict()
: isolate->builtins()->KeyedStoreIC_Megamorphic(),
StoreWithVectorDescriptor(isolate));
}
// static
......@@ -158,36 +161,6 @@ Callable CodeFactory::GetProperty(Isolate* isolate) {
return make_callable(stub);
}
// static
Callable CodeFactory::ToBoolean(Isolate* isolate) {
return Callable(isolate->builtins()->ToBoolean(),
TypeConversionDescriptor(isolate));
}
// static
Callable CodeFactory::ToNumber(Isolate* isolate) {
return Callable(isolate->builtins()->ToNumber(),
TypeConversionDescriptor(isolate));
}
// static
Callable CodeFactory::NonNumberToNumber(Isolate* isolate) {
return Callable(isolate->builtins()->NonNumberToNumber(),
TypeConversionDescriptor(isolate));
}
// static
Callable CodeFactory::StringToNumber(Isolate* isolate) {
return Callable(isolate->builtins()->StringToNumber(),
TypeConversionDescriptor(isolate));
}
// static
Callable CodeFactory::ToName(Isolate* isolate) {
return Callable(isolate->builtins()->ToName(),
TypeConversionDescriptor(isolate));
}
// static
Callable CodeFactory::NonPrimitiveToPrimitive(Isolate* isolate,
ToPrimitiveHint hint) {
......@@ -254,19 +227,37 @@ TFS_BUILTIN(StrictEqual)
TFS_BUILTIN(StrictNotEqual)
TFS_BUILTIN(CreateIterResultObject)
TFS_BUILTIN(HasProperty)
TFS_BUILTIN(NonNumberToNumber)
TFS_BUILTIN(StringToNumber)
TFS_BUILTIN(ToBoolean)
TFS_BUILTIN(ToInteger)
TFS_BUILTIN(ToLength)
TFS_BUILTIN(ToName)
TFS_BUILTIN(ToNumber)
TFS_BUILTIN(ToObject)
TFS_BUILTIN(Typeof)
TFS_BUILTIN(InstanceOf)
TFS_BUILTIN(OrdinaryHasInstance)
TFS_BUILTIN(ForInFilter)
TFS_BUILTIN(CopyFastSmiOrObjectElements)
TFS_BUILTIN(GrowFastDoubleElements)
TFS_BUILTIN(GrowFastSmiOrObjectElements)
TFS_BUILTIN(NewUnmappedArgumentsElements)
TFS_BUILTIN(NewRestParameterElements)
TFS_BUILTIN(PromiseHandleReject)
TFS_BUILTIN(FastCloneRegExp)
TFS_BUILTIN(FastNewClosure)
TFS_BUILTIN(FastNewObject)
TFS_BUILTIN(ForInFilter)
TFS_BUILTIN(GetSuperConstructor)
TFS_BUILTIN(KeyedLoadIC_Megamorphic)
TFS_BUILTIN(PromiseHandleReject)
TFS_BUILTIN(StringCharAt)
TFS_BUILTIN(StringCharCodeAt)
TFS_BUILTIN(StringEqual)
TFS_BUILTIN(StringNotEqual)
TFS_BUILTIN(StringLessThan)
TFS_BUILTIN(StringLessThanOrEqual)
TFS_BUILTIN(StringGreaterThan)
TFS_BUILTIN(StringGreaterThanOrEqual)
#undef TFS_BUILTIN
......@@ -301,42 +292,6 @@ Callable CodeFactory::StringCompare(Isolate* isolate, Token::Value token) {
return StringEqual(isolate);
}
// static
Callable CodeFactory::StringEqual(Isolate* isolate) {
return Callable(isolate->builtins()->StringEqual(),
CompareDescriptor(isolate));
}
// static
Callable CodeFactory::StringNotEqual(Isolate* isolate) {
return Callable(isolate->builtins()->StringNotEqual(),
CompareDescriptor(isolate));
}
// static
Callable CodeFactory::StringLessThan(Isolate* isolate) {
return Callable(isolate->builtins()->StringLessThan(),
CompareDescriptor(isolate));
}
// static
Callable CodeFactory::StringLessThanOrEqual(Isolate* isolate) {
return Callable(isolate->builtins()->StringLessThanOrEqual(),
CompareDescriptor(isolate));
}
// static
Callable CodeFactory::StringGreaterThan(Isolate* isolate) {
return Callable(isolate->builtins()->StringGreaterThan(),
CompareDescriptor(isolate));
}
// static
Callable CodeFactory::StringGreaterThanOrEqual(Isolate* isolate) {
return Callable(isolate->builtins()->StringGreaterThanOrEqual(),
CompareDescriptor(isolate));
}
// static
Callable CodeFactory::SubString(Isolate* isolate) {
SubStringStub stub(isolate);
......@@ -349,12 +304,6 @@ Callable CodeFactory::ResumeGenerator(Isolate* isolate) {
ResumeGeneratorDescriptor(isolate));
}
// static
Callable CodeFactory::FastCloneRegExp(Isolate* isolate) {
return Callable(isolate->builtins()->FastCloneRegExp(),
FastCloneRegExpDescriptor(isolate));
}
// static
Callable CodeFactory::FastCloneShallowArray(
Isolate* isolate, AllocationSiteMode allocation_mode) {
......@@ -375,18 +324,6 @@ Callable CodeFactory::FastNewFunctionContext(Isolate* isolate,
FastNewFunctionContextDescriptor(isolate));
}
// static
Callable CodeFactory::FastNewClosure(Isolate* isolate) {
return Callable(isolate->builtins()->FastNewClosure(),
FastNewClosureDescriptor(isolate));
}
// static
Callable CodeFactory::FastNewObject(Isolate* isolate) {
return Callable(isolate->builtins()->FastNewObject(),
FastNewObjectDescriptor(isolate));
}
// static
Callable CodeFactory::FastNewRestParameter(Isolate* isolate,
bool skip_stub_frame) {
......@@ -408,24 +345,6 @@ Callable CodeFactory::FastNewStrictArguments(Isolate* isolate,
return make_callable(stub);
}
// static
Callable CodeFactory::CopyFastSmiOrObjectElements(Isolate* isolate) {
return Callable(isolate->builtins()->CopyFastSmiOrObjectElements(),
CopyFastSmiOrObjectElementsDescriptor(isolate));
}
// static
Callable CodeFactory::GrowFastDoubleElements(Isolate* isolate) {
return Callable(isolate->builtins()->GrowFastDoubleElements(),
GrowArrayElementsDescriptor(isolate));
}
// static
Callable CodeFactory::GrowFastSmiOrObjectElements(Isolate* isolate) {
return Callable(isolate->builtins()->GrowFastSmiOrObjectElements(),
GrowArrayElementsDescriptor(isolate));
}
// static
Callable CodeFactory::AllocateHeapNumber(Isolate* isolate) {
AllocateHeapNumberStub stub(isolate);
......
......@@ -39,6 +39,7 @@ class V8_EXPORT_PRIVATE CodeFactory final {
// Initial states for ICs.
static Callable LoadIC(Isolate* isolate);
static Callable LoadICInOptimizedCode(Isolate* isolate);
static Callable LoadICProtoArray(Isolate* isolate, bool throw_if_nonexistent);
static Callable LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode);
static Callable LoadGlobalICInOptimizedCode(Isolate* isolate,
TypeofMode typeof_mode);
......
......@@ -12,8 +12,6 @@
#include "src/code-stub-assembler.h"
#include "src/factory.h"
#include "src/gdb-jit.h"
#include "src/ic/accessor-assembler.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic-stats.h"
#include "src/ic/ic.h"
#include "src/macro-assembler.h"
......@@ -439,11 +437,6 @@ Handle<Code> TurboFanCodeStub::GenerateCode() {
return compiler::CodeAssembler::GenerateCode(&state);
}
void LoadICProtoArrayStub::GenerateAssembly(CodeAssemblerState* state) const {
AccessorAssembler::GenerateLoadICProtoArray(
state, throw_reference_error_if_nonexistent());
}
void ElementsTransitionAndStoreStub::GenerateAssembly(
compiler::CodeAssemblerState* state) const {
typedef CodeStubAssembler::Label Label;
......@@ -1618,11 +1611,6 @@ void StoreGlobalStub::GenerateAssembly(
}
}
void LoadFieldStub::GenerateAssembly(
compiler::CodeAssemblerState* state) const {
AccessorAssembler::GenerateLoadField(state);
}
void KeyedLoadSloppyArgumentsStub::GenerateAssembly(
compiler::CodeAssemblerState* state) const {
typedef CodeStubAssembler::Label Label;
......@@ -1779,25 +1767,6 @@ void JSEntryStub::FinishCode(Handle<Code> code) {
code->set_handler_table(*handler_table);
}
void HandlerStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
DCHECK(kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC);
if (kind() == Code::KEYED_LOAD_IC) {
descriptor->Initialize(
FUNCTION_ADDR(Runtime_KeyedLoadIC_MissFromStubFailure));
}
}
CallInterfaceDescriptor HandlerStub::GetCallInterfaceDescriptor() const {
if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) {
return LoadWithVectorDescriptor(isolate());
} else {
DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC);
return StoreWithVectorDescriptor(isolate());
}
}
void TransitionElementsKindStub::InitializeDescriptor(
CodeStubDescriptor* descriptor) {
descriptor->Initialize(
......
......@@ -102,13 +102,11 @@ class Node;
V(NumberToString) \
V(StringAdd) \
V(GetProperty) \
V(LoadICProtoArray) \
V(StoreFastElement) \
V(StoreGlobal) \
V(StoreInterceptor) \
V(LoadApiGetter) \
V(LoadIndexedInterceptor) \
V(LoadField) \
V(GrowArrayElements)
// List of code stubs only used on ARM 32 bits platforms.
......@@ -979,36 +977,6 @@ class LoadIndexedStringStub : public PlatformCodeStub {
DEFINE_PLATFORM_CODE_STUB(LoadIndexedString, PlatformCodeStub);
};
class HandlerStub : public HydrogenCodeStub {
public:
Code::Kind GetCodeKind() const override { return Code::HANDLER; }
ExtraICState GetExtraICState() const override { return kind(); }
void InitializeDescriptor(CodeStubDescriptor* descriptor) override;
CallInterfaceDescriptor GetCallInterfaceDescriptor() const override;
protected:
explicit HandlerStub(Isolate* isolate) : HydrogenCodeStub(isolate) {}
virtual Code::Kind kind() const = 0;
DEFINE_CODE_STUB_BASE(HandlerStub, HydrogenCodeStub);
};
class LoadFieldStub : public TurboFanCodeStub {
public:
explicit LoadFieldStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
Code::Kind GetCodeKind() const override { return Code::HANDLER; }
ExtraICState GetExtraICState() const override { return GetCodeKind(); }
private:
DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadField);
DEFINE_TURBOFAN_CODE_STUB(LoadField, TurboFanCodeStub);
};
class KeyedLoadSloppyArgumentsStub : public TurboFanCodeStub {
public:
explicit KeyedLoadSloppyArgumentsStub(Isolate* isolate)
......@@ -1649,30 +1617,6 @@ class CallICTrampolineStub : public PlatformCodeStub {
DEFINE_PLATFORM_CODE_STUB(CallICTrampoline, PlatformCodeStub);
};
class LoadICProtoArrayStub : public TurboFanCodeStub {
public:
explicit LoadICProtoArrayStub(Isolate* isolate,
bool throw_reference_error_if_nonexistent)
: TurboFanCodeStub(isolate) {
minor_key_ = ThrowReferenceErrorIfNonexistentBits::encode(
throw_reference_error_if_nonexistent);
}
bool throw_reference_error_if_nonexistent() const {
return ThrowReferenceErrorIfNonexistentBits::decode(minor_key_);
}
ExtraICState GetExtraICState() const final {
return static_cast<ExtraICState>(minor_key_);
}
private:
class ThrowReferenceErrorIfNonexistentBits : public BitField<bool, 0, 1> {};
DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadICProtoArray);
DEFINE_TURBOFAN_CODE_STUB(LoadICProtoArray, TurboFanCodeStub);
};
class DoubleToIStub : public PlatformCodeStub {
public:
DoubleToIStub(Isolate* isolate, Register source, Register destination,
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_SRC_IC_ACCESSOR_ASSEMBLER_IMPL_H_
#define V8_SRC_IC_ACCESSOR_ASSEMBLER_IMPL_H_
#include "src/code-stub-assembler.h"
namespace v8 {
namespace internal {
namespace compiler {
class CodeAssemblerState;
}
using compiler::Node;
#define ACCESSOR_ASSEMBLER_PUBLIC_INTERFACE(V) \
V(LoadIC) \
V(LoadField) \
V(LoadICTrampoline) \
V(KeyedLoadICTF) \
V(KeyedLoadICTrampolineTF) \
V(KeyedLoadICMegamorphic) \
V(StoreIC) \
V(StoreICTrampoline)
// The other IC entry points need custom handling because of additional
// parameters like "typeof_mode" or "language_mode".
class AccessorAssemblerImpl : public CodeStubAssembler {
public:
explicit AccessorAssemblerImpl(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}
#define DECLARE_PUBLIC_METHOD(Name) void Generate##Name();
ACCESSOR_ASSEMBLER_PUBLIC_INTERFACE(DECLARE_PUBLIC_METHOD)
#undef DECLARE_PUBLIC_METHOD
void GenerateLoadICProtoArray(bool throw_reference_error_if_nonexistent);
void GenerateLoadGlobalIC(TypeofMode typeof_mode);
void GenerateLoadGlobalICTrampoline(TypeofMode typeof_mode);
void GenerateKeyedStoreICTF(LanguageMode language_mode);
void GenerateKeyedStoreICTrampolineTF(LanguageMode language_mode);
void TryProbeStubCache(StubCache* stub_cache, Node* receiver, Node* name,
Label* if_handler, Variable* var_handler,
Label* if_miss);
Node* StubCachePrimaryOffsetForTesting(Node* name, Node* map) {
return StubCachePrimaryOffset(name, map);
}
Node* StubCacheSecondaryOffsetForTesting(Node* name, Node* map) {
return StubCacheSecondaryOffset(name, map);
}
protected:
struct LoadICParameters {
LoadICParameters(Node* context, Node* receiver, Node* name, Node* slot,
Node* vector)
: context(context),
receiver(receiver),
name(name),
slot(slot),
vector(vector) {}
Node* context;
Node* receiver;
Node* name;
Node* slot;
Node* vector;
};
struct StoreICParameters : public LoadICParameters {
StoreICParameters(Node* context, Node* receiver, Node* name, Node* value,
Node* slot, Node* vector)
: LoadICParameters(context, receiver, name, slot, vector),
value(value) {}
Node* value;
};
enum ElementSupport { kOnlyProperties, kSupportElements };
void HandleStoreICHandlerCase(
const StoreICParameters* p, Node* handler, Label* miss,
ElementSupport support_elements = kOnlyProperties);
private:
// Stub generation entry points.
void LoadIC(const LoadICParameters* p);
void LoadICProtoArray(const LoadICParameters* p, Node* handler,
bool throw_reference_error_if_nonexistent);
void LoadGlobalIC(const LoadICParameters* p, TypeofMode typeof_mode);
void KeyedLoadIC(const LoadICParameters* p);
void KeyedLoadICGeneric(const LoadICParameters* p);
void StoreIC(const StoreICParameters* p);
void KeyedStoreIC(const StoreICParameters* p, LanguageMode language_mode);
// IC dispatcher behavior.
// Checks monomorphic case. Returns {feedback} entry of the vector.
Node* TryMonomorphicCase(Node* slot, Node* vector, Node* receiver_map,
Label* if_handler, Variable* var_handler,
Label* if_miss);
void HandlePolymorphicCase(Node* receiver_map, Node* feedback,
Label* if_handler, Variable* var_handler,
Label* if_miss, int unroll_count);
void HandleKeyedStorePolymorphicCase(Node* receiver_map, Node* feedback,
Label* if_handler, Variable* var_handler,
Label* if_transition_handler,
Variable* var_transition_map_cell,
Label* if_miss);
// LoadIC implementation.
void HandleLoadICHandlerCase(
const LoadICParameters* p, Node* handler, Label* miss,
ElementSupport support_elements = kOnlyProperties);
void HandleLoadICSmiHandlerCase(const LoadICParameters* p, Node* holder,
Node* smi_handler, Label* miss,
ElementSupport support_elements);
void HandleLoadICProtoHandlerCase(const LoadICParameters* p, Node* handler,
Variable* var_holder,
Variable* var_smi_handler,
Label* if_smi_handler, Label* miss,
bool throw_reference_error_if_nonexistent);
Node* EmitLoadICProtoArrayCheck(const LoadICParameters* p, Node* handler,
Node* handler_length, Node* handler_flags,
Label* miss,
bool throw_reference_error_if_nonexistent);
// LoadGlobalIC implementation.
void HandleLoadGlobalICHandlerCase(const LoadICParameters* p, Node* handler,
Label* miss,
bool throw_reference_error_if_nonexistent);
// StoreIC implementation.
void HandleStoreICElementHandlerCase(const StoreICParameters* p,
Node* handler, Label* miss);
void HandleStoreICProtoHandler(const StoreICParameters* p, Node* handler,
Label* miss);
// If |transition| is nullptr then the normal field store is generated or
// transitioning store otherwise.
void HandleStoreICSmiHandlerCase(Node* handler_word, Node* holder,
Node* value, Node* transition, Label* miss);
// If |transition| is nullptr then the normal field store is generated or
// transitioning store otherwise.
void HandleStoreFieldAndReturn(Node* handler_word, Node* holder,
Representation representation, Node* value,
Node* transition, Label* miss);
// Low-level helpers.
Node* PrepareValueForStore(Node* handler_word, Node* holder,
Representation representation, Node* transition,
Node* value, Label* bailout);
// Extends properties backing store by JSObject::kFieldsAdded elements.
void ExtendPropertiesBackingStore(Node* object);
void StoreNamedField(Node* handler_word, Node* object, bool is_inobject,
Representation representation, Node* value,
bool transition_to_field);
void EmitFastElementsBoundsCheck(Node* object, Node* elements,
Node* intptr_index,
Node* is_jsarray_condition, Label* miss);
void EmitElementLoad(Node* object, Node* elements, Node* elements_kind,
Node* key, Node* is_jsarray_condition, Label* if_hole,
Label* rebox_double, Variable* var_double_value,
Label* unimplemented_elements_kind, Label* out_of_bounds,
Label* miss);
void CheckPrototype(Node* prototype_cell, Node* name, Label* miss);
void NameDictionaryNegativeLookup(Node* object, Node* name, Label* miss);
// Stub cache access helpers.
// This enum is used here as a replacement for StubCache::Table to avoid
// including stub cache header.
enum StubCacheTable : int;
Node* StubCachePrimaryOffset(Node* name, Node* map);
Node* StubCacheSecondaryOffset(Node* name, Node* seed);
void TryProbeStubCacheTable(StubCache* stub_cache, StubCacheTable table_id,
Node* entry_offset, Node* name, Node* map,
Label* if_handler, Variable* var_handler,
Label* if_miss);
};
} // namespace internal
} // namespace v8
#endif // V8_SRC_IC_ACCESSOR_ASSEMBLER_IMPL_H_
......@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "src/ic/accessor-assembler.h"
#include "src/ic/accessor-assembler-impl.h"
#include "src/code-factory.h"
#include "src/code-stubs.h"
......@@ -14,14 +13,15 @@ namespace v8 {
namespace internal {
using compiler::CodeAssemblerState;
using compiler::Node;
//////////////////// Private helpers.
Node* AccessorAssemblerImpl::TryMonomorphicCase(Node* slot, Node* vector,
Node* receiver_map,
Label* if_handler,
Variable* var_handler,
Label* if_miss) {
Node* AccessorAssembler::TryMonomorphicCase(Node* slot, Node* vector,
Node* receiver_map,
Label* if_handler,
Variable* var_handler,
Label* if_miss) {
Comment("TryMonomorphicCase");
DCHECK_EQ(MachineRepresentation::kTagged, var_handler->rep());
......@@ -51,9 +51,11 @@ Node* AccessorAssemblerImpl::TryMonomorphicCase(Node* slot, Node* vector,
return feedback;
}
void AccessorAssemblerImpl::HandlePolymorphicCase(
Node* receiver_map, Node* feedback, Label* if_handler,
Variable* var_handler, Label* if_miss, int unroll_count) {
void AccessorAssembler::HandlePolymorphicCase(Node* receiver_map,
Node* feedback, Label* if_handler,
Variable* var_handler,
Label* if_miss,
int unroll_count) {
Comment("HandlePolymorphicCase");
DCHECK_EQ(MachineRepresentation::kTagged, var_handler->rep());
......@@ -98,7 +100,7 @@ void AccessorAssemblerImpl::HandlePolymorphicCase(
Goto(if_miss);
}
void AccessorAssemblerImpl::HandleKeyedStorePolymorphicCase(
void AccessorAssembler::HandleKeyedStorePolymorphicCase(
Node* receiver_map, Node* feedback, Label* if_handler,
Variable* var_handler, Label* if_transition_handler,
Variable* var_transition_map_cell, Label* if_miss) {
......@@ -135,7 +137,7 @@ void AccessorAssemblerImpl::HandleKeyedStorePolymorphicCase(
Goto(if_miss);
}
void AccessorAssemblerImpl::HandleLoadICHandlerCase(
void AccessorAssembler::HandleLoadICHandlerCase(
const LoadICParameters* p, Node* handler, Label* miss,
ElementSupport support_elements) {
Comment("have_handler");
......@@ -173,7 +175,7 @@ void AccessorAssemblerImpl::HandleLoadICHandlerCase(
}
}
void AccessorAssemblerImpl::HandleLoadICSmiHandlerCase(
void AccessorAssembler::HandleLoadICSmiHandlerCase(
const LoadICParameters* p, Node* holder, Node* smi_handler, Label* miss,
ElementSupport support_elements) {
Variable var_double_value(this, MachineRepresentation::kFloat64);
......@@ -295,7 +297,7 @@ void AccessorAssemblerImpl::HandleLoadICSmiHandlerCase(
}
}
void AccessorAssemblerImpl::HandleLoadICProtoHandlerCase(
void AccessorAssembler::HandleLoadICProtoHandlerCase(
const LoadICParameters* p, Node* handler, Variable* var_holder,
Variable* var_smi_handler, Label* if_smi_handler, Label* miss,
bool throw_reference_error_if_nonexistent) {
......@@ -368,15 +370,13 @@ void AccessorAssemblerImpl::HandleLoadICProtoHandlerCase(
Bind(&array_handler);
{
typedef LoadICProtoArrayDescriptor Descriptor;
LoadICProtoArrayStub stub(isolate(), throw_reference_error_if_nonexistent);
Node* target = HeapConstant(stub.GetCode());
TailCallStub(Descriptor(isolate()), target, p->context, p->receiver,
p->name, p->slot, p->vector, handler);
TailCallStub(CodeFactory::LoadICProtoArray(
isolate(), throw_reference_error_if_nonexistent),
p->context, p->receiver, p->name, p->slot, p->vector, handler);
}
}
Node* AccessorAssemblerImpl::EmitLoadICProtoArrayCheck(
Node* AccessorAssembler::EmitLoadICProtoArrayCheck(
const LoadICParameters* p, Node* handler, Node* handler_length,
Node* handler_flags, Label* miss,
bool throw_reference_error_if_nonexistent) {
......@@ -438,7 +438,7 @@ Node* AccessorAssemblerImpl::EmitLoadICProtoArrayCheck(
return holder;
}
void AccessorAssemblerImpl::HandleLoadGlobalICHandlerCase(
void AccessorAssembler::HandleLoadGlobalICHandlerCase(
const LoadICParameters* pp, Node* handler, Label* miss,
bool throw_reference_error_if_nonexistent) {
LoadICParameters p = *pp;
......@@ -457,7 +457,7 @@ void AccessorAssemblerImpl::HandleLoadGlobalICHandlerCase(
miss, kOnlyProperties);
}
void AccessorAssemblerImpl::HandleStoreICHandlerCase(
void AccessorAssembler::HandleStoreICHandlerCase(
const StoreICParameters* p, Node* handler, Label* miss,
ElementSupport support_elements) {
Label if_smi_handler(this), if_nonsmi_handler(this);
......@@ -504,7 +504,7 @@ void AccessorAssemblerImpl::HandleStoreICHandlerCase(
}
}
void AccessorAssemblerImpl::HandleStoreICElementHandlerCase(
void AccessorAssembler::HandleStoreICElementHandlerCase(
const StoreICParameters* p, Node* handler, Label* miss) {
Comment("HandleStoreICElementHandlerCase");
Node* validity_cell = LoadObjectField(handler, Tuple2::kValue1Offset);
......@@ -521,8 +521,8 @@ void AccessorAssemblerImpl::HandleStoreICElementHandlerCase(
p->value, p->slot, p->vector);
}
void AccessorAssemblerImpl::HandleStoreICProtoHandler(
const StoreICParameters* p, Node* handler, Label* miss) {
void AccessorAssembler::HandleStoreICProtoHandler(const StoreICParameters* p,
Node* handler, Label* miss) {
// IC dispatchers rely on these assumptions to be held.
STATIC_ASSERT(FixedArray::kLengthOffset ==
StoreHandler::kTransitionCellOffset);
......@@ -613,11 +613,10 @@ void AccessorAssemblerImpl::HandleStoreICProtoHandler(
}
}
void AccessorAssemblerImpl::HandleStoreICSmiHandlerCase(Node* handler_word,
Node* holder,
Node* value,
Node* transition,
Label* miss) {
void AccessorAssembler::HandleStoreICSmiHandlerCase(Node* handler_word,
Node* holder, Node* value,
Node* transition,
Label* miss) {
Comment(transition ? "transitioning field store" : "field store");
#ifdef DEBUG
......@@ -683,9 +682,11 @@ void AccessorAssemblerImpl::HandleStoreICSmiHandlerCase(Node* handler_word,
}
}
void AccessorAssemblerImpl::HandleStoreFieldAndReturn(
Node* handler_word, Node* holder, Representation representation,
Node* value, Node* transition, Label* miss) {
void AccessorAssembler::HandleStoreFieldAndReturn(Node* handler_word,
Node* holder,
Representation representation,
Node* value, Node* transition,
Label* miss) {
bool transition_to_field = transition != nullptr;
Node* prepared_value = PrepareValueForStore(
handler_word, holder, representation, transition, value, miss);
......@@ -727,11 +728,10 @@ void AccessorAssemblerImpl::HandleStoreFieldAndReturn(
}
}
Node* AccessorAssemblerImpl::PrepareValueForStore(Node* handler_word,
Node* holder,
Representation representation,
Node* transition, Node* value,
Label* bailout) {
Node* AccessorAssembler::PrepareValueForStore(Node* handler_word, Node* holder,
Representation representation,
Node* transition, Node* value,
Label* bailout) {
if (representation.IsDouble()) {
value = TryTaggedToFloat64(value, bailout);
......@@ -762,7 +762,7 @@ Node* AccessorAssemblerImpl::PrepareValueForStore(Node* handler_word,
return value;
}
void AccessorAssemblerImpl::ExtendPropertiesBackingStore(Node* object) {
void AccessorAssembler::ExtendPropertiesBackingStore(Node* object) {
Node* properties = LoadProperties(object);
Node* length = LoadFixedArrayBaseLength(properties);
......@@ -798,11 +798,10 @@ void AccessorAssemblerImpl::ExtendPropertiesBackingStore(Node* object) {
StoreObjectField(object, JSObject::kPropertiesOffset, new_properties);
}
void AccessorAssemblerImpl::StoreNamedField(Node* handler_word, Node* object,
bool is_inobject,
Representation representation,
Node* value,
bool transition_to_field) {
void AccessorAssembler::StoreNamedField(Node* handler_word, Node* object,
bool is_inobject,
Representation representation,
Node* value, bool transition_to_field) {
bool store_value_as_double = representation.IsDouble();
Node* property_storage = object;
if (!is_inobject) {
......@@ -836,9 +835,11 @@ void AccessorAssemblerImpl::StoreNamedField(Node* handler_word, Node* object,
}
}
void AccessorAssemblerImpl::EmitFastElementsBoundsCheck(
Node* object, Node* elements, Node* intptr_index,
Node* is_jsarray_condition, Label* miss) {
void AccessorAssembler::EmitFastElementsBoundsCheck(Node* object,
Node* elements,
Node* intptr_index,
Node* is_jsarray_condition,
Label* miss) {
Variable var_length(this, MachineType::PointerRepresentation());
Comment("Fast elements bounds check");
Label if_array(this), length_loaded(this, &var_length);
......@@ -856,11 +857,13 @@ void AccessorAssemblerImpl::EmitFastElementsBoundsCheck(
GotoUnless(UintPtrLessThan(intptr_index, var_length.value()), miss);
}
void AccessorAssemblerImpl::EmitElementLoad(
Node* object, Node* elements, Node* elements_kind, Node* intptr_index,
Node* is_jsarray_condition, Label* if_hole, Label* rebox_double,
Variable* var_double_value, Label* unimplemented_elements_kind,
Label* out_of_bounds, Label* miss) {
void AccessorAssembler::EmitElementLoad(Node* object, Node* elements,
Node* elements_kind, Node* intptr_index,
Node* is_jsarray_condition,
Label* if_hole, Label* rebox_double,
Variable* var_double_value,
Label* unimplemented_elements_kind,
Label* out_of_bounds, Label* miss) {
Label if_typed_array(this), if_fast_packed(this), if_fast_holey(this),
if_fast_double(this), if_fast_holey_double(this), if_nonfast(this),
if_dictionary(this);
......@@ -1053,8 +1056,8 @@ void AccessorAssemblerImpl::EmitElementLoad(
}
}
void AccessorAssemblerImpl::CheckPrototype(Node* prototype_cell, Node* name,
Label* miss) {
void AccessorAssembler::CheckPrototype(Node* prototype_cell, Node* name,
Label* miss) {
Node* maybe_prototype = LoadWeakCellValue(prototype_cell, miss);
Label done(this);
......@@ -1083,9 +1086,8 @@ void AccessorAssemblerImpl::CheckPrototype(Node* prototype_cell, Node* name,
Bind(&done);
}
void AccessorAssemblerImpl::NameDictionaryNegativeLookup(Node* object,
Node* name,
Label* miss) {
void AccessorAssembler::NameDictionaryNegativeLookup(Node* object, Node* name,
Label* miss) {
CSA_ASSERT(this, IsDictionaryMap(LoadMap(object)));
Node* properties = LoadProperties(object);
// Ensure the property does not exist in a dictionary-mode object.
......@@ -1098,12 +1100,12 @@ void AccessorAssemblerImpl::NameDictionaryNegativeLookup(Node* object,
//////////////////// Stub cache access helpers.
enum AccessorAssemblerImpl::StubCacheTable : int {
enum AccessorAssembler::StubCacheTable : int {
kPrimary = static_cast<int>(StubCache::kPrimary),
kSecondary = static_cast<int>(StubCache::kSecondary)
};
Node* AccessorAssemblerImpl::StubCachePrimaryOffset(Node* name, Node* map) {
Node* AccessorAssembler::StubCachePrimaryOffset(Node* name, Node* map) {
// See v8::internal::StubCache::PrimaryOffset().
STATIC_ASSERT(StubCache::kCacheIndexShift == Name::kHashShift);
// Compute the hash of the name (use entire hash field).
......@@ -1125,7 +1127,7 @@ Node* AccessorAssemblerImpl::StubCachePrimaryOffset(Node* name, Node* map) {
return ChangeUint32ToWord(Word32And(hash, Int32Constant(mask)));
}
Node* AccessorAssemblerImpl::StubCacheSecondaryOffset(Node* name, Node* seed) {
Node* AccessorAssembler::StubCacheSecondaryOffset(Node* name, Node* seed) {
// See v8::internal::StubCache::SecondaryOffset().
// Use the seed from the primary cache in the secondary cache.
......@@ -1137,10 +1139,12 @@ Node* AccessorAssemblerImpl::StubCacheSecondaryOffset(Node* name, Node* seed) {
return ChangeUint32ToWord(Word32And(hash, Int32Constant(mask)));
}
void AccessorAssemblerImpl::TryProbeStubCacheTable(
StubCache* stub_cache, StubCacheTable table_id, Node* entry_offset,
Node* name, Node* map, Label* if_handler, Variable* var_handler,
Label* if_miss) {
void AccessorAssembler::TryProbeStubCacheTable(StubCache* stub_cache,
StubCacheTable table_id,
Node* entry_offset, Node* name,
Node* map, Label* if_handler,
Variable* var_handler,
Label* if_miss) {
StubCache::Table table = static_cast<StubCache::Table>(table_id);
#ifdef DEBUG
if (FLAG_test_secondary_stub_cache && table == StubCache::kPrimary) {
......@@ -1180,11 +1184,10 @@ void AccessorAssemblerImpl::TryProbeStubCacheTable(
Goto(if_handler);
}
void AccessorAssemblerImpl::TryProbeStubCache(StubCache* stub_cache,
Node* receiver, Node* name,
Label* if_handler,
Variable* var_handler,
Label* if_miss) {
void AccessorAssembler::TryProbeStubCache(StubCache* stub_cache, Node* receiver,
Node* name, Label* if_handler,
Variable* var_handler,
Label* if_miss) {
Label try_secondary(this), miss(this);
Counters* counters = isolate()->counters();
......@@ -1217,7 +1220,7 @@ void AccessorAssemblerImpl::TryProbeStubCache(StubCache* stub_cache,
//////////////////// Entry points into private implementation (one per stub).
void AccessorAssemblerImpl::LoadIC(const LoadICParameters* p) {
void AccessorAssembler::LoadIC(const LoadICParameters* p) {
Variable var_handler(this, MachineRepresentation::kTagged);
// TODO(ishell): defer blocks when it works.
Label if_handler(this, &var_handler), try_polymorphic(this),
......@@ -1260,7 +1263,7 @@ void AccessorAssemblerImpl::LoadIC(const LoadICParameters* p) {
}
}
void AccessorAssemblerImpl::LoadICProtoArray(
void AccessorAssembler::LoadICProtoArray(
const LoadICParameters* p, Node* handler,
bool throw_reference_error_if_nonexistent) {
Label miss(this);
......@@ -1285,8 +1288,8 @@ void AccessorAssemblerImpl::LoadICProtoArray(
}
}
void AccessorAssemblerImpl::LoadGlobalIC(const LoadICParameters* p,
TypeofMode typeof_mode) {
void AccessorAssembler::LoadGlobalIC(const LoadICParameters* p,
TypeofMode typeof_mode) {
Label try_handler(this), call_handler(this), miss(this);
Node* weak_cell =
LoadFixedArrayElement(p->vector, p->slot, 0, SMI_PARAMETERS);
......@@ -1332,7 +1335,7 @@ void AccessorAssemblerImpl::LoadGlobalIC(const LoadICParameters* p,
}
}
void AccessorAssemblerImpl::KeyedLoadIC(const LoadICParameters* p) {
void AccessorAssembler::KeyedLoadIC(const LoadICParameters* p) {
Variable var_handler(this, MachineRepresentation::kTagged);
// TODO(ishell): defer blocks when it works.
Label if_handler(this, &var_handler), try_polymorphic(this),
......@@ -1392,7 +1395,7 @@ void AccessorAssemblerImpl::KeyedLoadIC(const LoadICParameters* p) {
}
}
void AccessorAssemblerImpl::KeyedLoadICGeneric(const LoadICParameters* p) {
void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) {
Variable var_index(this, MachineType::PointerRepresentation());
Variable var_unique(this, MachineRepresentation::kTagged);
var_unique.Bind(p->name); // Dummy initialization.
......@@ -1552,7 +1555,7 @@ void AccessorAssemblerImpl::KeyedLoadICGeneric(const LoadICParameters* p) {
}
}
void AccessorAssemblerImpl::StoreIC(const StoreICParameters* p) {
void AccessorAssembler::StoreIC(const StoreICParameters* p) {
Variable var_handler(this, MachineRepresentation::kTagged);
// TODO(ishell): defer blocks when it works.
Label if_handler(this, &var_handler), try_polymorphic(this),
......@@ -1599,8 +1602,8 @@ void AccessorAssemblerImpl::StoreIC(const StoreICParameters* p) {
}
}
void AccessorAssemblerImpl::KeyedStoreIC(const StoreICParameters* p,
LanguageMode language_mode) {
void AccessorAssembler::KeyedStoreIC(const StoreICParameters* p,
LanguageMode language_mode) {
// TODO(ishell): defer blocks when it works.
Label miss(this /*, Label::kDeferred*/);
{
......@@ -1710,7 +1713,7 @@ void AccessorAssemblerImpl::KeyedStoreIC(const StoreICParameters* p,
//////////////////// Public methods.
void AccessorAssemblerImpl::GenerateLoadIC() {
void AccessorAssembler::GenerateLoadIC() {
typedef LoadWithVectorDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
......@@ -1723,7 +1726,7 @@ void AccessorAssemblerImpl::GenerateLoadIC() {
LoadIC(&p);
}
void AccessorAssemblerImpl::GenerateLoadICTrampoline() {
void AccessorAssembler::GenerateLoadICTrampoline() {
typedef LoadDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
......@@ -1736,9 +1739,9 @@ void AccessorAssemblerImpl::GenerateLoadICTrampoline() {
LoadIC(&p);
}
void AccessorAssemblerImpl::GenerateLoadICProtoArray(
void AccessorAssembler::GenerateLoadICProtoArray(
bool throw_reference_error_if_nonexistent) {
typedef LoadICProtoArrayStub::Descriptor Descriptor;
typedef LoadICProtoArrayDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
......@@ -1751,8 +1754,8 @@ void AccessorAssemblerImpl::GenerateLoadICProtoArray(
LoadICProtoArray(&p, handler, throw_reference_error_if_nonexistent);
}
void AccessorAssemblerImpl::GenerateLoadField() {
typedef LoadFieldStub::Descriptor Descriptor;
void AccessorAssembler::GenerateLoadField() {
typedef LoadFieldDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = nullptr;
......@@ -1765,7 +1768,7 @@ void AccessorAssemblerImpl::GenerateLoadField() {
nullptr, kOnlyProperties);
}
void AccessorAssemblerImpl::GenerateLoadGlobalIC(TypeofMode typeof_mode) {
void AccessorAssembler::GenerateLoadGlobalIC(TypeofMode typeof_mode) {
typedef LoadGlobalWithVectorDescriptor Descriptor;
Node* name = Parameter(Descriptor::kName);
......@@ -1777,8 +1780,7 @@ void AccessorAssemblerImpl::GenerateLoadGlobalIC(TypeofMode typeof_mode) {
LoadGlobalIC(&p, typeof_mode);
}
void AccessorAssemblerImpl::GenerateLoadGlobalICTrampoline(
TypeofMode typeof_mode) {
void AccessorAssembler::GenerateLoadGlobalICTrampoline(TypeofMode typeof_mode) {
typedef LoadGlobalDescriptor Descriptor;
Node* name = Parameter(Descriptor::kName);
......@@ -1790,7 +1792,7 @@ void AccessorAssemblerImpl::GenerateLoadGlobalICTrampoline(
LoadGlobalIC(&p, typeof_mode);
}
void AccessorAssemblerImpl::GenerateKeyedLoadICTF() {
void AccessorAssembler::GenerateKeyedLoadIC() {
typedef LoadWithVectorDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
......@@ -1803,7 +1805,7 @@ void AccessorAssemblerImpl::GenerateKeyedLoadICTF() {
KeyedLoadIC(&p);
}
void AccessorAssemblerImpl::GenerateKeyedLoadICTrampolineTF() {
void AccessorAssembler::GenerateKeyedLoadICTrampoline() {
typedef LoadDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
......@@ -1816,7 +1818,7 @@ void AccessorAssemblerImpl::GenerateKeyedLoadICTrampolineTF() {
KeyedLoadIC(&p);
}
void AccessorAssemblerImpl::GenerateKeyedLoadICMegamorphic() {
void AccessorAssembler::GenerateKeyedLoadIC_Megamorphic() {
typedef LoadWithVectorDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
......@@ -1829,7 +1831,7 @@ void AccessorAssemblerImpl::GenerateKeyedLoadICMegamorphic() {
KeyedLoadICGeneric(&p);
}
void AccessorAssemblerImpl::GenerateStoreIC() {
void AccessorAssembler::GenerateStoreIC() {
typedef StoreWithVectorDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
......@@ -1843,7 +1845,7 @@ void AccessorAssemblerImpl::GenerateStoreIC() {
StoreIC(&p);
}
void AccessorAssemblerImpl::GenerateStoreICTrampoline() {
void AccessorAssembler::GenerateStoreICTrampoline() {
typedef StoreDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
......@@ -1857,7 +1859,7 @@ void AccessorAssemblerImpl::GenerateStoreICTrampoline() {
StoreIC(&p);
}
void AccessorAssemblerImpl::GenerateKeyedStoreICTF(LanguageMode language_mode) {
void AccessorAssembler::GenerateKeyedStoreIC(LanguageMode language_mode) {
typedef StoreWithVectorDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
......@@ -1871,7 +1873,7 @@ void AccessorAssemblerImpl::GenerateKeyedStoreICTF(LanguageMode language_mode) {
KeyedStoreIC(&p, language_mode);
}
void AccessorAssemblerImpl::GenerateKeyedStoreICTrampolineTF(
void AccessorAssembler::GenerateKeyedStoreICTrampoline(
LanguageMode language_mode) {
typedef StoreDescriptor Descriptor;
......@@ -1886,48 +1888,5 @@ void AccessorAssemblerImpl::GenerateKeyedStoreICTrampolineTF(
KeyedStoreIC(&p, language_mode);
}
//////////////////// AccessorAssembler implementation.
#define DISPATCH_TO_IMPL(Name) \
void AccessorAssembler::Generate##Name(CodeAssemblerState* state) { \
AccessorAssemblerImpl assembler(state); \
assembler.Generate##Name(); \
}
ACCESSOR_ASSEMBLER_PUBLIC_INTERFACE(DISPATCH_TO_IMPL)
#undef DISPATCH_TO_IMPL
void AccessorAssembler::GenerateLoadICProtoArray(
CodeAssemblerState* state, bool throw_reference_error_if_nonexistent) {
AccessorAssemblerImpl assembler(state);
assembler.GenerateLoadICProtoArray(throw_reference_error_if_nonexistent);
}
void AccessorAssembler::GenerateLoadGlobalIC(CodeAssemblerState* state,
TypeofMode typeof_mode) {
AccessorAssemblerImpl assembler(state);
assembler.GenerateLoadGlobalIC(typeof_mode);
}
void AccessorAssembler::GenerateLoadGlobalICTrampoline(
CodeAssemblerState* state, TypeofMode typeof_mode) {
AccessorAssemblerImpl assembler(state);
assembler.GenerateLoadGlobalICTrampoline(typeof_mode);
}
void AccessorAssembler::GenerateKeyedStoreICTF(CodeAssemblerState* state,
LanguageMode language_mode) {
AccessorAssemblerImpl assembler(state);
assembler.GenerateKeyedStoreICTF(language_mode);
}
void AccessorAssembler::GenerateKeyedStoreICTrampolineTF(
CodeAssemblerState* state, LanguageMode language_mode) {
AccessorAssemblerImpl assembler(state);
assembler.GenerateKeyedStoreICTrampolineTF(language_mode);
}
#undef ACCESSOR_ASSEMBLER_PUBLIC_INTERFACE
} // namespace internal
} // namespace v8
......@@ -5,7 +5,7 @@
#ifndef V8_SRC_IC_ACCESSOR_ASSEMBLER_H_
#define V8_SRC_IC_ACCESSOR_ASSEMBLER_H_
#include "src/globals.h"
#include "src/code-stub-assembler.h"
namespace v8 {
namespace internal {
......@@ -14,29 +14,179 @@ namespace compiler {
class CodeAssemblerState;
}
class AccessorAssembler {
class AccessorAssembler : public CodeStubAssembler {
public:
static void GenerateLoadIC(compiler::CodeAssemblerState* state);
static void GenerateLoadICTrampoline(compiler::CodeAssemblerState* state);
static void GenerateLoadICProtoArray(
compiler::CodeAssemblerState* state,
bool throw_reference_error_if_nonexistent);
static void GenerateLoadGlobalIC(compiler::CodeAssemblerState* state,
TypeofMode typeof_mode);
static void GenerateLoadGlobalICTrampoline(
compiler::CodeAssemblerState* state, TypeofMode typeof_mode);
static void GenerateKeyedLoadICTF(compiler::CodeAssemblerState* state);
static void GenerateKeyedLoadICTrampolineTF(
compiler::CodeAssemblerState* state);
static void GenerateKeyedLoadICMegamorphic(
compiler::CodeAssemblerState* state);
static void GenerateLoadField(compiler::CodeAssemblerState* state);
static void GenerateStoreIC(compiler::CodeAssemblerState* state);
static void GenerateStoreICTrampoline(compiler::CodeAssemblerState* state);
static void GenerateKeyedStoreICTF(compiler::CodeAssemblerState* state,
LanguageMode language_mode);
static void GenerateKeyedStoreICTrampolineTF(
compiler::CodeAssemblerState* state, LanguageMode language_mode);
typedef compiler::Node Node;
explicit AccessorAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}
void GenerateLoadIC();
void GenerateLoadField();
void GenerateLoadICTrampoline();
void GenerateKeyedLoadIC();
void GenerateKeyedLoadICTrampoline();
void GenerateKeyedLoadIC_Megamorphic();
void GenerateStoreIC();
void GenerateStoreICTrampoline();
void GenerateLoadICProtoArray(bool throw_reference_error_if_nonexistent);
void GenerateLoadGlobalIC(TypeofMode typeof_mode);
void GenerateLoadGlobalICTrampoline(TypeofMode typeof_mode);
void GenerateKeyedStoreIC(LanguageMode language_mode);
void GenerateKeyedStoreICTrampoline(LanguageMode language_mode);
void TryProbeStubCache(StubCache* stub_cache, Node* receiver, Node* name,
Label* if_handler, Variable* var_handler,
Label* if_miss);
Node* StubCachePrimaryOffsetForTesting(Node* name, Node* map) {
return StubCachePrimaryOffset(name, map);
}
Node* StubCacheSecondaryOffsetForTesting(Node* name, Node* map) {
return StubCacheSecondaryOffset(name, map);
}
protected:
struct LoadICParameters {
LoadICParameters(Node* context, Node* receiver, Node* name, Node* slot,
Node* vector)
: context(context),
receiver(receiver),
name(name),
slot(slot),
vector(vector) {}
Node* context;
Node* receiver;
Node* name;
Node* slot;
Node* vector;
};
struct StoreICParameters : public LoadICParameters {
StoreICParameters(Node* context, Node* receiver, Node* name, Node* value,
Node* slot, Node* vector)
: LoadICParameters(context, receiver, name, slot, vector),
value(value) {}
Node* value;
};
enum ElementSupport { kOnlyProperties, kSupportElements };
void HandleStoreICHandlerCase(
const StoreICParameters* p, Node* handler, Label* miss,
ElementSupport support_elements = kOnlyProperties);
private:
// Stub generation entry points.
void LoadIC(const LoadICParameters* p);
void LoadICProtoArray(const LoadICParameters* p, Node* handler,
bool throw_reference_error_if_nonexistent);
void LoadGlobalIC(const LoadICParameters* p, TypeofMode typeof_mode);
void KeyedLoadIC(const LoadICParameters* p);
void KeyedLoadICGeneric(const LoadICParameters* p);
void StoreIC(const StoreICParameters* p);
void KeyedStoreIC(const StoreICParameters* p, LanguageMode language_mode);
// IC dispatcher behavior.
// Checks monomorphic case. Returns {feedback} entry of the vector.
Node* TryMonomorphicCase(Node* slot, Node* vector, Node* receiver_map,
Label* if_handler, Variable* var_handler,
Label* if_miss);
void HandlePolymorphicCase(Node* receiver_map, Node* feedback,
Label* if_handler, Variable* var_handler,
Label* if_miss, int unroll_count);
void HandleKeyedStorePolymorphicCase(Node* receiver_map, Node* feedback,
Label* if_handler, Variable* var_handler,
Label* if_transition_handler,
Variable* var_transition_map_cell,
Label* if_miss);
// LoadIC implementation.
void HandleLoadICHandlerCase(
const LoadICParameters* p, Node* handler, Label* miss,
ElementSupport support_elements = kOnlyProperties);
void HandleLoadICSmiHandlerCase(const LoadICParameters* p, Node* holder,
Node* smi_handler, Label* miss,
ElementSupport support_elements);
void HandleLoadICProtoHandlerCase(const LoadICParameters* p, Node* handler,
Variable* var_holder,
Variable* var_smi_handler,
Label* if_smi_handler, Label* miss,
bool throw_reference_error_if_nonexistent);
Node* EmitLoadICProtoArrayCheck(const LoadICParameters* p, Node* handler,
Node* handler_length, Node* handler_flags,
Label* miss,
bool throw_reference_error_if_nonexistent);
// LoadGlobalIC implementation.
void HandleLoadGlobalICHandlerCase(const LoadICParameters* p, Node* handler,
Label* miss,
bool throw_reference_error_if_nonexistent);
// StoreIC implementation.
void HandleStoreICElementHandlerCase(const StoreICParameters* p,
Node* handler, Label* miss);
void HandleStoreICProtoHandler(const StoreICParameters* p, Node* handler,
Label* miss);
// If |transition| is nullptr then the normal field store is generated or
// transitioning store otherwise.
void HandleStoreICSmiHandlerCase(Node* handler_word, Node* holder,
Node* value, Node* transition, Label* miss);
// If |transition| is nullptr then the normal field store is generated or
// transitioning store otherwise.
void HandleStoreFieldAndReturn(Node* handler_word, Node* holder,
Representation representation, Node* value,
Node* transition, Label* miss);
// Low-level helpers.
Node* PrepareValueForStore(Node* handler_word, Node* holder,
Representation representation, Node* transition,
Node* value, Label* bailout);
// Extends properties backing store by JSObject::kFieldsAdded elements.
void ExtendPropertiesBackingStore(Node* object);
void StoreNamedField(Node* handler_word, Node* object, bool is_inobject,
Representation representation, Node* value,
bool transition_to_field);
void EmitFastElementsBoundsCheck(Node* object, Node* elements,
Node* intptr_index,
Node* is_jsarray_condition, Label* miss);
void EmitElementLoad(Node* object, Node* elements, Node* elements_kind,
Node* key, Node* is_jsarray_condition, Label* if_hole,
Label* rebox_double, Variable* var_double_value,
Label* unimplemented_elements_kind, Label* out_of_bounds,
Label* miss);
void CheckPrototype(Node* prototype_cell, Node* name, Label* miss);
void NameDictionaryNegativeLookup(Node* object, Node* name, Label* miss);
// Stub cache access helpers.
// This enum is used here as a replacement for StubCache::Table to avoid
// including stub cache header.
enum StubCacheTable : int;
Node* StubCachePrimaryOffset(Node* name, Node* map);
Node* StubCacheSecondaryOffset(Node* name, Node* seed);
void TryProbeStubCacheTable(StubCache* stub_cache, StubCacheTable table_id,
Node* entry_offset, Node* name, Node* map,
Label* if_handler, Variable* var_handler,
Label* if_miss);
};
} // namespace internal
......
......@@ -283,8 +283,7 @@ void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor(
Handle<Object> smi_handler =
LoadIC::SimpleFieldLoad(isolate(), it->GetFieldIndex());
__ Move(LoadFieldDescriptor::SmiHandlerRegister(), smi_handler);
LoadFieldStub stub(isolate());
GenerateTailCall(masm(), stub.GetCode());
GenerateTailCall(masm(), isolate()->builtins()->LoadField());
break;
}
case LookupIterator::ACCESSOR:
......
......@@ -2660,24 +2660,6 @@ RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) {
RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key));
}
RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) {
HandleScope scope(isolate);
typedef LoadWithVectorDescriptor Descriptor;
DCHECK_EQ(Descriptor::kParameterCount, args.length());
Handle<Object> receiver = args.at(Descriptor::kReceiver);
Handle<Object> key = args.at(Descriptor::kName);
Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot);
Handle<TypeFeedbackVector> vector =
args.at<TypeFeedbackVector>(Descriptor::kVector);
FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value());
KeyedLoadICNexus nexus(vector, vector_slot);
KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
ic.UpdateState(receiver, key);
RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key));
}
// Used from ic-<arch>.cc.
RUNTIME_FUNCTION(Runtime_StoreIC_Miss) {
HandleScope scope(isolate);
......
......@@ -7,7 +7,7 @@
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
#include "src/contexts.h"
#include "src/ic/accessor-assembler-impl.h"
#include "src/ic/accessor-assembler.h"
#include "src/interface-descriptors.h"
#include "src/isolate.h"
......@@ -16,10 +16,10 @@ namespace internal {
using compiler::Node;
class KeyedStoreGenericAssembler : public AccessorAssemblerImpl {
class KeyedStoreGenericAssembler : public AccessorAssembler {
public:
explicit KeyedStoreGenericAssembler(compiler::CodeAssemblerState* state)
: AccessorAssemblerImpl(state) {}
: AccessorAssembler(state) {}
void KeyedStoreGeneric(LanguageMode language_mode);
......
......@@ -965,7 +965,6 @@ namespace internal {
F(CompareIC_Miss, 3, 1) \
F(ElementsTransitionAndStoreIC_Miss, 6, 1) \
F(KeyedLoadIC_Miss, 4, 1) \
F(KeyedLoadIC_MissFromStubFailure, 4, 1) \
F(KeyedStoreIC_Miss, 5, 1) \
F(KeyedStoreIC_Slow, 5, 1) \
F(LoadElementWithInterceptor, 2, 1) \
......
......@@ -969,7 +969,6 @@
'ic/access-compiler.cc',
'ic/access-compiler.h',
'ic/accessor-assembler.cc',
'ic/accessor-assembler-impl.h',
'ic/accessor-assembler.h',
'ic/call-optimization.cc',
'ic/call-optimization.h',
......
......@@ -5,7 +5,7 @@
#include "test/cctest/cctest.h"
#include "src/base/utils/random-number-generator.h"
#include "src/ic/accessor-assembler-impl.h"
#include "src/ic/accessor-assembler.h"
#include "src/ic/stub-cache.h"
#include "test/cctest/compiler/code-assembler-tester.h"
#include "test/cctest/compiler/function-tester.h"
......@@ -23,7 +23,7 @@ void TestStubCacheOffsetCalculation(StubCache::Table table) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 2;
CodeAssemblerTester data(isolate, kNumParams);
AccessorAssemblerImpl m(data.state());
AccessorAssembler m(data.state());
{
Node* name = m.Parameter(0);
......@@ -121,7 +121,7 @@ TEST(TryProbeStubCache) {
Isolate* isolate(CcTest::InitIsolateOnce());
const int kNumParams = 3;
CodeAssemblerTester data(isolate, kNumParams);
AccessorAssemblerImpl m(data.state());
AccessorAssembler m(data.state());
Code::Kind ic_kind = Code::LOAD_IC;
StubCache stub_cache(isolate, ic_kind);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment