Added vector-based loadic hydrogen stubs. Not yet callable.
The next step is to integrate the use of vector[slot] into the IC infrastructure so it can do the right thing for a vector-based ic. Then these stubs can be installed. For now, they immediately bail out to the miss handler. R=verwaest@chromium.org Review URL: https://codereview.chromium.org/499343002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23405 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
939f24b817
commit
76e22ca629
@ -4592,6 +4592,20 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
|
||||
void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister());
|
||||
VectorLoadStub stub(isolate(), state_);
|
||||
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
||||
void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister());
|
||||
VectorKeyedLoadStub stub(isolate());
|
||||
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
||||
void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
|
||||
if (masm->isolate()->function_entry_hook() != NULL) {
|
||||
ProfileEntryHookStub stub(masm->isolate());
|
||||
|
@ -4600,6 +4600,20 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
|
||||
void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister());
|
||||
VectorLoadStub stub(isolate(), state_);
|
||||
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
||||
void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister());
|
||||
VectorKeyedLoadStub stub(isolate());
|
||||
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
||||
static unsigned int GetProfileEntryHookCallSize(MacroAssembler* masm) {
|
||||
// The entry hook is a "BumpSystemStackPointer" instruction (sub),
|
||||
// followed by a "Push lr" instruction, followed by a call.
|
||||
|
@ -1790,4 +1790,26 @@ Handle<Code> KeyedLoadGenericStub::GenerateCode() {
|
||||
}
|
||||
|
||||
|
||||
template <>
|
||||
HValue* CodeStubGraphBuilder<VectorLoadStub>::BuildCodeStub() {
|
||||
HValue* receiver = GetParameter(FullVectorLoadConvention::kReceiverIndex);
|
||||
Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER);
|
||||
return receiver;
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> VectorLoadStub::GenerateCode() { return DoGenerateCode(this); }
|
||||
|
||||
|
||||
template <>
|
||||
HValue* CodeStubGraphBuilder<VectorKeyedLoadStub>::BuildCodeStub() {
|
||||
HValue* receiver = GetParameter(FullVectorLoadConvention::kReceiverIndex);
|
||||
Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER);
|
||||
return receiver;
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> VectorKeyedLoadStub::GenerateCode() {
|
||||
return DoGenerateCode(this);
|
||||
}
|
||||
} } // namespace v8::internal
|
||||
|
@ -664,6 +664,35 @@ void InstanceofStub::InitializeInterfaceDescriptor(
|
||||
}
|
||||
|
||||
|
||||
static void InitializeVectorLoadStub(CodeStubInterfaceDescriptor* descriptor,
|
||||
CodeStub::Major major,
|
||||
Address deoptimization_handler) {
|
||||
DCHECK(FLAG_vector_ics);
|
||||
Register registers[] = {InterfaceDescriptor::ContextRegister(),
|
||||
FullVectorLoadConvention::ReceiverRegister(),
|
||||
FullVectorLoadConvention::NameRegister(),
|
||||
FullVectorLoadConvention::SlotRegister(),
|
||||
FullVectorLoadConvention::VectorRegister()};
|
||||
descriptor->Initialize(major, arraysize(registers), registers,
|
||||
deoptimization_handler);
|
||||
}
|
||||
|
||||
|
||||
void VectorLoadStub::InitializeInterfaceDescriptor(
|
||||
CodeStubInterfaceDescriptor* descriptor) {
|
||||
InitializeVectorLoadStub(descriptor, MajorKey(),
|
||||
FUNCTION_ADDR(VectorLoadIC_MissFromStubFailure));
|
||||
}
|
||||
|
||||
|
||||
void VectorKeyedLoadStub::InitializeInterfaceDescriptor(
|
||||
CodeStubInterfaceDescriptor* descriptor) {
|
||||
InitializeVectorLoadStub(
|
||||
descriptor, MajorKey(),
|
||||
FUNCTION_ADDR(VectorKeyedLoadIC_MissFromStubFailure));
|
||||
}
|
||||
|
||||
|
||||
void LoadDictionaryElementPlatformStub::Generate(MacroAssembler* masm) {
|
||||
ElementHandlerCompiler::GenerateLoadDictionaryElement(masm);
|
||||
}
|
||||
|
104
src/code-stubs.h
104
src/code-stubs.h
@ -76,6 +76,10 @@ namespace internal {
|
||||
V(StoreGlobal) \
|
||||
V(CallApiFunction) \
|
||||
V(CallApiGetter) \
|
||||
V(LoadICTrampoline) \
|
||||
V(VectorLoad) \
|
||||
V(KeyedLoadICTrampoline) \
|
||||
V(VectorKeyedLoad) \
|
||||
/* IC Handler stubs */ \
|
||||
V(LoadField) \
|
||||
V(StoreField) \
|
||||
@ -1937,6 +1941,106 @@ class KeyedLoadGenericStub : public HydrogenCodeStub {
|
||||
};
|
||||
|
||||
|
||||
class LoadICTrampolineStub : public PlatformCodeStub {
|
||||
public:
|
||||
LoadICTrampolineStub(Isolate* isolate, const LoadIC::State& state)
|
||||
: PlatformCodeStub(isolate), state_(state) {}
|
||||
|
||||
virtual Code::Kind GetCodeKind() const V8_OVERRIDE { return Code::LOAD_IC; }
|
||||
|
||||
virtual InlineCacheState GetICState() const V8_FINAL V8_OVERRIDE {
|
||||
return GENERIC;
|
||||
}
|
||||
|
||||
virtual ExtraICState GetExtraICState() const V8_FINAL V8_OVERRIDE {
|
||||
return state_.GetExtraICState();
|
||||
}
|
||||
|
||||
private:
|
||||
Major MajorKey() const { return LoadICTrampoline; }
|
||||
uint32_t MinorKey() const { return GetExtraICState(); }
|
||||
|
||||
virtual void Generate(MacroAssembler* masm);
|
||||
|
||||
const LoadIC::State state_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(LoadICTrampolineStub);
|
||||
};
|
||||
|
||||
|
||||
class KeyedLoadICTrampolineStub : public LoadICTrampolineStub {
|
||||
public:
|
||||
explicit KeyedLoadICTrampolineStub(Isolate* isolate)
|
||||
: LoadICTrampolineStub(isolate, LoadIC::State(0)) {}
|
||||
|
||||
virtual Code::Kind GetCodeKind() const V8_OVERRIDE {
|
||||
return Code::KEYED_LOAD_IC;
|
||||
}
|
||||
|
||||
private:
|
||||
Major MajorKey() const { return KeyedLoadICTrampoline; }
|
||||
|
||||
virtual void Generate(MacroAssembler* masm);
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(KeyedLoadICTrampolineStub);
|
||||
};
|
||||
|
||||
|
||||
class VectorLoadStub : public HydrogenCodeStub {
|
||||
public:
|
||||
explicit VectorLoadStub(Isolate* isolate, const LoadIC::State& state)
|
||||
: HydrogenCodeStub(isolate), state_(state) {}
|
||||
|
||||
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
|
||||
|
||||
virtual void InitializeInterfaceDescriptor(
|
||||
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
|
||||
|
||||
static void InstallDescriptors(Isolate* isolate);
|
||||
|
||||
virtual Code::Kind GetCodeKind() const V8_OVERRIDE { return Code::LOAD_IC; }
|
||||
|
||||
virtual InlineCacheState GetICState() const V8_FINAL V8_OVERRIDE {
|
||||
return GENERIC;
|
||||
}
|
||||
|
||||
virtual ExtraICState GetExtraICState() const V8_FINAL V8_OVERRIDE {
|
||||
return state_.GetExtraICState();
|
||||
}
|
||||
|
||||
private:
|
||||
Major MajorKey() const { return VectorLoad; }
|
||||
int NotMissMinorKey() const { return state_.GetExtraICState(); }
|
||||
|
||||
const LoadIC::State state_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(VectorLoadStub);
|
||||
};
|
||||
|
||||
|
||||
class VectorKeyedLoadStub : public VectorLoadStub {
|
||||
public:
|
||||
explicit VectorKeyedLoadStub(Isolate* isolate)
|
||||
: VectorLoadStub(isolate, LoadIC::State(0)) {}
|
||||
|
||||
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
|
||||
|
||||
virtual void InitializeInterfaceDescriptor(
|
||||
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
|
||||
|
||||
static void InstallDescriptors(Isolate* isolate);
|
||||
|
||||
virtual Code::Kind GetCodeKind() const V8_OVERRIDE {
|
||||
return Code::KEYED_LOAD_IC;
|
||||
}
|
||||
|
||||
private:
|
||||
Major MajorKey() const { return VectorKeyedLoad; }
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(VectorKeyedLoadStub);
|
||||
};
|
||||
|
||||
|
||||
class DoubleToIStub : public PlatformCodeStub {
|
||||
public:
|
||||
DoubleToIStub(Isolate* isolate, Register source, Register destination,
|
||||
|
@ -4500,6 +4500,20 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
|
||||
void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister());
|
||||
VectorLoadStub stub(isolate(), state_);
|
||||
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
||||
void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister());
|
||||
VectorKeyedLoadStub stub(isolate());
|
||||
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
||||
void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
|
||||
if (masm->isolate()->function_entry_hook() != NULL) {
|
||||
ProfileEntryHookStub stub(masm->isolate());
|
||||
|
14
src/ic/ic.cc
14
src/ic/ic.cc
@ -3189,6 +3189,20 @@ RUNTIME_FUNCTION(LoadElementWithInterceptor) {
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(VectorLoadIC_MissFromStubFailure) {
|
||||
// TODO(mvstanton): To be enabled when ICs can accept a vector and slot
|
||||
DCHECK(!"Not yet implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(VectorKeyedLoadIC_MissFromStubFailure) {
|
||||
// TODO(mvstanton): To be enabled when ICs can accept a vector and slot
|
||||
DCHECK(!"Not yet implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static const Address IC_utilities[] = {
|
||||
#define ADDR(name) FUNCTION_ADDR(name),
|
||||
IC_UTIL_LIST(ADDR) NULL
|
||||
|
@ -923,6 +923,8 @@ DECLARE_RUNTIME_FUNCTION(BinaryOpIC_Miss);
|
||||
DECLARE_RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite);
|
||||
DECLARE_RUNTIME_FUNCTION(CompareNilIC_Miss);
|
||||
DECLARE_RUNTIME_FUNCTION(ToBooleanIC_Miss);
|
||||
DECLARE_RUNTIME_FUNCTION(VectorLoadIC_MissFromStubFailure);
|
||||
DECLARE_RUNTIME_FUNCTION(VectorKeyedLoadIC_MissFromStubFailure);
|
||||
|
||||
// Support functions for callbacks handlers.
|
||||
DECLARE_RUNTIME_FUNCTION(StoreCallbackProperty);
|
||||
|
@ -4440,6 +4440,20 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
|
||||
void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister());
|
||||
VectorLoadStub stub(isolate(), state_);
|
||||
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
||||
void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister());
|
||||
VectorKeyedLoadStub stub(isolate());
|
||||
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
||||
void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
|
||||
if (masm->isolate()->function_entry_hook() != NULL) {
|
||||
ProfileEntryHookStub stub(masm->isolate());
|
||||
|
Loading…
Reference in New Issue
Block a user