From eb27eb0351aaa9e2f664b7a2251b1a28f1daf667 Mon Sep 17 00:00:00 2001 From: "ulan@chromium.org" Date: Fri, 28 Dec 2012 15:14:44 +0000 Subject: [PATCH] Enable type feedback for branch statement and function call This change associates TypeFeedbackIds with ToBoolean stubs in full-compiled code on ARM, allowing their information to be used in Crankshaft. This eliminates unnecessary checks, especially in DoBranch. Review URL: https://chromiumcodereview.appspot.com/11635046 Patch from Jay Conrod . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13288 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/full-codegen-arm.cc | 4 ++-- src/arm/macro-assembler-arm.cc | 6 ++++-- src/arm/macro-assembler-arm.h | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index 4182f8c26e..b6f3e6760c 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -675,7 +675,7 @@ void FullCodeGenerator::DoTest(Expression* condition, Label* if_false, Label* fall_through) { ToBooleanStub stub(result_register()); - __ CallStub(&stub); + __ CallStub(&stub, condition->test_id()); __ tst(result_register(), result_register()); Split(ne, if_true, if_false, fall_through); } @@ -2330,7 +2330,7 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr, CallFunctionFlags flags) { CallFunctionStub stub(arg_count, flags); __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); - __ CallStub(&stub); + __ CallStub(&stub, expr->CallFeedbackId()); RecordJSReturnSite(expr); // Restore context register. __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc index 77ee36eae0..0764e090dd 100644 --- a/src/arm/macro-assembler-arm.cc +++ b/src/arm/macro-assembler-arm.cc @@ -2210,9 +2210,11 @@ void MacroAssembler::TryGetFunctionPrototype(Register function, } -void MacroAssembler::CallStub(CodeStub* stub, Condition cond) { +void MacroAssembler::CallStub(CodeStub* stub, + TypeFeedbackId ast_id, + Condition cond) { ASSERT(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. - Call(stub->GetCode(), RelocInfo::CODE_TARGET, TypeFeedbackId::None(), cond); + Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id, cond); } diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h index 27f6d6d84e..454e64523b 100644 --- a/src/arm/macro-assembler-arm.h +++ b/src/arm/macro-assembler-arm.h @@ -1001,7 +1001,9 @@ class MacroAssembler: public Assembler { // Runtime calls // Call a code stub. - void CallStub(CodeStub* stub, Condition cond = al); + void CallStub(CodeStub* stub, + TypeFeedbackId ast_id = TypeFeedbackId::None(), + Condition cond = al); // Call a code stub. void TailCallStub(CodeStub* stub, Condition cond = al);