| Index: src/mips/full-codegen-mips.cc
|
| ===================================================================
|
| --- src/mips/full-codegen-mips.cc (revision 9305)
|
| +++ src/mips/full-codegen-mips.cc (working copy)
|
| @@ -3926,10 +3926,14 @@
|
| }
|
|
|
| void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr,
|
| - Handle<String> check,
|
| - Label* if_true,
|
| - Label* if_false,
|
| - Label* fall_through) {
|
| + Handle<String> check) {
|
| + Label materialize_true, materialize_false;
|
| + Label* if_true = NULL;
|
| + Label* if_false = NULL;
|
| + Label* fall_through = NULL;
|
| + context()->PrepareTest(&materialize_true, &materialize_false,
|
| + &if_true, &if_false, &fall_through);
|
| +
|
| { AccumulatorValueContext context(this);
|
| VisitForTypeofValue(expr);
|
| }
|
| @@ -3991,28 +3995,20 @@
|
| } else {
|
| if (if_false != fall_through) __ jmp(if_false);
|
| }
|
| + context()->Plug(if_true, if_false);
|
| }
|
|
|
|
|
| -void FullCodeGenerator::EmitLiteralCompareUndefined(Expression* expr,
|
| - Label* if_true,
|
| - Label* if_false,
|
| - Label* fall_through) {
|
| - VisitForAccumulatorValue(expr);
|
| - PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
|
| -
|
| - __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
|
| - Split(eq, v0, Operand(at), if_true, if_false, fall_through);
|
| -}
|
| -
|
| -
|
| void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
|
| Comment cmnt(masm_, "[ CompareOperation");
|
| SetSourcePosition(expr->position());
|
|
|
| + // First we try a fast inlined version of the compare when one of
|
| + // the operands is a literal.
|
| + if (TryLiteralCompare(expr)) return;
|
| +
|
| // Always perform the comparison for its control flow. Pack the result
|
| // into the expression's context after the comparison is performed.
|
| -
|
| Label materialize_true, materialize_false;
|
| Label* if_true = NULL;
|
| Label* if_false = NULL;
|
| @@ -4020,13 +4016,6 @@
|
| context()->PrepareTest(&materialize_true, &materialize_false,
|
| &if_true, &if_false, &fall_through);
|
|
|
| - // First we try a fast inlined version of the compare when one of
|
| - // the operands is a literal.
|
| - if (TryLiteralCompare(expr, if_true, if_false, fall_through)) {
|
| - context()->Plug(if_true, if_false);
|
| - return;
|
| - }
|
| -
|
| Token::Value op = expr->op();
|
| VisitForStackValue(expr->left());
|
| switch (op) {
|
| @@ -4114,20 +4103,31 @@
|
| }
|
|
|
|
|
| -void FullCodeGenerator::EmitLiteralCompareNull(Expression* expr,
|
| - bool is_strict,
|
| - Label* if_true,
|
| - Label* if_false,
|
| - Label* fall_through) {
|
| - VisitForAccumulatorValue(expr);
|
| +void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr,
|
| + Expression* sub_expr,
|
| + NilValue nil) {
|
| + Label materialize_true, materialize_false;
|
| + Label* if_true = NULL;
|
| + Label* if_false = NULL;
|
| + Label* fall_through = NULL;
|
| + context()->PrepareTest(&materialize_true, &materialize_false,
|
| + &if_true, &if_false, &fall_through);
|
| +
|
| + VisitForAccumulatorValue(sub_expr);
|
| PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
|
| + Heap::RootListIndex nil_value = nil == kNullValue ?
|
| + Heap::kNullValueRootIndex :
|
| + Heap::kUndefinedValueRootIndex;
|
| __ mov(a0, result_register());
|
| - __ LoadRoot(a1, Heap::kNullValueRootIndex);
|
| - if (is_strict) {
|
| + __ LoadRoot(a1, nil_value);
|
| + if (expr->op() == Token::EQ_STRICT) {
|
| Split(eq, a0, Operand(a1), if_true, if_false, fall_through);
|
| } else {
|
| + Heap::RootListIndex other_nil_value = nil == kNullValue ?
|
| + Heap::kUndefinedValueRootIndex :
|
| + Heap::kNullValueRootIndex;
|
| __ Branch(if_true, eq, a0, Operand(a1));
|
| - __ LoadRoot(a1, Heap::kUndefinedValueRootIndex);
|
| + __ LoadRoot(a1, other_nil_value);
|
| __ Branch(if_true, eq, a0, Operand(a1));
|
| __ And(at, a0, Operand(kSmiTagMask));
|
| __ Branch(if_false, eq, at, Operand(zero_reg));
|
| @@ -4137,6 +4137,7 @@
|
| __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
|
| Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through);
|
| }
|
| + context()->Plug(if_true, if_false);
|
| }
|
|
|
|
|
|
|