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,9 +2709,9 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), instr->name());
EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), instr->typeof_mode(), PREMONOMORPHIC)
.code();
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
......@@ -2820,10 +2820,8 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
__ mov(LoadDescriptor::NameRegister(), instr->name());
EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF,
instr->hydrogen()->initialization_state())
.code();
Handle<Code> ic =
CodeFactory::LoadICInOptimizedCode(isolate(), NOT_INSIDE_TYPEOF).code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
......@@ -3051,13 +3049,9 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));
if (instr->hydrogen()->HasVectorAndSlot()) {
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
}
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(
isolate(), instr->hydrogen()->initialization_state())
.code();
Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
......@@ -4034,14 +4028,12 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
if (instr->hydrogen()->HasVectorAndSlot()) {
EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr);
}
EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr);
__ mov(StoreDescriptor::NameRegister(), instr->name());
Handle<Code> ic = CodeFactory::StoreICInOptimizedCode(
isolate(), instr->language_mode(),
instr->hydrogen()->initialization_state()).code();
Handle<Code> ic =
CodeFactory::StoreICInOptimizedCode(isolate(), instr->language_mode())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
......@@ -4260,13 +4252,11 @@ void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister()));
DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
if (instr->hydrogen()->HasVectorAndSlot()) {
EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr);
}
EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr);
Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode(
isolate(), instr->language_mode(),
instr->hydrogen()->initialization_state()).code();
isolate(), instr->language_mode())
.code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
......
......@@ -2007,10 +2007,7 @@ LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) {
LOperand* context = UseFixed(instr->context(), esi);
LOperand* global_object =
UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister());
LOperand* vector = NULL;
if (instr->HasVectorAndSlot()) {
vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
}
LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
LLoadGlobalGeneric* result =
new(zone()) LLoadGlobalGeneric(context, global_object, vector);
......@@ -2061,10 +2058,7 @@ LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
LOperand* context = UseFixed(instr->context(), esi);
LOperand* object =
UseFixed(instr->object(), LoadDescriptor::ReceiverRegister());
LOperand* vector = NULL;
if (instr->HasVectorAndSlot()) {
vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
}
LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
LLoadNamedGeneric* result = new(zone()) LLoadNamedGeneric(
context, object, vector);
return MarkAsCall(DefineFixed(result, eax), instr);
......@@ -2134,10 +2128,7 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
LOperand* object =
UseFixed(instr->object(), LoadDescriptor::ReceiverRegister());
LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister());
LOperand* vector = NULL;
if (instr->HasVectorAndSlot()) {
vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
}
LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
LLoadKeyedGeneric* result =
new(zone()) LLoadKeyedGeneric(context, object, key, vector);
return MarkAsCall(DefineFixed(result, eax), instr);
......@@ -2227,12 +2218,8 @@ LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
DCHECK(instr->key()->representation().IsTagged());
DCHECK(instr->value()->representation().IsTagged());
LOperand* slot = NULL;
LOperand* vector = NULL;
if (instr->HasVectorAndSlot()) {
slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
}
LOperand* slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
LOperand* vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
LStoreKeyedGeneric* result = new (zone())
LStoreKeyedGeneric(context, object, key, value, slot, vector);
......@@ -2346,12 +2333,8 @@ LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
LOperand* object =
UseFixed(instr->object(), StoreDescriptor::ReceiverRegister());
LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister());
LOperand* slot = NULL;
LOperand* vector = NULL;
if (instr->HasVectorAndSlot()) {
slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
}
LOperand* slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
LOperand* vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
LStoreNamedGeneric* result =
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