Revision: 22513
Author: [email protected]
Date: Mon Jul 21 19:09:56 2014 UTC
Log: MIPS: Introduce FLAG_vector_ics.
Port r22500 (8fd2751)
Original commit message:
When FLAG_vector_ics is true, then AST nodes that use Load and KeyedLoad ICs
will allocate a type vector slot to store feedback information. Full codegen
will emit a load of the slot into a register if the flag is on.
Support is incomplete, right now the IC doesn't know how to use the feedback
slot.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/403393008
Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=22513
Modified:
/branches/bleeding_edge/src/mips/full-codegen-mips.cc
/branches/bleeding_edge/src/mips/ic-mips.cc
/branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
/branches/bleeding_edge/src/mips/lithium-mips.cc
/branches/bleeding_edge/src/mips/lithium-mips.h
/branches/bleeding_edge/src/mips64/full-codegen-mips64.cc
/branches/bleeding_edge/src/mips64/ic-mips64.cc
/branches/bleeding_edge/src/mips64/lithium-codegen-mips64.cc
/branches/bleeding_edge/src/mips64/lithium-mips64.cc
/branches/bleeding_edge/src/mips64/lithium-mips64.h
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Mon Jul 21
10:20:54 2014 UTC
+++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Mon Jul 21
19:09:56 2014 UTC
@@ -1352,7 +1352,7 @@
}
-void FullCodeGenerator::EmitLoadGlobalCheckExtensions(Variable* var,
+void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
TypeofState
typeof_state,
Label* slow) {
Register current = cp;
@@ -1398,7 +1398,12 @@
}
__ lw(LoadIC::ReceiverRegister(), GlobalObjectOperand());
- __ li(LoadIC::NameRegister(), Operand(var->name()));
+ __ li(LoadIC::NameRegister(), Operand(proxy->var()->name()));
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
+ }
+
ContextualMode mode = (typeof_state == INSIDE_TYPEOF)
? NOT_CONTEXTUAL
: CONTEXTUAL;
@@ -1436,7 +1441,7 @@
}
-void FullCodeGenerator::EmitDynamicLookupFastCase(Variable* var,
+void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy,
TypeofState typeof_state,
Label* slow,
Label* done) {
@@ -1445,8 +1450,9 @@
// introducing variables. In those cases, we do not want to
// perform a runtime call for all variables in the scope
// containing the eval.
+ Variable* var = proxy->var();
if (var->mode() == DYNAMIC_GLOBAL) {
- EmitLoadGlobalCheckExtensions(var, typeof_state, slow);
+ EmitLoadGlobalCheckExtensions(proxy, typeof_state, slow);
__ Branch(done);
} else if (var->mode() == DYNAMIC_LOCAL) {
Variable* local = var->local_if_not_shadowed();
@@ -1482,6 +1488,10 @@
Comment cmnt(masm_, "[ Global variable");
__ lw(LoadIC::ReceiverRegister(), GlobalObjectOperand());
__ li(LoadIC::NameRegister(), Operand(var->name()));
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
+ }
CallLoadIC(CONTEXTUAL);
context()->Plug(v0);
break;
@@ -1560,7 +1570,7 @@
Label done, slow;
// Generate code for loading from variables potentially shadowed
// by eval-introduced variables.
- EmitDynamicLookupFastCase(var, NOT_INSIDE_TYPEOF, &slow, &done);
+ EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done);
__ bind(&slow);
__ li(a1, Operand(var->name()));
__ Push(cp, a1); // Context and name.
@@ -2081,6 +2091,10 @@
__ bind(&l_call);
__ lw(load_receiver, MemOperand(sp, kPointerSize));
__ lw(load_name, MemOperand(sp, 2 * kPointerSize));
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot())));
+ }
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
CallIC(ic, TypeFeedbackId::None());
__ mov(a0, v0);
@@ -2097,6 +2111,10 @@
__ push(load_receiver); // save result
__ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(expr->DoneFeedbackSlot())));
+ }
CallLoadIC(NOT_CONTEXTUAL); //
v0=result.done
__ mov(a0, v0);
Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
@@ -2106,6 +2124,10 @@
// result.value
__ pop(load_receiver); // result
__ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(expr->ValueFeedbackSlot())));
+ }
CallLoadIC(NOT_CONTEXTUAL); //
v0=result.value
context()->DropAndPlug(2, v0); // drop iter
and g
break;
@@ -2269,16 +2291,26 @@
SetSourcePosition(prop->position());
Literal* key = prop->key()->AsLiteral();
__ li(LoadIC::NameRegister(), Operand(key->value()));
- // Call load IC. It has register arguments receiver and property.
- CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId());
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(prop->PropertyFeedbackSlot())));
+ CallLoadIC(NOT_CONTEXTUAL);
+ } else {
+ CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId());
+ }
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
- // Call keyed load IC. It has register arguments receiver and key.
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
- CallIC(ic, prop->PropertyFeedbackId());
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(prop->PropertyFeedbackSlot())));
+ CallIC(ic);
+ } else {
+ CallIC(ic, prop->PropertyFeedbackId());
+ }
}
@@ -2756,7 +2788,7 @@
{ PreservePositionScope scope(masm()->positions_recorder());
// Generate code for loading from variables potentially shadowed
// by eval-introduced variables.
- EmitDynamicLookupFastCase(proxy->var(), NOT_INSIDE_TYPEOF, &slow,
&done);
+ EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done);
}
__ bind(&slow);
@@ -4086,7 +4118,13 @@
// Load the function from the receiver.
__ li(LoadIC::NameRegister(), Operand(expr->name()));
- CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId());
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(expr->CallRuntimeFeedbackSlot())));
+ CallLoadIC(NOT_CONTEXTUAL);
+ } else {
+ CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId());
+ }
// Push the target function under the receiver.
__ lw(at, MemOperand(sp, 0));
@@ -4425,6 +4463,10 @@
Comment cmnt(masm_, "[ Global variable");
__ lw(LoadIC::ReceiverRegister(), GlobalObjectOperand());
__ li(LoadIC::NameRegister(), Operand(proxy->name()));
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
+ }
// Use a regular load, not a contextual load, to avoid a reference
// error.
CallLoadIC(NOT_CONTEXTUAL);
@@ -4436,7 +4478,7 @@
// Generate code for loading from variables potentially shadowed
// by eval-introduced variables.
- EmitDynamicLookupFastCase(proxy->var(), INSIDE_TYPEOF, &slow, &done);
+ EmitDynamicLookupFastCase(proxy, INSIDE_TYPEOF, &slow, &done);
__ bind(&slow);
__ li(a0, Operand(proxy->name()));
=======================================
--- /branches/bleeding_edge/src/mips/ic-mips.cc Fri Jul 18 17:11:52 2014 UTC
+++ /branches/bleeding_edge/src/mips/ic-mips.cc Mon Jul 21 19:09:56 2014 UTC
@@ -510,6 +510,18 @@
// IC register specifications
const Register LoadIC::ReceiverRegister() { return a1; }
const Register LoadIC::NameRegister() { return a2; }
+
+
+const Register LoadIC::SlotRegister() {
+ ASSERT(FLAG_vector_ics);
+ return a0;
+}
+
+
+const Register LoadIC::VectorRegister() {
+ ASSERT(FLAG_vector_ics);
+ return a3;
+}
const Register StoreIC::ReceiverRegister() { return a1; }
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Jul 21
10:20:54 2014 UTC
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Jul 21
19:09:56 2014 UTC
@@ -2913,6 +2913,15 @@
ASSERT(ToRegister(instr->result()).is(v0));
__ li(LoadIC::NameRegister(), Operand(instr->name()));
+ if (FLAG_vector_ics) {
+ Register vector = ToRegister(instr->temp_vector());
+ ASSERT(vector.is(LoadIC::VectorRegister()));
+ __ li(vector, instr->hydrogen()->feedback_vector());
+ // No need to allocate this register.
+ ASSERT(LoadIC::SlotRegister().is(a0));
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(instr->hydrogen()->slot())));
+ }
ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
CallCode(ic, RelocInfo::CODE_TARGET, instr);
@@ -3038,6 +3047,15 @@
// Name is always in a2.
__ li(LoadIC::NameRegister(), Operand(instr->name()));
+ if (FLAG_vector_ics) {
+ Register vector = ToRegister(instr->temp_vector());
+ ASSERT(vector.is(LoadIC::VectorRegister()));
+ __ li(vector, instr->hydrogen()->feedback_vector());
+ // No need to allocate this register.
+ ASSERT(LoadIC::SlotRegister().is(a0));
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(instr->hydrogen()->slot())));
+ }
Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@@ -3359,6 +3377,16 @@
ASSERT(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
ASSERT(ToRegister(instr->key()).is(LoadIC::NameRegister()));
+ if (FLAG_vector_ics) {
+ Register vector = ToRegister(instr->temp_vector());
+ ASSERT(vector.is(LoadIC::VectorRegister()));
+ __ li(vector, instr->hydrogen()->feedback_vector());
+ // No need to allocate this register.
+ ASSERT(LoadIC::SlotRegister().is(a0));
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(instr->hydrogen()->slot())));
+ }
+
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Thu Jul 17 18:24:59
2014 UTC
+++ /branches/bleeding_edge/src/mips/lithium-mips.cc Mon Jul 21 19:09:56
2014 UTC
@@ -2033,8 +2033,12 @@
LOperand* context = UseFixed(instr->context(), cp);
LOperand* global_object = UseFixed(instr->global_object(),
LoadIC::ReceiverRegister());
+ LOperand* vector = NULL;
+ if (FLAG_vector_ics) {
+ vector = FixedTemp(LoadIC::VectorRegister());
+ }
LLoadGlobalGeneric* result =
- new(zone()) LLoadGlobalGeneric(context, global_object);
+ new(zone()) LLoadGlobalGeneric(context, global_object, vector);
return MarkAsCall(DefineFixed(result, v0), instr);
}
@@ -2087,8 +2091,13 @@
LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
LOperand* context = UseFixed(instr->context(), cp);
LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister());
+ LOperand* vector = NULL;
+ if (FLAG_vector_ics) {
+ vector = FixedTemp(LoadIC::VectorRegister());
+ }
+
LInstruction* result =
- DefineFixed(new(zone()) LLoadNamedGeneric(context, object), v0);
+ DefineFixed(new(zone()) LLoadNamedGeneric(context, object, vector),
v0);
return MarkAsCall(result, instr);
}
@@ -2148,9 +2157,14 @@
LOperand* context = UseFixed(instr->context(), cp);
LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister());
LOperand* key = UseFixed(instr->key(), LoadIC::NameRegister());
+ LOperand* vector = NULL;
+ if (FLAG_vector_ics) {
+ vector = FixedTemp(LoadIC::VectorRegister());
+ }
LInstruction* result =
- DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key), v0);
+ DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key,
vector),
+ v0);
return MarkAsCall(result, instr);
}
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.h Thu Jul 17 18:24:59
2014 UTC
+++ /branches/bleeding_edge/src/mips/lithium-mips.h Mon Jul 21 19:09:56
2014 UTC
@@ -1546,15 +1546,17 @@
};
-class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 1> {
public:
- LLoadNamedGeneric(LOperand* context, LOperand* object) {
+ LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector)
{
inputs_[0] = context;
inputs_[1] = object;
+ temps_[0] = vector;
}
LOperand* context() { return inputs_[0]; }
LOperand* object() { return inputs_[1]; }
+ LOperand* temp_vector() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
@@ -1615,19 +1617,23 @@
};
-class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> {
+class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 1> {
public:
- LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key) {
+ LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key,
+ LOperand* vector) {
inputs_[0] = context;
inputs_[1] = object;
inputs_[2] = key;
+ temps_[0] = vector;
}
LOperand* context() { return inputs_[0]; }
LOperand* object() { return inputs_[1]; }
LOperand* key() { return inputs_[2]; }
+ LOperand* temp_vector() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
+ DECLARE_HYDROGEN_ACCESSOR(LoadKeyedGeneric)
};
@@ -1638,15 +1644,18 @@
};
-class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 1> {
public:
- LLoadGlobalGeneric(LOperand* context, LOperand* global_object) {
+ LLoadGlobalGeneric(LOperand* context, LOperand* global_object,
+ LOperand* vector) {
inputs_[0] = context;
inputs_[1] = global_object;
+ temps_[0] = vector;
}
LOperand* context() { return inputs_[0]; }
LOperand* global_object() { return inputs_[1]; }
+ LOperand* temp_vector() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
=======================================
--- /branches/bleeding_edge/src/mips64/full-codegen-mips64.cc Mon Jul 21
10:20:54 2014 UTC
+++ /branches/bleeding_edge/src/mips64/full-codegen-mips64.cc Mon Jul 21
19:09:56 2014 UTC
@@ -1347,7 +1347,7 @@
}
-void FullCodeGenerator::EmitLoadGlobalCheckExtensions(Variable* var,
+void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
TypeofState
typeof_state,
Label* slow) {
Register current = cp;
@@ -1393,7 +1393,12 @@
}
__ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand());
- __ li(LoadIC::NameRegister(), Operand(var->name()));
+ __ li(LoadIC::NameRegister(), Operand(proxy->var()->name()));
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
+ }
+
ContextualMode mode = (typeof_state == INSIDE_TYPEOF)
? NOT_CONTEXTUAL
: CONTEXTUAL;
@@ -1431,7 +1436,7 @@
}
-void FullCodeGenerator::EmitDynamicLookupFastCase(Variable* var,
+void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy,
TypeofState typeof_state,
Label* slow,
Label* done) {
@@ -1440,8 +1445,9 @@
// introducing variables. In those cases, we do not want to
// perform a runtime call for all variables in the scope
// containing the eval.
+ Variable* var = proxy->var();
if (var->mode() == DYNAMIC_GLOBAL) {
- EmitLoadGlobalCheckExtensions(var, typeof_state, slow);
+ EmitLoadGlobalCheckExtensions(proxy, typeof_state, slow);
__ Branch(done);
} else if (var->mode() == DYNAMIC_LOCAL) {
Variable* local = var->local_if_not_shadowed();
@@ -1479,6 +1485,10 @@
// object (receiver) in a0.
__ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand());
__ li(LoadIC::NameRegister(), Operand(var->name()));
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
+ }
CallLoadIC(CONTEXTUAL);
context()->Plug(v0);
break;
@@ -1557,7 +1567,7 @@
Label done, slow;
// Generate code for loading from variables potentially shadowed
// by eval-introduced variables.
- EmitDynamicLookupFastCase(var, NOT_INSIDE_TYPEOF, &slow, &done);
+ EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done);
__ bind(&slow);
__ li(a1, Operand(var->name()));
__ Push(cp, a1); // Context and name.
@@ -2076,6 +2086,10 @@
__ bind(&l_call);
__ ld(load_receiver, MemOperand(sp, kPointerSize));
__ ld(load_name, MemOperand(sp, 2 * kPointerSize));
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot())));
+ }
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
CallIC(ic, TypeFeedbackId::None());
__ mov(a0, v0);
@@ -2090,8 +2104,12 @@
// if (!result.done) goto l_try;
__ Move(load_receiver, v0);
- __ push(load_receiver); // save result
+ __ push(load_receiver); // save result
__ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(expr->DoneFeedbackSlot())));
+ }
CallLoadIC(NOT_CONTEXTUAL); //
v0=result.done
__ mov(a0, v0);
Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
@@ -2101,6 +2119,10 @@
// result.value
__ pop(load_receiver); // result
__ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(expr->ValueFeedbackSlot())));
+ }
CallLoadIC(NOT_CONTEXTUAL); //
v0=result.value
context()->DropAndPlug(2, v0); // drop iter
and g
break;
@@ -2266,8 +2288,13 @@
SetSourcePosition(prop->position());
Literal* key = prop->key()->AsLiteral();
__ li(LoadIC::NameRegister(), Operand(key->value()));
- // Call load IC. It has register arguments receiver and property.
- CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId());
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(prop->PropertyFeedbackSlot())));
+ CallLoadIC(NOT_CONTEXTUAL);
+ } else {
+ CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId());
+ }
}
@@ -2275,7 +2302,13 @@
SetSourcePosition(prop->position());
// Call keyed load IC. It has register arguments receiver and key.
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
- CallIC(ic, prop->PropertyFeedbackId());
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(prop->PropertyFeedbackSlot())));
+ CallIC(ic);
+ } else {
+ CallIC(ic, prop->PropertyFeedbackId());
+ }
}
@@ -2753,7 +2786,7 @@
{ PreservePositionScope scope(masm()->positions_recorder());
// Generate code for loading from variables potentially shadowed
// by eval-introduced variables.
- EmitDynamicLookupFastCase(proxy->var(), NOT_INSIDE_TYPEOF, &slow,
&done);
+ EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done);
}
__ bind(&slow);
@@ -4083,7 +4116,13 @@
// Load the function from the receiver.
__ li(LoadIC::NameRegister(), Operand(expr->name()));
- CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId());
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(expr->CallRuntimeFeedbackSlot())));
+ CallLoadIC(NOT_CONTEXTUAL);
+ } else {
+ CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId());
+ }
// Push the target function under the receiver.
__ ld(at, MemOperand(sp, 0));
@@ -4422,6 +4461,10 @@
Comment cmnt(masm_, "[ Global variable");
__ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand());
__ li(LoadIC::NameRegister(), Operand(proxy->name()));
+ if (FLAG_vector_ics) {
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
+ }
// Use a regular load, not a contextual load, to avoid a reference
// error.
CallLoadIC(NOT_CONTEXTUAL);
@@ -4433,7 +4476,7 @@
// Generate code for loading from variables potentially shadowed
// by eval-introduced variables.
- EmitDynamicLookupFastCase(proxy->var(), INSIDE_TYPEOF, &slow, &done);
+ EmitDynamicLookupFastCase(proxy, INSIDE_TYPEOF, &slow, &done);
__ bind(&slow);
__ li(a0, Operand(proxy->name()));
=======================================
--- /branches/bleeding_edge/src/mips64/ic-mips64.cc Mon Jul 21 03:09:19
2014 UTC
+++ /branches/bleeding_edge/src/mips64/ic-mips64.cc Mon Jul 21 19:09:56
2014 UTC
@@ -511,7 +511,19 @@
const Register LoadIC::NameRegister() { return a2; }
-const Register StoreIC::ReceiverRegister() { return a1; }
+const Register LoadIC::SlotRegister() {
+ ASSERT(FLAG_vector_ics);
+ return a0;
+}
+
+
+const Register LoadIC::VectorRegister() {
+ ASSERT(FLAG_vector_ics);
+ return a3;
+}
+
+
+ const Register StoreIC::ReceiverRegister() { return a1; }
const Register StoreIC::NameRegister() { return a2; }
const Register StoreIC::ValueRegister() { return a0; }
=======================================
--- /branches/bleeding_edge/src/mips64/lithium-codegen-mips64.cc Mon Jul 21
10:20:54 2014 UTC
+++ /branches/bleeding_edge/src/mips64/lithium-codegen-mips64.cc Mon Jul 21
19:09:56 2014 UTC
@@ -2881,6 +2881,15 @@
ASSERT(ToRegister(instr->result()).is(v0));
__ li(LoadIC::NameRegister(), Operand(instr->name()));
+ if (FLAG_vector_ics) {
+ Register vector = ToRegister(instr->temp_vector());
+ ASSERT(vector.is(LoadIC::VectorRegister()));
+ __ li(vector, instr->hydrogen()->feedback_vector());
+ // No need to allocate this register.
+ ASSERT(LoadIC::SlotRegister().is(a0));
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(instr->hydrogen()->slot())));
+ }
ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
CallCode(ic, RelocInfo::CODE_TARGET, instr);
@@ -3020,6 +3029,15 @@
// Name is always in a2.
__ li(LoadIC::NameRegister(), Operand(instr->name()));
+ if (FLAG_vector_ics) {
+ Register vector = ToRegister(instr->temp_vector());
+ ASSERT(vector.is(LoadIC::VectorRegister()));
+ __ li(vector, instr->hydrogen()->feedback_vector());
+ // No need to allocate this register.
+ ASSERT(LoadIC::SlotRegister().is(a0));
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(instr->hydrogen()->slot())));
+ }
Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
@@ -3382,6 +3400,16 @@
ASSERT(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
ASSERT(ToRegister(instr->key()).is(LoadIC::NameRegister()));
+ if (FLAG_vector_ics) {
+ Register vector = ToRegister(instr->temp_vector());
+ ASSERT(vector.is(LoadIC::VectorRegister()));
+ __ li(vector, instr->hydrogen()->feedback_vector());
+ // No need to allocate this register.
+ ASSERT(LoadIC::SlotRegister().is(a0));
+ __ li(LoadIC::SlotRegister(),
+ Operand(Smi::FromInt(instr->hydrogen()->slot())));
+ }
+
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
=======================================
--- /branches/bleeding_edge/src/mips64/lithium-mips64.cc Thu Jul 17
18:24:59 2014 UTC
+++ /branches/bleeding_edge/src/mips64/lithium-mips64.cc Mon Jul 21
19:09:56 2014 UTC
@@ -2030,8 +2030,12 @@
LOperand* context = UseFixed(instr->context(), cp);
LOperand* global_object = UseFixed(instr->global_object(),
LoadIC::ReceiverRegister());
+ LOperand* vector = NULL;
+ if (FLAG_vector_ics) {
+ vector = FixedTemp(LoadIC::VectorRegister());
+ }
LLoadGlobalGeneric* result =
- new(zone()) LLoadGlobalGeneric(context, global_object);
+ new(zone()) LLoadGlobalGeneric(context, global_object, vector);
return MarkAsCall(DefineFixed(result, v0), instr);
}
@@ -2084,8 +2088,13 @@
LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
LOperand* context = UseFixed(instr->context(), cp);
LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister());
+ LOperand* vector = NULL;
+ if (FLAG_vector_ics) {
+ vector = FixedTemp(LoadIC::VectorRegister());
+ }
+
LInstruction* result =
- DefineFixed(new(zone()) LLoadNamedGeneric(context, object), v0);
+ DefineFixed(new(zone()) LLoadNamedGeneric(context, object, vector),
v0);
return MarkAsCall(result, instr);
}
@@ -2146,9 +2155,14 @@
LOperand* context = UseFixed(instr->context(), cp);
LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister());
LOperand* key = UseFixed(instr->key(), LoadIC::NameRegister());
+ LOperand* vector = NULL;
+ if (FLAG_vector_ics) {
+ vector = FixedTemp(LoadIC::VectorRegister());
+ }
LInstruction* result =
- DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key), v0);
+ DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key,
vector),
+ v0);
return MarkAsCall(result, instr);
}
=======================================
--- /branches/bleeding_edge/src/mips64/lithium-mips64.h Thu Jul 17 18:24:59
2014 UTC
+++ /branches/bleeding_edge/src/mips64/lithium-mips64.h Mon Jul 21 19:09:56
2014 UTC
@@ -1545,15 +1545,17 @@
};
-class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 1> {
public:
- LLoadNamedGeneric(LOperand* context, LOperand* object) {
+ LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector)
{
inputs_[0] = context;
inputs_[1] = object;
+ temps_[0] = vector;
}
LOperand* context() { return inputs_[0]; }
LOperand* object() { return inputs_[1]; }
+ LOperand* temp_vector() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
@@ -1614,19 +1616,23 @@
};
-class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> {
+class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 1> {
public:
- LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key) {
+ LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key,
+ LOperand* vector) {
inputs_[0] = context;
inputs_[1] = object;
inputs_[2] = key;
+ temps_[0] = vector;
}
LOperand* context() { return inputs_[0]; }
LOperand* object() { return inputs_[1]; }
LOperand* key() { return inputs_[2]; }
+ LOperand* temp_vector() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
+ DECLARE_HYDROGEN_ACCESSOR(LoadKeyedGeneric)
};
@@ -1637,15 +1643,18 @@
};
-class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 1> {
public:
- LLoadGlobalGeneric(LOperand* context, LOperand* global_object) {
+ LLoadGlobalGeneric(LOperand* context, LOperand* global_object,
+ LOperand* vector) {
inputs_[0] = context;
inputs_[1] = global_object;
+ temps_[0] = vector;
}
LOperand* context() { return inputs_[0]; }
LOperand* global_object() { return inputs_[1]; }
+ LOperand* temp_vector() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.