| Index: src/hydrogen.cc
|
| ===================================================================
|
| --- src/hydrogen.cc (revision 10434)
|
| +++ src/hydrogen.cc (working copy)
|
| @@ -6172,6 +6172,15 @@
|
| }
|
|
|
|
|
| +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);
|
| @@ -6219,6 +6228,12 @@
|
| 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
|
|
|