| Index: src/a64/full-codegen-a64.cc
|
| diff --git a/src/a64/full-codegen-a64.cc b/src/a64/full-codegen-a64.cc
|
| index b884ed7ee38407c70bdf8b8ad31ddcd10ab8b115..e14670bbd3585660ea64f6f15e49e54a419d0d52 100644
|
| --- a/src/a64/full-codegen-a64.cc
|
| +++ b/src/a64/full-codegen-a64.cc
|
| @@ -128,6 +128,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());
|
| @@ -664,7 +667,7 @@ void FullCodeGenerator::DoTest(Expression* condition,
|
| Label* if_false,
|
| Label* fall_through) {
|
| Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate());
|
| - CallIC(ic, NOT_CONTEXTUAL, condition->test_id());
|
| + CallIC(ic, condition->test_id());
|
| __ CompareAndSplit(result_register(), 0, ne, if_true, if_false, fall_through);
|
| }
|
|
|
| @@ -1032,7 +1035,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;
|
| @@ -1075,6 +1078,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
|
| void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| ASM_LOCATION("FullCodeGenerator::VisitForInStatement");
|
| Comment cmnt(masm_, "[ ForInStatement");
|
| + int slot = stmt->ForInFeedbackSlot();
|
| // TODO(all): This visitor probably needs better comments and a revisit.
|
| SetStatementPosition(stmt);
|
|
|
| @@ -1158,13 +1162,13 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| // We got a fixed array in register x0. Iterate through that.
|
| __ Bind(&fixed_array);
|
|
|
| - Handle<Cell> cell = isolate()->factory()->NewCell(
|
| - Handle<Object>(Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker),
|
| - isolate()));
|
| - RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell);
|
| - __ LoadObject(x1, cell);
|
| - __ Mov(x10, Operand(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker)));
|
| - __ Str(x10, FieldMemOperand(x1, Cell::kValueOffset));
|
| + Handle<Object> feedback = Handle<Object>(
|
| + Smi::FromInt(TypeFeedbackInfo::kForInFastCaseMarker),
|
| + isolate());
|
| + StoreFeedbackVectorSlot(slot, feedback);
|
| + __ LoadObject(x1, FeedbackVector());
|
| + __ Mov(x10, Operand(Smi::FromInt(TypeFeedbackInfo::kForInSlowCaseMarker)));
|
| + __ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(slot)));
|
|
|
| __ Mov(x1, Operand(Smi::FromInt(1))); // Smi indicates slow check.
|
| __ Peek(x10, 0); // Get enumerated object.
|
| @@ -1679,7 +1683,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
|
| VisitForAccumulatorValue(value);
|
| __ Mov(x2, Operand(key->value()));
|
| __ Peek(x1, 0);
|
| - CallStoreIC(NOT_CONTEXTUAL, key->LiteralFeedbackId());
|
| + CallStoreIC(key->LiteralFeedbackId());
|
| PrepareForBailoutForId(key->id(), NO_REGISTERS);
|
| } else {
|
| VisitForEffect(value);
|
| @@ -1978,7 +1982,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
|
| SetSourcePosition(prop->position());
|
| // Call keyed load IC. It has arguments key and receiver in r0 and r1.
|
| Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
|
| - CallIC(ic, NOT_CONTEXTUAL, prop->PropertyFeedbackId());
|
| + CallIC(ic, prop->PropertyFeedbackId());
|
| }
|
|
|
|
|
| @@ -2004,8 +2008,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
|
| BinaryOpICStub stub(op, mode);
|
| {
|
| Assembler::BlockConstPoolScope scope(masm_);
|
| - CallIC(stub.GetCode(isolate()), NOT_CONTEXTUAL,
|
| - expr->BinaryOperationFeedbackId());
|
| + CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
|
| patch_site.EmitPatchInfo();
|
| }
|
| __ B(&done);
|
| @@ -2091,8 +2094,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
|
| JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code.
|
| {
|
| Assembler::BlockConstPoolScope scope(masm_);
|
| - CallIC(stub.GetCode(isolate()), NOT_CONTEXTUAL,
|
| - expr->BinaryOperationFeedbackId());
|
| + CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
|
| patch_site.EmitPatchInfo();
|
| }
|
| context()->Plug(x0);
|
| @@ -2133,7 +2135,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
|
| __ Mov(x1, x0);
|
| __ Pop(x0); // Restore value.
|
| __ Mov(x2, Operand(prop->key()->AsLiteral()->value()));
|
| - CallStoreIC(NOT_CONTEXTUAL);
|
| + CallStoreIC();
|
| break;
|
| }
|
| case KEYED_PROPERTY: {
|
| @@ -2160,7 +2162,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
|
| // Global var, const, or let.
|
| __ Mov(x2, Operand(var->name()));
|
| __ Ldr(x1, GlobalObjectMemOperand());
|
| - CallStoreIC(CONTEXTUAL);
|
| + CallStoreIC();
|
|
|
| } else if (op == Token::INIT_CONST) {
|
| // Const initializers need a write barrier.
|
| @@ -2259,7 +2261,7 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
|
| __ Mov(x2, Operand(prop->key()->AsLiteral()->value()));
|
| __ Pop(x1);
|
|
|
| - CallStoreIC(NOT_CONTEXTUAL, expr->AssignmentFeedbackId());
|
| + CallStoreIC(expr->AssignmentFeedbackId());
|
|
|
| PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
|
| context()->Plug(x0);
|
| @@ -2278,7 +2280,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(x0);
|
| @@ -2305,12 +2307,10 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
|
|
|
|
|
| void FullCodeGenerator::CallIC(Handle<Code> code,
|
| - ContextualMode mode,
|
| TypeFeedbackId ast_id) {
|
| ic_total_count_++;
|
| // All calls must have a predictable size in full-codegen code to ensure that
|
| // the debugger can patch them correctly.
|
| - ASSERT((mode != CONTEXTUAL) || ast_id.IsNone());
|
| __ Call(code, RelocInfo::CODE_TARGET, ast_id);
|
| }
|
|
|
| @@ -2421,16 +2421,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);
|
| - __ Mov(x2, Operand(cell));
|
| + TypeFeedbackInfo::UninitializedSentinel(isolate());
|
| + StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized);
|
| + __ LoadObject(x2, FeedbackVector());
|
| + __ Mov(x3, Operand(Smi::FromInt(expr->CallFeedbackSlot())));
|
|
|
| // Record call targets in unoptimized code.
|
| CallFunctionStub stub(arg_count, RECORD_CALL_TARGET);
|
| __ Peek(x1, (arg_count + 1) * kXRegSizeInBytes);
|
| - __ CallStub(&stub, expr->CallFeedbackId());
|
| + __ CallStub(&stub);
|
| RecordJSReturnSite(expr);
|
| // Restore context register.
|
| __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| @@ -2621,11 +2620,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);
|
| - __ Mov(x2, Operand(cell));
|
| + TypeFeedbackInfo::UninitializedSentinel(isolate());
|
| + StoreFeedbackVectorSlot(expr->CallNewFeedbackSlot(), uninitialized);
|
| + __ LoadObject(x2, FeedbackVector());
|
| + __ Mov(x3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot())));
|
|
|
| CallConstructStub stub(RECORD_CALL_TARGET);
|
| __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
|
| @@ -4127,8 +4125,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
|
| {
|
| Assembler::BlockConstPoolScope scope(masm_);
|
| 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);
|
| @@ -4158,7 +4155,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
|
| case NAMED_PROPERTY: {
|
| __ Mov(x2, Operand(prop->key()->AsLiteral()->value()));
|
| __ Pop(x1);
|
| - CallStoreIC(NOT_CONTEXTUAL, expr->CountStoreFeedbackId());
|
| + CallStoreIC(expr->CountStoreFeedbackId());
|
| PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
|
| if (expr->is_postfix()) {
|
| if (!context()->IsEffect()) {
|
| @@ -4175,7 +4172,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()) {
|
| @@ -4375,7 +4372,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);
|
| __ CompareAndSplit(x0, 0, cond, if_true, if_false, fall_through);
|
| @@ -4410,7 +4407,7 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr,
|
| Split(eq, if_true, if_false, fall_through);
|
| } else {
|
| Handle<Code> ic = CompareNilICStub::GetUninitialized(isolate(), nil);
|
| - CallIC(ic, NOT_CONTEXTUAL, expr->CompareOperationFeedbackId());
|
| + CallIC(ic, expr->CompareOperationFeedbackId());
|
| __ CompareAndSplit(x0, 0, ne, if_true, if_false, fall_through);
|
| }
|
|
|
| @@ -4553,7 +4550,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
|
| __ Peek(x1, 1 * kPointerSize);
|
| __ Peek(x0, 2 * kPointerSize);
|
| Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
|
| - CallIC(ic, NOT_CONTEXTUAL, TypeFeedbackId::None());
|
| + CallIC(ic, TypeFeedbackId::None());
|
| __ Mov(x1, x0);
|
| __ Poke(x1, 2 * kPointerSize);
|
| CallFunctionStub stub(1, CALL_AS_METHOD);
|
|
|