MIPS: Introduce FeedbackVectorSlot type - better than int.

Port r24528 (f7b7e5a)

Original commit message:
It's good to have typing around this value.

BUG=
R=paul.lind@imgtec.com

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24534 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ba6e17c4
...@@ -1088,7 +1088,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { ...@@ -1088,7 +1088,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
Comment cmnt(masm_, "[ ForInStatement"); Comment cmnt(masm_, "[ ForInStatement");
int slot = stmt->ForInFeedbackSlot(); FeedbackVectorSlot slot = stmt->ForInFeedbackSlot();
SetStatementPosition(stmt); SetStatementPosition(stmt);
Label loop, exit; Label loop, exit;
...@@ -1176,7 +1176,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { ...@@ -1176,7 +1176,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ li(a1, FeedbackVector()); __ li(a1, FeedbackVector());
__ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
__ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot))); __ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot.ToInt())));
__ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check
__ ld(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object __ ld(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object
...@@ -1348,7 +1348,7 @@ void FullCodeGenerator::EmitLoadHomeObject(SuperReference* expr) { ...@@ -1348,7 +1348,7 @@ void FullCodeGenerator::EmitLoadHomeObject(SuperReference* expr) {
if (FLAG_vector_ics) { if (FLAG_vector_ics) {
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(expr->HomeObjectFeedbackSlot()))); Operand(SmiFromSlot(expr->HomeObjectFeedbackSlot())));
CallLoadIC(NOT_CONTEXTUAL); CallLoadIC(NOT_CONTEXTUAL);
} else { } else {
CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId());
...@@ -1410,7 +1410,7 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, ...@@ -1410,7 +1410,7 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
__ li(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); __ li(LoadDescriptor::NameRegister(), Operand(proxy->var()->name()));
if (FLAG_vector_ics) { if (FLAG_vector_ics) {
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
} }
ContextualMode mode = (typeof_state == INSIDE_TYPEOF) ContextualMode mode = (typeof_state == INSIDE_TYPEOF)
...@@ -1501,7 +1501,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { ...@@ -1501,7 +1501,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
__ li(LoadDescriptor::NameRegister(), Operand(var->name())); __ li(LoadDescriptor::NameRegister(), Operand(var->name()));
if (FLAG_vector_ics) { if (FLAG_vector_ics) {
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
} }
CallLoadIC(CONTEXTUAL); CallLoadIC(CONTEXTUAL);
context()->Plug(v0); context()->Plug(v0);
...@@ -2135,7 +2135,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { ...@@ -2135,7 +2135,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ ld(load_name, MemOperand(sp, 2 * kPointerSize)); __ ld(load_name, MemOperand(sp, 2 * kPointerSize));
if (FLAG_vector_ics) { if (FLAG_vector_ics) {
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot()))); Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
} }
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
CallIC(ic, TypeFeedbackId::None()); CallIC(ic, TypeFeedbackId::None());
...@@ -2155,7 +2155,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { ...@@ -2155,7 +2155,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
if (FLAG_vector_ics) { if (FLAG_vector_ics) {
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(expr->DoneFeedbackSlot()))); Operand(SmiFromSlot(expr->DoneFeedbackSlot())));
} }
CallLoadIC(NOT_CONTEXTUAL); // v0=result.done CallLoadIC(NOT_CONTEXTUAL); // v0=result.done
__ mov(a0, v0); __ mov(a0, v0);
...@@ -2168,7 +2168,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { ...@@ -2168,7 +2168,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
if (FLAG_vector_ics) { if (FLAG_vector_ics) {
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(expr->ValueFeedbackSlot()))); Operand(SmiFromSlot(expr->ValueFeedbackSlot())));
} }
CallLoadIC(NOT_CONTEXTUAL); // v0=result.value CallLoadIC(NOT_CONTEXTUAL); // v0=result.value
context()->DropAndPlug(2, v0); // drop iter and g context()->DropAndPlug(2, v0); // drop iter and g
...@@ -2339,7 +2339,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { ...@@ -2339,7 +2339,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
__ li(LoadDescriptor::NameRegister(), Operand(key->value())); __ li(LoadDescriptor::NameRegister(), Operand(key->value()));
if (FLAG_vector_ics) { if (FLAG_vector_ics) {
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_CONTEXTUAL); CallLoadIC(NOT_CONTEXTUAL);
} else { } else {
CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId());
...@@ -2365,7 +2365,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { ...@@ -2365,7 +2365,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
if (FLAG_vector_ics) { if (FLAG_vector_ics) {
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallIC(ic); CallIC(ic);
} else { } else {
CallIC(ic, prop->PropertyFeedbackId()); CallIC(ic, prop->PropertyFeedbackId());
...@@ -2871,7 +2871,7 @@ void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) { ...@@ -2871,7 +2871,7 @@ void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) {
SetSourcePosition(expr->position()); SetSourcePosition(expr->position());
Handle<Code> ic = CallIC::initialize_stub( Handle<Code> ic = CallIC::initialize_stub(
isolate(), arg_count, call_type); isolate(), arg_count, call_type);
__ li(a3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); __ li(a3, Operand(SmiFromSlot(expr->CallFeedbackSlot())));
__ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize));
// Don't assign a type feedback id to the IC, since type feedback is provided // Don't assign a type feedback id to the IC, since type feedback is provided
// by the vector above. // by the vector above.
...@@ -3067,12 +3067,12 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { ...@@ -3067,12 +3067,12 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
// Record call targets in unoptimized code. // Record call targets in unoptimized code.
if (FLAG_pretenuring_call_new) { if (FLAG_pretenuring_call_new) {
EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot());
DCHECK(expr->AllocationSiteFeedbackSlot() == DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() ==
expr->CallNewFeedbackSlot() + 1); expr->CallNewFeedbackSlot().ToInt() + 1);
} }
__ li(a2, FeedbackVector()); __ li(a2, FeedbackVector());
__ li(a3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); __ li(a3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot())));
CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET);
__ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
...@@ -4306,7 +4306,7 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { ...@@ -4306,7 +4306,7 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
__ li(LoadDescriptor::NameRegister(), Operand(expr->name())); __ li(LoadDescriptor::NameRegister(), Operand(expr->name()));
if (FLAG_vector_ics) { if (FLAG_vector_ics) {
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(expr->CallRuntimeFeedbackSlot()))); Operand(SmiFromSlot(expr->CallRuntimeFeedbackSlot())));
CallLoadIC(NOT_CONTEXTUAL); CallLoadIC(NOT_CONTEXTUAL);
} else { } else {
CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId());
...@@ -4712,7 +4712,7 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { ...@@ -4712,7 +4712,7 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
__ li(LoadDescriptor::NameRegister(), Operand(proxy->name())); __ li(LoadDescriptor::NameRegister(), Operand(proxy->name()));
if (FLAG_vector_ics) { if (FLAG_vector_ics) {
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
} }
// Use a regular load, not a contextual load, to avoid a reference // Use a regular load, not a contextual load, to avoid a reference
// error. // error.
......
...@@ -2863,7 +2863,7 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { ...@@ -2863,7 +2863,7 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
// No need to allocate this register. // No need to allocate this register.
DCHECK(VectorLoadICDescriptor::SlotRegister().is(a0)); DCHECK(VectorLoadICDescriptor::SlotRegister().is(a0));
__ li(VectorLoadICDescriptor::SlotRegister(), __ li(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(instr->hydrogen()->slot()))); Operand(Smi::FromInt(instr->hydrogen()->slot().ToInt())));
} }
......
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