| Index: src/mips/full-codegen-mips.cc
|
| diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
|
| index 18ee02dc5c4bb7328546b9712079b30e3cc9f328..311eaf2f092d966d0e9df475c2b88901cf3d5d41 100644
|
| --- a/src/mips/full-codegen-mips.cc
|
| +++ b/src/mips/full-codegen-mips.cc
|
| @@ -138,6 +138,9 @@ void FullCodeGenerator::Generate() {
|
| CompilationInfo* info = info_;
|
| handler_table_ =
|
| isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED);
|
| +
|
| + InitializeFeedbackVector();
|
| +
|
| profiling_counter_ = isolate()->factory()->NewCell(
|
| Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
|
| SetFunctionPosition(function());
|
| @@ -679,7 +682,7 @@ void FullCodeGenerator::DoTest(Expression* condition,
|
| Label* fall_through) {
|
| __ mov(a0, result_register());
|
| Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate());
|
| - CallIC(ic, NOT_CONTEXTUAL, condition->test_id());
|
| + CallIC(ic, condition->test_id());
|
| __ mov(at, zero_reg);
|
| Split(ne, v0, Operand(at), if_true, if_false, fall_through);
|
| }
|
| @@ -1044,7 +1047,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
|
| // Record position before stub call for type feedback.
|
| SetSourcePosition(clause->position());
|
| Handle<Code> ic = CompareIC::GetUninitialized(isolate(), Token::EQ_STRICT);
|
| - CallIC(ic, NOT_CONTEXTUAL, clause->CompareId());
|
| + CallIC(ic, clause->CompareId());
|
| patch_site.EmitPatchInfo();
|
|
|
| Label skip;
|
| @@ -1087,6 +1090,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
|
|
|
| void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| Comment cmnt(masm_, "[ ForInStatement");
|
| + int slot = stmt->ForInFeedbackSlot();
|
| SetStatementPosition(stmt);
|
|
|
| Label loop, exit;
|
| @@ -1172,13 +1176,13 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| Label non_proxy;
|
| __ bind(&fixed_array);
|
|
|
| - Handle<Cell> cell = isolate()->factory()->NewCell(
|
| - Handle<Object>(Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker),
|
| - isolate()));
|
| - RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell);
|
| - __ li(a1, cell);
|
| - __ li(a2, Operand(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker)));
|
| - __ sw(a2, FieldMemOperand(a1, Cell::kValueOffset));
|
| + Handle<Object> feedback = Handle<Object>(
|
| + Smi::FromInt(TypeFeedbackInfo::kForInFastCaseMarker),
|
| + isolate());
|
| + StoreFeedbackVectorSlot(slot, feedback);
|
| + __ li(a1, FeedbackVector());
|
| + __ li(a2, Operand(Smi::FromInt(TypeFeedbackInfo::kForInSlowCaseMarker)));
|
| + __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot)));
|
|
|
| __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check
|
| __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object
|
| @@ -1703,7 +1707,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
|
| __ mov(a0, result_register());
|
| __ li(a2, Operand(key->value()));
|
| __ lw(a1, MemOperand(sp));
|
| - CallStoreIC(NOT_CONTEXTUAL, key->LiteralFeedbackId());
|
| + CallStoreIC(key->LiteralFeedbackId());
|
| PrepareForBailoutForId(key->id(), NO_REGISTERS);
|
| } else {
|
| VisitForEffect(value);
|
| @@ -2111,7 +2115,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
|
| __ lw(a1, MemOperand(sp, kPointerSize));
|
| __ lw(a0, MemOperand(sp, 2 * kPointerSize));
|
| Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
|
| - CallIC(ic, NOT_CONTEXTUAL, TypeFeedbackId::None());
|
| + CallIC(ic, TypeFeedbackId::None());
|
| __ mov(a0, v0);
|
| __ mov(a1, a0);
|
| __ sw(a1, MemOperand(sp, 2 * kPointerSize));
|
| @@ -2309,7 +2313,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
|
| __ mov(a0, result_register());
|
| // Call keyed load IC. It has arguments key and receiver in a0 and a1.
|
| Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
|
| - CallIC(ic, NOT_CONTEXTUAL, prop->PropertyFeedbackId());
|
| + CallIC(ic, prop->PropertyFeedbackId());
|
| }
|
|
|
|
|
| @@ -2337,8 +2341,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
|
|
|
| __ bind(&stub_call);
|
| BinaryOpICStub stub(op, mode);
|
| - CallIC(stub.GetCode(isolate()), NOT_CONTEXTUAL,
|
| - expr->BinaryOperationFeedbackId());
|
| + CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
|
| patch_site.EmitPatchInfo();
|
| __ jmp(&done);
|
|
|
| @@ -2417,8 +2420,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
|
| __ pop(a1);
|
| BinaryOpICStub stub(op, mode);
|
| JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
|
| - CallIC(stub.GetCode(isolate()), NOT_CONTEXTUAL,
|
| - expr->BinaryOperationFeedbackId());
|
| + CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
|
| patch_site.EmitPatchInfo();
|
| context()->Plug(v0);
|
| }
|
| @@ -2456,7 +2458,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
|
| __ mov(a1, result_register());
|
| __ pop(a0); // Restore value.
|
| __ li(a2, Operand(prop->key()->AsLiteral()->value()));
|
| - CallStoreIC(NOT_CONTEXTUAL);
|
| + CallStoreIC();
|
| break;
|
| }
|
| case KEYED_PROPERTY: {
|
| @@ -2483,7 +2485,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
|
| __ mov(a0, result_register());
|
| __ li(a2, Operand(var->name()));
|
| __ lw(a1, GlobalObjectOperand());
|
| - CallStoreIC(CONTEXTUAL);
|
| + CallStoreIC();
|
| } else if (op == Token::INIT_CONST) {
|
| // Const initializers need a write barrier.
|
| ASSERT(!var->IsParameter()); // No const parameters.
|
| @@ -2578,7 +2580,7 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
|
| __ li(a2, Operand(prop->key()->AsLiteral()->value()));
|
| __ pop(a1);
|
|
|
| - CallStoreIC(NOT_CONTEXTUAL, expr->AssignmentFeedbackId());
|
| + CallStoreIC(expr->AssignmentFeedbackId());
|
|
|
| PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
|
| context()->Plug(v0);
|
| @@ -2601,7 +2603,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
|
| Handle<Code> ic = is_classic_mode()
|
| ? isolate()->builtins()->KeyedStoreIC_Initialize()
|
| : isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
|
| - CallIC(ic, NOT_CONTEXTUAL, expr->AssignmentFeedbackId());
|
| + CallIC(ic, expr->AssignmentFeedbackId());
|
|
|
| PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
|
| context()->Plug(v0);
|
| @@ -2628,10 +2630,8 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
|
|
|
|
|
| void FullCodeGenerator::CallIC(Handle<Code> code,
|
| - ContextualMode mode,
|
| TypeFeedbackId id) {
|
| ic_total_count_++;
|
| - ASSERT(mode != CONTEXTUAL || id.IsNone());
|
| __ Call(code, RelocInfo::CODE_TARGET, id);
|
| }
|
|
|
| @@ -2741,15 +2741,15 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr) {
|
| SetSourcePosition(expr->position());
|
|
|
| Handle<Object> uninitialized =
|
| - TypeFeedbackCells::UninitializedSentinel(isolate());
|
| - Handle<Cell> cell = isolate()->factory()->NewCell(uninitialized);
|
| - RecordTypeFeedbackCell(expr->CallFeedbackId(), cell);
|
| - __ li(a2, Operand(cell));
|
| + TypeFeedbackInfo::UninitializedSentinel(isolate());
|
| + StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized);
|
| + __ li(a2, FeedbackVector());
|
| + __ li(a3, Operand(Smi::FromInt(expr->CallFeedbackSlot())));
|
|
|
| // Record call targets in unoptimized code.
|
| CallFunctionStub stub(arg_count, RECORD_CALL_TARGET);
|
| __ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize));
|
| - __ CallStub(&stub, expr->CallFeedbackId());
|
| + __ CallStub(&stub);
|
| RecordJSReturnSite(expr);
|
| // Restore context register.
|
| __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| @@ -2928,10 +2928,10 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
|
|
| // Record call targets in unoptimized code.
|
| Handle<Object> uninitialized =
|
| - TypeFeedbackCells::UninitializedSentinel(isolate());
|
| - Handle<Cell> cell = isolate()->factory()->NewCell(uninitialized);
|
| - RecordTypeFeedbackCell(expr->CallNewFeedbackId(), cell);
|
| - __ li(a2, Operand(cell));
|
| + TypeFeedbackInfo::UninitializedSentinel(isolate());
|
| + StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized);
|
| + __ li(a2, FeedbackVector());
|
| + __ li(a3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot())));
|
|
|
| CallConstructStub stub(RECORD_CALL_TARGET);
|
| __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
|
| @@ -4471,9 +4471,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
|
| SetSourcePosition(expr->position());
|
|
|
| BinaryOpICStub stub(Token::ADD, NO_OVERWRITE);
|
| - CallIC(stub.GetCode(isolate()),
|
| - NOT_CONTEXTUAL,
|
| - expr->CountBinOpFeedbackId());
|
| + CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId());
|
| patch_site.EmitPatchInfo();
|
| __ bind(&done);
|
|
|
| @@ -4503,7 +4501,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
|
| __ mov(a0, result_register()); // Value.
|
| __ li(a2, Operand(prop->key()->AsLiteral()->value())); // Name.
|
| __ pop(a1); // Receiver.
|
| - CallStoreIC(NOT_CONTEXTUAL, expr->CountStoreFeedbackId());
|
| + CallStoreIC(expr->CountStoreFeedbackId());
|
| PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
|
| if (expr->is_postfix()) {
|
| if (!context()->IsEffect()) {
|
| @@ -4520,7 +4518,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
|
| Handle<Code> ic = is_classic_mode()
|
| ? isolate()->builtins()->KeyedStoreIC_Initialize()
|
| : isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
|
| - CallIC(ic, NOT_CONTEXTUAL, expr->CountStoreFeedbackId());
|
| + CallIC(ic, expr->CountStoreFeedbackId());
|
| PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
|
| if (expr->is_postfix()) {
|
| if (!context()->IsEffect()) {
|
| @@ -4705,7 +4703,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
|
| // Record position and call the compare IC.
|
| SetSourcePosition(expr->position());
|
| Handle<Code> ic = CompareIC::GetUninitialized(isolate(), op);
|
| - CallIC(ic, NOT_CONTEXTUAL, expr->CompareOperationFeedbackId());
|
| + CallIC(ic, expr->CompareOperationFeedbackId());
|
| patch_site.EmitPatchInfo();
|
| PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
|
| Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through);
|
| @@ -4739,7 +4737,7 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr,
|
| Split(eq, a0, Operand(a1), if_true, if_false, fall_through);
|
| } else {
|
| Handle<Code> ic = CompareNilICStub::GetUninitialized(isolate(), nil);
|
| - CallIC(ic, NOT_CONTEXTUAL, expr->CompareOperationFeedbackId());
|
| + CallIC(ic, expr->CompareOperationFeedbackId());
|
| Split(ne, v0, Operand(zero_reg), if_true, if_false, fall_through);
|
| }
|
| context()->Plug(if_true, if_false);
|
|
|