Commit a86384f1 authored by mvstanton's avatar mvstanton Committed by Commit bot

Vector ICs: Introduce Store and KeyedStore IC code stubs.

Also introduce new interface descriptors for the trampoline and full
versions of those stubs.

Currently, the stubs aren't functional.

BUG=

Review URL: https://codereview.chromium.org/1149903005

Cr-Commit-Position: refs/heads/master@{#28597}
parent c5b7b9f7
......@@ -4604,6 +4604,58 @@ void KeyedLoadICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ bind(&miss);
StoreIC::GenerateMiss(masm);
}
void VectorKeyedStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorKeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorKeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ bind(&miss);
KeyedStoreIC::GenerateMiss(masm);
}
void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
if (masm->isolate()->function_entry_hook() != NULL) {
ProfileEntryHookStub stub(masm->isolate());
......
......@@ -27,6 +27,12 @@ const Register StoreDescriptor::NameRegister() { return r2; }
const Register StoreDescriptor::ValueRegister() { return r0; }
const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return r4; }
const Register VectorStoreICDescriptor::VectorRegister() { return r3; }
const Register StoreTransitionDescriptor::MapRegister() { return r3; }
......
......@@ -4736,6 +4736,58 @@ void KeyedLoadICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ Bind(&miss);
StoreIC::GenerateMiss(masm);
}
void VectorKeyedStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorKeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorKeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ Bind(&miss);
KeyedStoreIC::GenerateMiss(masm);
}
// The entry hook is a "BumpSystemStackPointer" instruction (sub), followed by
// a "Push lr" instruction, followed by a call.
static const unsigned int kProfileEntryHookCallSize =
......
......@@ -27,6 +27,12 @@ const Register StoreDescriptor::NameRegister() { return x2; }
const Register StoreDescriptor::ValueRegister() { return x0; }
const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return x4; }
const Register VectorStoreICDescriptor::VectorRegister() { return x3; }
const Register StoreTransitionDescriptor::MapRegister() { return x3; }
......
......@@ -54,6 +54,10 @@ namespace internal {
V(StubFailureTrampoline) \
V(SubString) \
V(ToNumber) \
V(VectorStoreICTrampoline) \
V(VectorKeyedStoreICTrampoline) \
V(VectorStoreIC) \
V(VectorKeyedStoreIC) \
/* HydrogenCodeStubs */ \
V(AllocateHeapNumber) \
V(ArrayNArgumentsConstructor) \
......@@ -2152,6 +2156,44 @@ class KeyedLoadICTrampolineStub : public LoadICTrampolineStub {
};
class VectorStoreICTrampolineStub : public PlatformCodeStub {
public:
VectorStoreICTrampolineStub(Isolate* isolate, const StoreICState& state)
: PlatformCodeStub(isolate) {
minor_key_ = state.GetExtraICState();
}
Code::Kind GetCodeKind() const override { return Code::STORE_IC; }
InlineCacheState GetICState() const final { return DEFAULT; }
ExtraICState GetExtraICState() const final {
return static_cast<ExtraICState>(minor_key_);
}
protected:
StoreICState state() const {
return StoreICState(static_cast<ExtraICState>(minor_key_));
}
private:
DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreICTrampoline);
DEFINE_PLATFORM_CODE_STUB(VectorStoreICTrampoline, PlatformCodeStub);
};
class VectorKeyedStoreICTrampolineStub : public VectorStoreICTrampolineStub {
public:
VectorKeyedStoreICTrampolineStub(Isolate* isolate, const StoreICState& state)
: VectorStoreICTrampolineStub(isolate, state) {}
Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; }
DEFINE_PLATFORM_CODE_STUB(VectorKeyedStoreICTrampoline,
VectorStoreICTrampolineStub);
};
class CallICTrampolineStub : public PlatformCodeStub {
public:
CallICTrampolineStub(Isolate* isolate, const CallICState& state)
......@@ -2197,10 +2239,8 @@ class LoadICStub : public PlatformCodeStub {
void GenerateForTrampoline(MacroAssembler* masm);
Code::Kind GetCodeKind() const override { return Code::LOAD_IC; }
InlineCacheState GetICState() const final override { return DEFAULT; }
ExtraICState GetExtraICState() const final override {
InlineCacheState GetICState() const final { return DEFAULT; }
ExtraICState GetExtraICState() const final {
return static_cast<ExtraICState>(minor_key_);
}
......@@ -2219,8 +2259,7 @@ class KeyedLoadICStub : public PlatformCodeStub {
void GenerateForTrampoline(MacroAssembler* masm);
Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; }
InlineCacheState GetICState() const final override { return DEFAULT; }
InlineCacheState GetICState() const final { return DEFAULT; }
DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector);
DEFINE_PLATFORM_CODE_STUB(KeyedLoadIC, PlatformCodeStub);
......@@ -2230,6 +2269,49 @@ class KeyedLoadICStub : public PlatformCodeStub {
};
class VectorStoreICStub : public PlatformCodeStub {
public:
VectorStoreICStub(Isolate* isolate, const StoreICState& state)
: PlatformCodeStub(isolate) {
minor_key_ = state.GetExtraICState();
}
void GenerateForTrampoline(MacroAssembler* masm);
Code::Kind GetCodeKind() const final { return Code::STORE_IC; }
InlineCacheState GetICState() const final { return DEFAULT; }
ExtraICState GetExtraICState() const final {
return static_cast<ExtraICState>(minor_key_);
}
DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreIC);
DEFINE_PLATFORM_CODE_STUB(VectorStoreIC, PlatformCodeStub);
protected:
void GenerateImpl(MacroAssembler* masm, bool in_frame);
};
class VectorKeyedStoreICStub : public PlatformCodeStub {
public:
VectorKeyedStoreICStub(Isolate* isolate, const StoreICState& state)
: PlatformCodeStub(isolate) {
minor_key_ = state.GetExtraICState();
}
void GenerateForTrampoline(MacroAssembler* masm);
Code::Kind GetCodeKind() const final { return Code::KEYED_STORE_IC; }
InlineCacheState GetICState() const final { return DEFAULT; }
DEFINE_CALL_INTERFACE_DESCRIPTOR(VectorStoreIC);
DEFINE_PLATFORM_CODE_STUB(VectorKeyedStoreIC, PlatformCodeStub);
protected:
void GenerateImpl(MacroAssembler* masm, bool in_frame);
};
class DoubleToIStub : public PlatformCodeStub {
public:
DoubleToIStub(Isolate* isolate, Register source, Register destination,
......
......@@ -4650,6 +4650,58 @@ void KeyedLoadICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ bind(&miss);
StoreIC::GenerateMiss(masm);
}
void VectorKeyedStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorKeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorKeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ bind(&miss);
KeyedStoreIC::GenerateMiss(masm);
}
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, ebx);
CallICStub stub(isolate(), state());
......
......@@ -26,6 +26,12 @@ const Register StoreDescriptor::NameRegister() { return ecx; }
const Register StoreDescriptor::ValueRegister() { return eax; }
const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return edi; }
const Register VectorStoreICDescriptor::VectorRegister() { return ebx; }
const Register StoreTransitionDescriptor::MapRegister() { return ebx; }
......
......@@ -121,6 +121,30 @@ void LoadWithVectorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
}
void VectorStoreICDescriptor::Initialize(CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(),
NameRegister(), ValueRegister(),
SlotRegister(), VectorRegister()};
Representation representations[] = {
Representation::Tagged(), Representation::Tagged(),
Representation::Tagged(), Representation::Tagged(),
Representation::Smi(), Representation::Tagged()};
data->Initialize(arraysize(registers), registers, representations);
}
void VectorStoreICTrampolineDescriptor::Initialize(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(),
ValueRegister(), SlotRegister()};
Representation representations[] = {
Representation::Tagged(), Representation::Tagged(),
Representation::Tagged(), Representation::Tagged(),
Representation::Smi()};
data->Initialize(arraysize(registers), registers, representations);
}
void ApiGetterDescriptor::Initialize(CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), function_address()};
Representation representations[] = {Representation::Tagged(),
......
......@@ -18,6 +18,8 @@ class PlatformInterfaceDescriptor;
V(Store) \
V(StoreTransition) \
V(ElementTransitionAndStore) \
V(VectorStoreICTrampoline) \
V(VectorStoreIC) \
V(Instanceof) \
V(LoadWithVector) \
V(FastNewClosure) \
......@@ -256,6 +258,32 @@ class InstanceofDescriptor : public CallInterfaceDescriptor {
};
class VectorStoreICTrampolineDescriptor : public StoreDescriptor {
public:
DECLARE_DESCRIPTOR(VectorStoreICTrampolineDescriptor, StoreDescriptor)
enum ParameterIndices { kReceiverIndex, kNameIndex, kValueIndex, kSlotIndex };
static const Register SlotRegister();
};
class VectorStoreICDescriptor : public VectorStoreICTrampolineDescriptor {
public:
DECLARE_DESCRIPTOR(VectorStoreICDescriptor, VectorStoreICTrampolineDescriptor)
enum ParameterIndices {
kReceiverIndex,
kNameIndex,
kValueIndex,
kSlotIndex,
kVectorIndex
};
static const Register VectorRegister();
};
class LoadWithVectorDescriptor : public LoadDescriptor {
public:
DECLARE_DESCRIPTOR(LoadWithVectorDescriptor, LoadDescriptor)
......
......@@ -4827,6 +4827,58 @@ void KeyedLoadICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ bind(&miss);
StoreIC::GenerateMiss(masm);
}
void VectorKeyedStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorKeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorKeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ bind(&miss);
KeyedStoreIC::GenerateMiss(masm);
}
void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
if (masm->isolate()->function_entry_hook() != NULL) {
ProfileEntryHookStub stub(masm->isolate());
......
......@@ -27,6 +27,12 @@ const Register StoreDescriptor::NameRegister() { return a2; }
const Register StoreDescriptor::ValueRegister() { return a0; }
const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return t0; }
const Register VectorStoreICDescriptor::VectorRegister() { return a3; }
const Register StoreTransitionDescriptor::MapRegister() { return a3; }
......
......@@ -4869,6 +4869,58 @@ void KeyedLoadICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ bind(&miss);
StoreIC::GenerateMiss(masm);
}
void VectorKeyedStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorKeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorKeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ bind(&miss);
KeyedStoreIC::GenerateMiss(masm);
}
void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
if (masm->isolate()->function_entry_hook() != NULL) {
ProfileEntryHookStub stub(masm->isolate());
......
......@@ -27,6 +27,12 @@ const Register StoreDescriptor::NameRegister() { return a2; }
const Register StoreDescriptor::ValueRegister() { return a0; }
const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return a4; }
const Register VectorStoreICDescriptor::VectorRegister() { return a3; }
const Register StoreTransitionDescriptor::MapRegister() { return a3; }
......
......@@ -4575,6 +4575,58 @@ void KeyedLoadICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ bind(&miss);
StoreIC::GenerateMiss(masm);
}
void VectorKeyedStoreICStub::Generate(MacroAssembler* masm) {
GenerateImpl(masm, false);
}
void VectorKeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) {
GenerateImpl(masm, true);
}
void VectorKeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
Label miss;
// TODO(mvstanton): Implement.
__ bind(&miss);
KeyedStoreIC::GenerateMiss(masm);
}
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, rbx);
CallICStub stub(isolate(), state());
......
......@@ -27,6 +27,12 @@ const Register StoreDescriptor::NameRegister() { return rcx; }
const Register StoreDescriptor::ValueRegister() { return rax; }
const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return rdi; }
const Register VectorStoreICDescriptor::VectorRegister() { return rbx; }
const Register StoreTransitionDescriptor::MapRegister() { return rbx; }
......
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