From 1d88f09092313cbb953144fbd3d27e64abb2d6fb Mon Sep 17 00:00:00 2001 From: "mvstanton@chromium.org" Date: Tue, 11 Feb 2014 12:41:58 +0000 Subject: [PATCH] Cleanup: ContextualMode doesn't need to be passed to ICs. R=verwaest@chromium.org Review URL: https://codereview.chromium.org/154113010 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19277 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/full-codegen-arm.cc | 38 ++++++++++++++++---------------------- src/full-codegen.cc | 6 +++--- src/full-codegen.h | 4 +--- src/ia32/full-codegen-ia32.cc | 38 ++++++++++++++++---------------------- src/mips/full-codegen-mips.cc | 38 ++++++++++++++++---------------------- src/x64/full-codegen-x64.cc | 38 ++++++++++++++++---------------------- 6 files changed, 68 insertions(+), 94 deletions(-) diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index 3f229eb..dbce0ed 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -671,7 +671,7 @@ void FullCodeGenerator::DoTest(Expression* condition, Label* if_false, Label* fall_through) { Handle ic = ToBooleanStub::GetUninitialized(isolate()); - CallIC(ic, NOT_CONTEXTUAL, condition->test_id()); + CallIC(ic, condition->test_id()); __ tst(result_register(), result_register()); Split(ne, if_true, if_false, fall_through); } @@ -1032,7 +1032,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { // Record position before stub call for type feedback. SetSourcePosition(clause->position()); Handle ic = CompareIC::GetUninitialized(isolate(), Token::EQ_STRICT); - CallIC(ic, NOT_CONTEXTUAL, clause->CompareId()); + CallIC(ic, clause->CompareId()); patch_site.EmitPatchInfo(); Label skip; @@ -1696,7 +1696,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { VisitForAccumulatorValue(value); __ mov(r2, Operand(key->value())); __ ldr(r1, MemOperand(sp)); - CallStoreIC(NOT_CONTEXTUAL, key->LiteralFeedbackId()); + CallStoreIC(key->LiteralFeedbackId()); PrepareForBailoutForId(key->id(), NO_REGISTERS); } else { VisitForEffect(value); @@ -2098,7 +2098,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ ldr(r1, MemOperand(sp, kPointerSize)); __ ldr(r0, MemOperand(sp, 2 * kPointerSize)); Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); - CallIC(ic, NOT_CONTEXTUAL, TypeFeedbackId::None()); + CallIC(ic, TypeFeedbackId::None()); __ mov(r1, r0); __ str(r1, MemOperand(sp, 2 * kPointerSize)); CallFunctionStub stub(1, CALL_AS_METHOD); @@ -2295,7 +2295,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { SetSourcePosition(prop->position()); // Call keyed load IC. It has arguments key and receiver in r0 and r1. Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); - CallIC(ic, NOT_CONTEXTUAL, prop->PropertyFeedbackId()); + CallIC(ic, prop->PropertyFeedbackId()); } @@ -2322,8 +2322,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); @@ -2400,8 +2399,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, __ pop(r1); 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(r0); } @@ -2439,7 +2437,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { __ mov(r1, r0); __ pop(r0); // Restore value. __ mov(r2, Operand(prop->key()->AsLiteral()->value())); - CallStoreIC(NOT_CONTEXTUAL); + CallStoreIC(); break; } case KEYED_PROPERTY: { @@ -2465,7 +2463,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, // Global var, const, or let. __ mov(r2, Operand(var->name())); __ ldr(r1, GlobalObjectOperand()); - CallStoreIC(CONTEXTUAL); + CallStoreIC(); } else if (op == Token::INIT_CONST) { // Const initializers need a write barrier. ASSERT(!var->IsParameter()); // No const parameters. @@ -2559,7 +2557,7 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { __ mov(r2, Operand(prop->key()->AsLiteral()->value())); __ pop(r1); - CallStoreIC(NOT_CONTEXTUAL, expr->AssignmentFeedbackId()); + CallStoreIC(expr->AssignmentFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); context()->Plug(r0); @@ -2576,7 +2574,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { Handle 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(r0); @@ -2603,12 +2601,10 @@ void FullCodeGenerator::VisitProperty(Property* expr) { void FullCodeGenerator::CallIC(Handle 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, al, NEVER_INLINE_TARGET_ADDRESS); } @@ -4415,9 +4411,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); @@ -4446,7 +4440,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case NAMED_PROPERTY: { __ mov(r2, Operand(prop->key()->AsLiteral()->value())); __ pop(r1); - CallStoreIC(NOT_CONTEXTUAL, expr->CountStoreFeedbackId()); + CallStoreIC(expr->CountStoreFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -4462,7 +4456,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { Handle 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()) { @@ -4652,7 +4646,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { // Record position and call the compare IC. SetSourcePosition(expr->position()); Handle 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); __ cmp(r0, Operand::Zero()); @@ -4687,7 +4681,7 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr, Split(eq, if_true, if_false, fall_through); } else { Handle ic = CompareNilICStub::GetUninitialized(isolate(), nil); - CallIC(ic, NOT_CONTEXTUAL, expr->CompareOperationFeedbackId()); + CallIC(ic, expr->CompareOperationFeedbackId()); __ cmp(r0, Operand(0)); Split(ne, if_true, if_false, fall_through); } diff --git a/src/full-codegen.cc b/src/full-codegen.cc index 0f1536f..16bb6c0 100644 --- a/src/full-codegen.cc +++ b/src/full-codegen.cc @@ -443,13 +443,13 @@ void FullCodeGenerator::CallLoadIC(ContextualMode contextual_mode, TypeFeedbackId id) { ExtraICState extra_state = LoadIC::ComputeExtraICState(contextual_mode); Handle ic = LoadIC::initialize_stub(isolate(), extra_state); - CallIC(ic, contextual_mode, id); + CallIC(ic, id); } -void FullCodeGenerator::CallStoreIC(ContextualMode mode, TypeFeedbackId id) { +void FullCodeGenerator::CallStoreIC(TypeFeedbackId id) { Handle ic = StoreIC::initialize_stub(isolate(), strict_mode()); - CallIC(ic, mode, id); + CallIC(ic, id); } diff --git a/src/full-codegen.h b/src/full-codegen.h index b2514cb..3ee1de9 100644 --- a/src/full-codegen.h +++ b/src/full-codegen.h @@ -565,13 +565,11 @@ class FullCodeGenerator: public AstVisitor { void EmitKeyedPropertyAssignment(Assignment* expr); void CallIC(Handle code, - ContextualMode mode = NOT_CONTEXTUAL, TypeFeedbackId id = TypeFeedbackId::None()); void CallLoadIC(ContextualMode mode, TypeFeedbackId id = TypeFeedbackId::None()); - void CallStoreIC(ContextualMode mode, - TypeFeedbackId id = TypeFeedbackId::None()); + void CallStoreIC(TypeFeedbackId id = TypeFeedbackId::None()); void SetFunctionPosition(FunctionLiteral* fun); void SetReturnPosition(FunctionLiteral* fun); diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index b9e4d4b..1e0b6f1 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -629,7 +629,7 @@ void FullCodeGenerator::DoTest(Expression* condition, Label* if_false, Label* fall_through) { Handle ic = ToBooleanStub::GetUninitialized(isolate()); - CallIC(ic, NOT_CONTEXTUAL, condition->test_id()); + CallIC(ic, condition->test_id()); __ test(result_register(), result_register()); // The stub returns nonzero for true. Split(not_zero, if_true, if_false, fall_through); @@ -980,7 +980,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { // Record position before stub call for type feedback. SetSourcePosition(clause->position()); Handle ic = CompareIC::GetUninitialized(isolate(), Token::EQ_STRICT); - CallIC(ic, NOT_CONTEXTUAL, clause->CompareId()); + CallIC(ic, clause->CompareId()); patch_site.EmitPatchInfo(); Label skip; @@ -1640,7 +1640,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { VisitForAccumulatorValue(value); __ mov(ecx, Immediate(key->value())); __ mov(edx, Operand(esp, 0)); - CallStoreIC(NOT_CONTEXTUAL, key->LiteralFeedbackId()); + CallStoreIC(key->LiteralFeedbackId()); PrepareForBailoutForId(key->id(), NO_REGISTERS); } else { VisitForEffect(value); @@ -2054,7 +2054,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ bind(&l_call); __ mov(edx, Operand(esp, kPointerSize)); Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); - CallIC(ic, NOT_CONTEXTUAL, TypeFeedbackId::None()); + CallIC(ic, TypeFeedbackId::None()); __ mov(edi, eax); __ mov(Operand(esp, 2 * kPointerSize), edi); CallFunctionStub stub(1, CALL_AS_METHOD); @@ -2244,7 +2244,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { SetSourcePosition(prop->position()); Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); - CallIC(ic, NOT_CONTEXTUAL, prop->PropertyFeedbackId()); + CallIC(ic, prop->PropertyFeedbackId()); } @@ -2265,8 +2265,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, __ bind(&stub_call); __ mov(eax, ecx); BinaryOpICStub stub(op, mode); - CallIC(stub.GetCode(isolate()), NOT_CONTEXTUAL, - expr->BinaryOperationFeedbackId()); + CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); patch_site.EmitPatchInfo(); __ jmp(&done, Label::kNear); @@ -2351,8 +2350,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, __ pop(edx); 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(eax); } @@ -2390,7 +2388,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { __ mov(edx, eax); __ pop(eax); // Restore value. __ mov(ecx, prop->key()->AsLiteral()->value()); - CallStoreIC(NOT_CONTEXTUAL); + CallStoreIC(); break; } case KEYED_PROPERTY: { @@ -2417,7 +2415,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, // Global var, const, or let. __ mov(ecx, var->name()); __ mov(edx, GlobalObjectOperand()); - CallStoreIC(CONTEXTUAL); + CallStoreIC(); } else if (op == Token::INIT_CONST) { // Const initializers need a write barrier. ASSERT(!var->IsParameter()); // No const parameters. @@ -2511,7 +2509,7 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { SetSourcePosition(expr->position()); __ mov(ecx, prop->key()->AsLiteral()->value()); __ pop(edx); - CallStoreIC(NOT_CONTEXTUAL, expr->AssignmentFeedbackId()); + CallStoreIC(expr->AssignmentFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); context()->Plug(eax); } @@ -2530,7 +2528,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { Handle 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(eax); @@ -2559,10 +2557,8 @@ void FullCodeGenerator::VisitProperty(Property* expr) { void FullCodeGenerator::CallIC(Handle code, - ContextualMode mode, TypeFeedbackId ast_id) { ic_total_count_++; - ASSERT(mode != CONTEXTUAL || ast_id.IsNone()); __ call(code, RelocInfo::CODE_TARGET, ast_id); } @@ -4423,9 +4419,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { __ mov(edx, eax); __ mov(eax, Immediate(Smi::FromInt(1))); BinaryOpICStub stub(expr->binary_op(), NO_OVERWRITE); - CallIC(stub.GetCode(isolate()), - NOT_CONTEXTUAL, - expr->CountBinOpFeedbackId()); + CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId()); patch_site.EmitPatchInfo(); __ bind(&done); @@ -4456,7 +4450,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case NAMED_PROPERTY: { __ mov(ecx, prop->key()->AsLiteral()->value()); __ pop(edx); - CallStoreIC(NOT_CONTEXTUAL, expr->CountStoreFeedbackId()); + CallStoreIC(expr->CountStoreFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -4473,7 +4467,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { Handle 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()) { // Result is on the stack @@ -4662,7 +4656,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { // Record position and call the compare IC. SetSourcePosition(expr->position()); Handle 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); @@ -4698,7 +4692,7 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr, Split(equal, if_true, if_false, fall_through); } else { Handle ic = CompareNilICStub::GetUninitialized(isolate(), nil); - CallIC(ic, NOT_CONTEXTUAL, expr->CompareOperationFeedbackId()); + CallIC(ic, expr->CompareOperationFeedbackId()); __ test(eax, eax); Split(not_zero, if_true, if_false, fall_through); } diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 56c6dee..311eaf2 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -682,7 +682,7 @@ void FullCodeGenerator::DoTest(Expression* condition, Label* fall_through) { __ mov(a0, result_register()); Handle 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); } @@ -1047,7 +1047,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { // Record position before stub call for type feedback. SetSourcePosition(clause->position()); Handle ic = CompareIC::GetUninitialized(isolate(), Token::EQ_STRICT); - CallIC(ic, NOT_CONTEXTUAL, clause->CompareId()); + CallIC(ic, clause->CompareId()); patch_site.EmitPatchInfo(); Label skip; @@ -1707,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); @@ -2115,7 +2115,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ lw(a1, MemOperand(sp, kPointerSize)); __ lw(a0, MemOperand(sp, 2 * kPointerSize)); Handle 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)); @@ -2313,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 ic = isolate()->builtins()->KeyedLoadIC_Initialize(); - CallIC(ic, NOT_CONTEXTUAL, prop->PropertyFeedbackId()); + CallIC(ic, prop->PropertyFeedbackId()); } @@ -2341,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); @@ -2421,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); } @@ -2460,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: { @@ -2487,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. @@ -2582,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); @@ -2605,7 +2603,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { Handle 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); @@ -2632,10 +2630,8 @@ void FullCodeGenerator::VisitProperty(Property* expr) { void FullCodeGenerator::CallIC(Handle code, - ContextualMode mode, TypeFeedbackId id) { ic_total_count_++; - ASSERT(mode != CONTEXTUAL || id.IsNone()); __ Call(code, RelocInfo::CODE_TARGET, id); } @@ -4475,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); @@ -4507,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()) { @@ -4524,7 +4518,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { Handle 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()) { @@ -4709,7 +4703,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { // Record position and call the compare IC. SetSourcePosition(expr->position()); Handle 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); @@ -4743,7 +4737,7 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr, Split(eq, a0, Operand(a1), if_true, if_false, fall_through); } else { Handle 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); diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index 6f8989a..9380f19 100644 --- a/src/x64/full-codegen-x64.cc +++ b/src/x64/full-codegen-x64.cc @@ -641,7 +641,7 @@ void FullCodeGenerator::DoTest(Expression* condition, Label* if_false, Label* fall_through) { Handle ic = ToBooleanStub::GetUninitialized(isolate()); - CallIC(ic, NOT_CONTEXTUAL, condition->test_id()); + CallIC(ic, condition->test_id()); __ testq(result_register(), result_register()); // The stub returns nonzero for true. Split(not_zero, if_true, if_false, fall_through); @@ -994,7 +994,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { // Record position before stub call for type feedback. SetSourcePosition(clause->position()); Handle ic = CompareIC::GetUninitialized(isolate(), Token::EQ_STRICT); - CallIC(ic, NOT_CONTEXTUAL, clause->CompareId()); + CallIC(ic, clause->CompareId()); patch_site.EmitPatchInfo(); Label skip; @@ -1663,7 +1663,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { VisitForAccumulatorValue(value); __ Move(rcx, key->value()); __ movp(rdx, Operand(rsp, 0)); - CallStoreIC(NOT_CONTEXTUAL, key->LiteralFeedbackId()); + CallStoreIC(key->LiteralFeedbackId()); PrepareForBailoutForId(key->id(), NO_REGISTERS); } else { VisitForEffect(value); @@ -2078,7 +2078,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ movp(rdx, Operand(rsp, kPointerSize)); __ movp(rax, Operand(rsp, 2 * kPointerSize)); Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); - CallIC(ic, NOT_CONTEXTUAL, TypeFeedbackId::None()); + CallIC(ic, TypeFeedbackId::None()); __ movp(rdi, rax); __ movp(Operand(rsp, 2 * kPointerSize), rdi); CallFunctionStub stub(1, CALL_AS_METHOD); @@ -2269,7 +2269,7 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { SetSourcePosition(prop->position()); Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); - CallIC(ic, NOT_CONTEXTUAL, prop->PropertyFeedbackId()); + CallIC(ic, prop->PropertyFeedbackId()); } @@ -2291,8 +2291,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, __ bind(&stub_call); __ movp(rax, rcx); BinaryOpICStub stub(op, mode); - CallIC(stub.GetCode(isolate()), NOT_CONTEXTUAL, - expr->BinaryOperationFeedbackId()); + CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); patch_site.EmitPatchInfo(); __ jmp(&done, Label::kNear); @@ -2341,8 +2340,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, __ pop(rdx); 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(rax); } @@ -2380,7 +2378,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { __ movp(rdx, rax); __ pop(rax); // Restore value. __ Move(rcx, prop->key()->AsLiteral()->value()); - CallStoreIC(NOT_CONTEXTUAL); + CallStoreIC(); break; } case KEYED_PROPERTY: { @@ -2407,7 +2405,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, // Global var, const, or let. __ Move(rcx, var->name()); __ movp(rdx, GlobalObjectOperand()); - CallStoreIC(CONTEXTUAL); + CallStoreIC(); } else if (op == Token::INIT_CONST) { // Const initializers need a write barrier. ASSERT(!var->IsParameter()); // No const parameters. @@ -2498,7 +2496,7 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { SetSourcePosition(expr->position()); __ Move(rcx, prop->key()->AsLiteral()->value()); __ pop(rdx); - CallStoreIC(NOT_CONTEXTUAL, expr->AssignmentFeedbackId()); + CallStoreIC(expr->AssignmentFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); context()->Plug(rax); @@ -2515,7 +2513,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { Handle 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(rax); @@ -2542,10 +2540,8 @@ void FullCodeGenerator::VisitProperty(Property* expr) { void FullCodeGenerator::CallIC(Handle code, - ContextualMode mode, TypeFeedbackId ast_id) { ic_total_count_++; - ASSERT(mode != CONTEXTUAL || ast_id.IsNone()); __ call(code, RelocInfo::CODE_TARGET, ast_id); } @@ -4414,9 +4410,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { __ movp(rdx, rax); __ Move(rax, Smi::FromInt(1)); BinaryOpICStub stub(expr->binary_op(), NO_OVERWRITE); - CallIC(stub.GetCode(isolate()), - NOT_CONTEXTUAL, - expr->CountBinOpFeedbackId()); + CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId()); patch_site.EmitPatchInfo(); __ bind(&done); @@ -4447,7 +4441,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { case NAMED_PROPERTY: { __ Move(rcx, prop->key()->AsLiteral()->value()); __ pop(rdx); - CallStoreIC(NOT_CONTEXTUAL, expr->CountStoreFeedbackId()); + CallStoreIC(expr->CountStoreFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); if (expr->is_postfix()) { if (!context()->IsEffect()) { @@ -4464,7 +4458,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { Handle 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()) { @@ -4652,7 +4646,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { // Record position and call the compare IC. SetSourcePosition(expr->position()); Handle 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); @@ -4687,7 +4681,7 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr, Split(equal, if_true, if_false, fall_through); } else { Handle ic = CompareNilICStub::GetUninitialized(isolate(), nil); - CallIC(ic, NOT_CONTEXTUAL, expr->CompareOperationFeedbackId()); + CallIC(ic, expr->CompareOperationFeedbackId()); __ testq(rax, rax); Split(not_zero, if_true, if_false, fall_through); } -- 2.7.4