S390: IC: Eliminate initialization_state as a factor in IC installation.

Port 56d90782a5

Original commit message:

    In Crankshaft, we would install special ICs that didn't need a vector and slot
    in the MEGAMORPHIC case. This optimization limits our hand against future
    improvements.

R=mvstanton@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com, bjaideep@ca.ibm.com
BUG=

Review-Url: https://codereview.chromium.org/2028663002
Cr-Commit-Position: refs/heads/master@{#36620}
This commit is contained in:
jyan 2016-05-31 10:00:56 -07:00 committed by Commit bot
parent 2f5ba83bc0
commit 0ac67d74c6
2 changed files with 20 additions and 51 deletions

View File

@ -2676,9 +2676,9 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); __ mov(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( Handle<Code> ic =
isolate(), instr->typeof_mode(), PREMONOMORPHIC) CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode())
.code(); .code();
CallCode(ic, RelocInfo::CODE_TARGET, instr); CallCode(ic, RelocInfo::CODE_TARGET, instr);
} }
@ -2779,10 +2779,8 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
// Name is always in r4. // Name is always in r4.
__ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); __ mov(LoadDescriptor::NameRegister(), Operand(instr->name()));
EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( Handle<Code> ic =
isolate(), NOT_INSIDE_TYPEOF, CodeFactory::LoadICInOptimizedCode(isolate(), NOT_INSIDE_TYPEOF).code();
instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr); CallCode(ic, RelocInfo::CODE_TARGET, instr);
} }
@ -3129,14 +3127,9 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
DCHECK(ToRegister(instr->context()).is(cp)); DCHECK(ToRegister(instr->context()).is(cp));
DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
if (instr->hydrogen()->HasVectorAndSlot()) { Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code();
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
}
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr); CallCode(ic, RelocInfo::CODE_TARGET, instr);
} }
@ -3990,15 +3983,12 @@ 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);
EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr);
}
__ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); __ mov(StoreDescriptor::NameRegister(), Operand(instr->name()));
Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( Handle<Code> ic =
isolate(), instr->language_mode(), CodeFactory::StoreICInOptimizedCode(isolate(), instr->language_mode())
instr->hydrogen()->initialization_state()) .code();
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr); CallCode(ic, RelocInfo::CODE_TARGET, instr);
} }
@ -4291,13 +4281,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);
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(); .code();
CallCode(ic, RelocInfo::CODE_TARGET, instr); CallCode(ic, RelocInfo::CODE_TARGET, instr);
} }

View File

@ -1814,10 +1814,7 @@ LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) {
LOperand* context = UseFixed(instr->context(), cp); LOperand* context = UseFixed(instr->context(), cp);
LOperand* global_object = LOperand* global_object =
UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister());
LOperand* vector = NULL; LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
if (instr->HasVectorAndSlot()) {
vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
}
LLoadGlobalGeneric* result = LLoadGlobalGeneric* result =
new (zone()) LLoadGlobalGeneric(context, global_object, vector); new (zone()) LLoadGlobalGeneric(context, global_object, vector);
return MarkAsCall(DefineFixed(result, r2), instr); return MarkAsCall(DefineFixed(result, r2), instr);
@ -1859,10 +1856,7 @@ LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
LOperand* context = UseFixed(instr->context(), cp); LOperand* context = UseFixed(instr->context(), cp);
LOperand* object = LOperand* object =
UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); UseFixed(instr->object(), LoadDescriptor::ReceiverRegister());
LOperand* vector = NULL; LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
if (instr->HasVectorAndSlot()) {
vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
}
LInstruction* result = LInstruction* result =
DefineFixed(new (zone()) LLoadNamedGeneric(context, object, vector), r2); DefineFixed(new (zone()) LLoadNamedGeneric(context, object, vector), r2);
@ -1928,10 +1922,7 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
LOperand* object = LOperand* object =
UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); UseFixed(instr->object(), LoadDescriptor::ReceiverRegister());
LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister()); LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister());
LOperand* vector = NULL; LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
if (instr->HasVectorAndSlot()) {
vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
}
LInstruction* result = DefineFixed( LInstruction* result = DefineFixed(
new (zone()) LLoadKeyedGeneric(context, object, key, vector), r2); new (zone()) LLoadKeyedGeneric(context, object, key, vector), r2);
@ -1988,12 +1979,8 @@ 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());
LOperand* slot = NULL; LOperand* slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
LOperand* vector = NULL; LOperand* vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
if (instr->HasVectorAndSlot()) {
slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
}
LStoreKeyedGeneric* result = LStoreKeyedGeneric* result =
new (zone()) LStoreKeyedGeneric(context, obj, key, val, slot, vector); new (zone()) LStoreKeyedGeneric(context, obj, key, val, slot, vector);
@ -2076,13 +2063,8 @@ LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
LOperand* obj = LOperand* obj =
UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); UseFixed(instr->object(), StoreDescriptor::ReceiverRegister());
LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister());
LOperand* slot = NULL; LOperand* slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
LOperand* vector = NULL; LOperand* vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
if (instr->HasVectorAndSlot()) {
slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
}
LStoreNamedGeneric* result = LStoreNamedGeneric* result =
new (zone()) LStoreNamedGeneric(context, obj, val, slot, vector); new (zone()) LStoreNamedGeneric(context, obj, val, slot, vector);
return MarkAsCall(result, instr); return MarkAsCall(result, instr);