Commit b0555da8 authored by chunyang.dai's avatar chunyang.dai Committed by Commit bot

X87: VectorICs: Lithium support for vector-based stores.

port 8a3cf4ec (r29310).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29411}
parent 29686a2b
...@@ -3107,6 +3107,20 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { ...@@ -3107,6 +3107,20 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
} }
template <class T>
void LCodeGen::EmitVectorStoreICRegisters(T* instr) {
Register vector_register = ToRegister(instr->temp_vector());
Register slot_register = ToRegister(instr->temp_slot());
AllowDeferredHandleDereference vector_structure_check;
Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
__ mov(vector_register, vector);
FeedbackVectorICSlot slot = instr->hydrogen()->slot();
int index = vector->GetIndex(slot);
__ mov(slot_register, Immediate(Smi::FromInt(index)));
}
void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
DCHECK(ToRegister(instr->context()).is(esi)); DCHECK(ToRegister(instr->context()).is(esi));
DCHECK(ToRegister(instr->global_object()) DCHECK(ToRegister(instr->global_object())
...@@ -4488,10 +4502,14 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { ...@@ -4488,10 +4502,14 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
if (instr->hydrogen()->HasVectorAndSlot()) {
EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr);
}
__ mov(StoreDescriptor::NameRegister(), instr->name()); __ mov(StoreDescriptor::NameRegister(), instr->name());
Handle<Code> ic = Handle<Code> ic = CodeFactory::StoreICInOptimizedCode(
StoreIC::initialize_stub(isolate(), instr->language_mode(), isolate(), instr->language_mode(),
instr->hydrogen()->initialization_state()); instr->hydrogen()->initialization_state()).code();
CallCode(ic, RelocInfo::CODE_TARGET, instr); CallCode(ic, RelocInfo::CODE_TARGET, instr);
} }
...@@ -4721,6 +4739,10 @@ void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { ...@@ -4721,6 +4739,10 @@ void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister()));
DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
if (instr->hydrogen()->HasVectorAndSlot()) {
EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr);
}
Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode(
isolate(), instr->language_mode(), isolate(), instr->language_mode(),
instr->hydrogen()->initialization_state()).code(); instr->hydrogen()->initialization_state()).code();
......
...@@ -336,6 +336,8 @@ class LCodeGen: public LCodeGenBase { ...@@ -336,6 +336,8 @@ class LCodeGen: public LCodeGenBase {
template <class T> template <class T>
void EmitVectorLoadICRegisters(T* instr); void EmitVectorLoadICRegisters(T* instr);
template <class T>
void EmitVectorStoreICRegisters(T* instr);
void EmitReturn(LReturn* instr, bool dynamic_frame_alignment); void EmitReturn(LReturn* instr, bool dynamic_frame_alignment);
......
...@@ -2347,8 +2347,15 @@ LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { ...@@ -2347,8 +2347,15 @@ LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
DCHECK(instr->key()->representation().IsTagged()); DCHECK(instr->key()->representation().IsTagged());
DCHECK(instr->value()->representation().IsTagged()); DCHECK(instr->value()->representation().IsTagged());
LStoreKeyedGeneric* result = LOperand* slot = NULL;
new(zone()) LStoreKeyedGeneric(context, object, key, value); LOperand* vector = NULL;
if (instr->HasVectorAndSlot()) {
slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
}
LStoreKeyedGeneric* result = new (zone())
LStoreKeyedGeneric(context, object, key, value, slot, vector);
return MarkAsCall(result, instr); return MarkAsCall(result, instr);
} }
...@@ -2459,9 +2466,15 @@ LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { ...@@ -2459,9 +2466,15 @@ LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
LOperand* object = LOperand* object =
UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); UseFixed(instr->object(), StoreDescriptor::ReceiverRegister());
LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister());
LOperand* slot = NULL;
LOperand* vector = NULL;
if (instr->HasVectorAndSlot()) {
slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
}
LStoreNamedGeneric* result = LStoreNamedGeneric* result =
new(zone()) LStoreNamedGeneric(context, object, value); new (zone()) LStoreNamedGeneric(context, object, value, slot, vector);
return MarkAsCall(result, instr); return MarkAsCall(result, instr);
} }
......
...@@ -2179,17 +2179,22 @@ class LStoreNamedField final : public LTemplateInstruction<0, 2, 2> { ...@@ -2179,17 +2179,22 @@ class LStoreNamedField final : public LTemplateInstruction<0, 2, 2> {
}; };
class LStoreNamedGeneric final : public LTemplateInstruction<0, 3, 0> { class LStoreNamedGeneric final : public LTemplateInstruction<0, 3, 2> {
public: public:
LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) { LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value,
LOperand* slot, LOperand* vector) {
inputs_[0] = context; inputs_[0] = context;
inputs_[1] = object; inputs_[1] = object;
inputs_[2] = value; inputs_[2] = value;
temps_[0] = slot;
temps_[1] = vector;
} }
LOperand* context() { return inputs_[0]; } LOperand* context() { return inputs_[0]; }
LOperand* object() { return inputs_[1]; } LOperand* object() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; } LOperand* value() { return inputs_[2]; }
LOperand* temp_slot() { return temps_[0]; }
LOperand* temp_vector() { return temps_[1]; }
DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
...@@ -2231,22 +2236,24 @@ class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> { ...@@ -2231,22 +2236,24 @@ class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> {
}; };
class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 0> { class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> {
public: public:
LStoreKeyedGeneric(LOperand* context, LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key,
LOperand* object, LOperand* value, LOperand* slot, LOperand* vector) {
LOperand* key,
LOperand* value) {
inputs_[0] = context; inputs_[0] = context;
inputs_[1] = object; inputs_[1] = object;
inputs_[2] = key; inputs_[2] = key;
inputs_[3] = value; inputs_[3] = value;
temps_[0] = slot;
temps_[1] = vector;
} }
LOperand* context() { return inputs_[0]; } LOperand* context() { return inputs_[0]; }
LOperand* object() { return inputs_[1]; } LOperand* object() { return inputs_[1]; }
LOperand* key() { return inputs_[2]; } LOperand* key() { return inputs_[2]; }
LOperand* value() { return inputs_[3]; } LOperand* value() { return inputs_[3]; }
LOperand* temp_slot() { return temps_[0]; }
LOperand* temp_vector() { return temps_[1]; }
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
......
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