From: fschneider@chromium.org Date: Mon, 19 Mar 2012 07:51:37 +0000 (+0000) Subject: Re-enable constructor inlining and inline === comparison with boolean constants. X-Git-Tag: upstream/4.7.83~17071 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c99c90be7322373fb13121c7674cce26d063392;p=platform%2Fupstream%2Fv8.git Re-enable constructor inlining and inline === comparison with boolean constants. This change reverts r10974 which disabled those two optimizations. They were not responsible for the problem in earley-boyer. BUG=v8:2009 Review URL: https://chromiumcodereview.appspot.com/9699117 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11076 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 2d6d179..d3b1736 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -192,7 +192,7 @@ DEFINE_bool(use_osr, true, "use on-stack replacement") DEFINE_bool(trace_osr, false, "trace on-stack replacement") DEFINE_int(stress_runs, 0, "number of stress runs") DEFINE_bool(optimize_closures, true, "optimize closures") -DEFINE_bool(inline_construct, false, "inline constructor calls") +DEFINE_bool(inline_construct, true, "inline constructor calls") DEFINE_bool(inline_arguments, true, "inline functions with arguments object") DEFINE_int(loop_weight, 1, "loop weight for representation inference") diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 3b7b37d..c28730b 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -6755,6 +6755,15 @@ static bool IsLiteralCompareNil(HValue* left, } +static bool IsLiteralCompareBool(HValue* left, + Token::Value op, + HValue* right) { + return op == Token::EQ_STRICT && + ((left->IsConstant() && HConstant::cast(left)->handle()->IsBoolean()) || + (right->IsConstant() && HConstant::cast(right)->handle()->IsBoolean())); +} + + void HGraphBuilder::VisitCompareOperation(CompareOperation* expr) { ASSERT(!HasStackOverflow()); ASSERT(current_block() != NULL); @@ -6802,6 +6811,12 @@ void HGraphBuilder::VisitCompareOperation(CompareOperation* expr) { if (IsLiteralCompareNil(left, op, right, f->null_value(), &sub_expr)) { return HandleLiteralCompareNil(expr, sub_expr, kNullValue); } + if (IsLiteralCompareBool(left, op, right)) { + HCompareObjectEqAndBranch* result = + new(zone()) HCompareObjectEqAndBranch(left, right); + result->set_position(expr->position()); + return ast_context()->ReturnControl(result, expr->id()); + } if (op == Token::INSTANCEOF) { // Check to see if the rhs of the instanceof is a global function not