OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 3687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3698 // clang-format on | 3698 // clang-format on |
3699 } else { | 3699 } else { |
3700 if (if_false != fall_through) __ jmp(if_false); | 3700 if (if_false != fall_through) __ jmp(if_false); |
3701 } | 3701 } |
3702 context()->Plug(if_true, if_false); | 3702 context()->Plug(if_true, if_false); |
3703 } | 3703 } |
3704 | 3704 |
3705 | 3705 |
3706 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 3706 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
3707 Comment cmnt(masm_, "[ CompareOperation"); | 3707 Comment cmnt(masm_, "[ CompareOperation"); |
3708 SetExpressionPosition(expr); | |
3709 | 3708 |
3710 // First we try a fast inlined version of the compare when one of | 3709 // First we try a fast inlined version of the compare when one of |
3711 // the operands is a literal. | 3710 // the operands is a literal. |
3712 if (TryLiteralCompare(expr)) return; | 3711 if (TryLiteralCompare(expr)) return; |
3713 | 3712 |
3714 // Always perform the comparison for its control flow. Pack the result | 3713 // Always perform the comparison for its control flow. Pack the result |
3715 // into the expression's context after the comparison is performed. | 3714 // into the expression's context after the comparison is performed. |
3716 Label materialize_true, materialize_false; | 3715 Label materialize_true, materialize_false; |
3717 Label* if_true = NULL; | 3716 Label* if_true = NULL; |
3718 Label* if_false = NULL; | 3717 Label* if_false = NULL; |
3719 Label* fall_through = NULL; | 3718 Label* fall_through = NULL; |
3720 context()->PrepareTest(&materialize_true, &materialize_false, | 3719 context()->PrepareTest(&materialize_true, &materialize_false, |
3721 &if_true, &if_false, &fall_through); | 3720 &if_true, &if_false, &fall_through); |
3722 | 3721 |
3723 Token::Value op = expr->op(); | 3722 Token::Value op = expr->op(); |
3724 VisitForStackValue(expr->left()); | 3723 VisitForStackValue(expr->left()); |
3725 switch (op) { | 3724 switch (op) { |
3726 case Token::IN: | 3725 case Token::IN: |
3727 VisitForStackValue(expr->right()); | 3726 VisitForStackValue(expr->right()); |
| 3727 SetExpressionPosition(expr); |
3728 CallRuntimeWithOperands(Runtime::kHasProperty); | 3728 CallRuntimeWithOperands(Runtime::kHasProperty); |
3729 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3729 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3730 __ LoadRoot(t0, Heap::kTrueValueRootIndex); | 3730 __ LoadRoot(t0, Heap::kTrueValueRootIndex); |
3731 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); | 3731 Split(eq, v0, Operand(t0), if_true, if_false, fall_through); |
3732 break; | 3732 break; |
3733 | 3733 |
3734 case Token::INSTANCEOF: { | 3734 case Token::INSTANCEOF: { |
3735 VisitForAccumulatorValue(expr->right()); | 3735 VisitForAccumulatorValue(expr->right()); |
| 3736 SetExpressionPosition(expr); |
3736 __ mov(a0, result_register()); | 3737 __ mov(a0, result_register()); |
3737 PopOperand(a1); | 3738 PopOperand(a1); |
3738 InstanceOfStub stub(isolate()); | 3739 InstanceOfStub stub(isolate()); |
3739 __ CallStub(&stub); | 3740 __ CallStub(&stub); |
3740 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3741 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3741 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 3742 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
3742 Split(eq, v0, Operand(at), if_true, if_false, fall_through); | 3743 Split(eq, v0, Operand(at), if_true, if_false, fall_through); |
3743 break; | 3744 break; |
3744 } | 3745 } |
3745 | 3746 |
3746 default: { | 3747 default: { |
3747 VisitForAccumulatorValue(expr->right()); | 3748 VisitForAccumulatorValue(expr->right()); |
| 3749 SetExpressionPosition(expr); |
3748 Condition cc = CompareIC::ComputeCondition(op); | 3750 Condition cc = CompareIC::ComputeCondition(op); |
3749 __ mov(a0, result_register()); | 3751 __ mov(a0, result_register()); |
3750 PopOperand(a1); | 3752 PopOperand(a1); |
3751 | 3753 |
3752 bool inline_smi_code = ShouldInlineSmiCase(op); | 3754 bool inline_smi_code = ShouldInlineSmiCase(op); |
3753 JumpPatchSite patch_site(masm_); | 3755 JumpPatchSite patch_site(masm_); |
3754 if (inline_smi_code) { | 3756 if (inline_smi_code) { |
3755 Label slow_case; | 3757 Label slow_case; |
3756 __ Or(a2, a0, Operand(a1)); | 3758 __ Or(a2, a0, Operand(a1)); |
3757 patch_site.EmitJumpIfNotSmi(a2, &slow_case); | 3759 patch_site.EmitJumpIfNotSmi(a2, &slow_case); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3983 reinterpret_cast<uint32_t>( | 3985 reinterpret_cast<uint32_t>( |
3984 isolate->builtins()->OnStackReplacement()->entry())); | 3986 isolate->builtins()->OnStackReplacement()->entry())); |
3985 return ON_STACK_REPLACEMENT; | 3987 return ON_STACK_REPLACEMENT; |
3986 } | 3988 } |
3987 | 3989 |
3988 | 3990 |
3989 } // namespace internal | 3991 } // namespace internal |
3990 } // namespace v8 | 3992 } // namespace v8 |
3991 | 3993 |
3992 #endif // V8_TARGET_ARCH_MIPS | 3994 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |