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 <dconrod@codeaurora.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13288 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ulan@chromium.org 2012-12-28 15:14:44 +00:00
parent 3526c6be98
commit eb27eb0351
3 changed files with 9 additions and 5 deletions

View File

@ -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));

View File

@ -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);
}

View File

@ -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);