Commit 82bce6a9 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

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

  port 56d90782 (r36597)

  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.

BUG=

Review-Url: https://codereview.chromium.org/2030303002
Cr-Commit-Position: refs/heads/master@{#36700}
parent bf7034bf
...@@ -2709,8 +2709,8 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { ...@@ -2709,8 +2709,8 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), instr->name()); __ mov(LoadDescriptor::NameRegister(), 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);
} }
...@@ -2820,10 +2820,8 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { ...@@ -2820,10 +2820,8 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), instr->name()); __ mov(LoadDescriptor::NameRegister(), 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);
} }
...@@ -3051,13 +3049,9 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { ...@@ -3051,13 +3049,9 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
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()));
if (instr->hydrogen()->HasVectorAndSlot()) {
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
}
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code();
isolate(), instr->hydrogen()->initialization_state())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr); CallCode(ic, RelocInfo::CODE_TARGET, instr);
} }
...@@ -4034,14 +4028,12 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { ...@@ -4034,14 +4028,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(), instr->name()); __ mov(StoreDescriptor::NameRegister(), 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);
} }
...@@ -4260,13 +4252,11 @@ void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { ...@@ -4260,13 +4252,11 @@ 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);
} }
......
...@@ -2007,10 +2007,7 @@ LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { ...@@ -2007,10 +2007,7 @@ LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) {
LOperand* context = UseFixed(instr->context(), esi); LOperand* context = UseFixed(instr->context(), esi);
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);
...@@ -2061,10 +2058,7 @@ LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { ...@@ -2061,10 +2058,7 @@ LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
LOperand* context = UseFixed(instr->context(), esi); LOperand* context = UseFixed(instr->context(), esi);
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());
}
LLoadNamedGeneric* result = new(zone()) LLoadNamedGeneric( LLoadNamedGeneric* result = new(zone()) LLoadNamedGeneric(
context, object, vector); context, object, vector);
return MarkAsCall(DefineFixed(result, eax), instr); return MarkAsCall(DefineFixed(result, eax), instr);
...@@ -2134,10 +2128,7 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { ...@@ -2134,10 +2128,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());
}
LLoadKeyedGeneric* result = LLoadKeyedGeneric* result =
new(zone()) LLoadKeyedGeneric(context, object, key, vector); new(zone()) LLoadKeyedGeneric(context, object, key, vector);
return MarkAsCall(DefineFixed(result, eax), instr); return MarkAsCall(DefineFixed(result, eax), instr);
...@@ -2227,12 +2218,8 @@ LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { ...@@ -2227,12 +2218,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 = new (zone()) LStoreKeyedGeneric* result = new (zone())
LStoreKeyedGeneric(context, object, key, value, slot, vector); LStoreKeyedGeneric(context, object, key, value, slot, vector);
...@@ -2346,12 +2333,8 @@ LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { ...@@ -2346,12 +2333,8 @@ 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* 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, object, value, slot, vector); new (zone()) LStoreNamedGeneric(context, object, value, slot, vector);
......
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