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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 3688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3699 // clang-format on | 3699 // clang-format on |
3700 } else { | 3700 } else { |
3701 if (if_false != fall_through) __ jmp(if_false); | 3701 if (if_false != fall_through) __ jmp(if_false); |
3702 } | 3702 } |
3703 context()->Plug(if_true, if_false); | 3703 context()->Plug(if_true, if_false); |
3704 } | 3704 } |
3705 | 3705 |
3706 | 3706 |
3707 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 3707 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
3708 Comment cmnt(masm_, "[ CompareOperation"); | 3708 Comment cmnt(masm_, "[ CompareOperation"); |
3709 SetExpressionPosition(expr); | |
3710 | 3709 |
3711 // First we try a fast inlined version of the compare when one of | 3710 // First we try a fast inlined version of the compare when one of |
3712 // the operands is a literal. | 3711 // the operands is a literal. |
3713 if (TryLiteralCompare(expr)) return; | 3712 if (TryLiteralCompare(expr)) return; |
3714 | 3713 |
3715 // Always perform the comparison for its control flow. Pack the result | 3714 // Always perform the comparison for its control flow. Pack the result |
3716 // into the expression's context after the comparison is performed. | 3715 // into the expression's context after the comparison is performed. |
3717 Label materialize_true, materialize_false; | 3716 Label materialize_true, materialize_false; |
3718 Label* if_true = NULL; | 3717 Label* if_true = NULL; |
3719 Label* if_false = NULL; | 3718 Label* if_false = NULL; |
3720 Label* fall_through = NULL; | 3719 Label* fall_through = NULL; |
3721 context()->PrepareTest(&materialize_true, &materialize_false, | 3720 context()->PrepareTest(&materialize_true, &materialize_false, |
3722 &if_true, &if_false, &fall_through); | 3721 &if_true, &if_false, &fall_through); |
3723 | 3722 |
3724 Token::Value op = expr->op(); | 3723 Token::Value op = expr->op(); |
3725 VisitForStackValue(expr->left()); | 3724 VisitForStackValue(expr->left()); |
3726 switch (op) { | 3725 switch (op) { |
3727 case Token::IN: | 3726 case Token::IN: |
3728 VisitForStackValue(expr->right()); | 3727 VisitForStackValue(expr->right()); |
| 3728 SetExpressionPosition(expr); |
3729 CallRuntimeWithOperands(Runtime::kHasProperty); | 3729 CallRuntimeWithOperands(Runtime::kHasProperty); |
3730 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3730 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3731 __ LoadRoot(a4, Heap::kTrueValueRootIndex); | 3731 __ LoadRoot(a4, Heap::kTrueValueRootIndex); |
3732 Split(eq, v0, Operand(a4), if_true, if_false, fall_through); | 3732 Split(eq, v0, Operand(a4), if_true, if_false, fall_through); |
3733 break; | 3733 break; |
3734 | 3734 |
3735 case Token::INSTANCEOF: { | 3735 case Token::INSTANCEOF: { |
3736 VisitForAccumulatorValue(expr->right()); | 3736 VisitForAccumulatorValue(expr->right()); |
| 3737 SetExpressionPosition(expr); |
3737 __ mov(a0, result_register()); | 3738 __ mov(a0, result_register()); |
3738 PopOperand(a1); | 3739 PopOperand(a1); |
3739 InstanceOfStub stub(isolate()); | 3740 InstanceOfStub stub(isolate()); |
3740 __ CallStub(&stub); | 3741 __ CallStub(&stub); |
3741 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3742 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3742 __ LoadRoot(a4, Heap::kTrueValueRootIndex); | 3743 __ LoadRoot(a4, Heap::kTrueValueRootIndex); |
3743 Split(eq, v0, Operand(a4), if_true, if_false, fall_through); | 3744 Split(eq, v0, Operand(a4), if_true, if_false, fall_through); |
3744 break; | 3745 break; |
3745 } | 3746 } |
3746 | 3747 |
3747 default: { | 3748 default: { |
3748 VisitForAccumulatorValue(expr->right()); | 3749 VisitForAccumulatorValue(expr->right()); |
| 3750 SetExpressionPosition(expr); |
3749 Condition cc = CompareIC::ComputeCondition(op); | 3751 Condition cc = CompareIC::ComputeCondition(op); |
3750 __ mov(a0, result_register()); | 3752 __ mov(a0, result_register()); |
3751 PopOperand(a1); | 3753 PopOperand(a1); |
3752 | 3754 |
3753 bool inline_smi_code = ShouldInlineSmiCase(op); | 3755 bool inline_smi_code = ShouldInlineSmiCase(op); |
3754 JumpPatchSite patch_site(masm_); | 3756 JumpPatchSite patch_site(masm_); |
3755 if (inline_smi_code) { | 3757 if (inline_smi_code) { |
3756 Label slow_case; | 3758 Label slow_case; |
3757 __ Or(a2, a0, Operand(a1)); | 3759 __ Or(a2, a0, Operand(a1)); |
3758 patch_site.EmitJumpIfNotSmi(a2, &slow_case); | 3760 patch_site.EmitJumpIfNotSmi(a2, &slow_case); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3991 reinterpret_cast<uint64_t>( | 3993 reinterpret_cast<uint64_t>( |
3992 isolate->builtins()->OnStackReplacement()->entry())); | 3994 isolate->builtins()->OnStackReplacement()->entry())); |
3993 return ON_STACK_REPLACEMENT; | 3995 return ON_STACK_REPLACEMENT; |
3994 } | 3996 } |
3995 | 3997 |
3996 | 3998 |
3997 } // namespace internal | 3999 } // namespace internal |
3998 } // namespace v8 | 4000 } // namespace v8 |
3999 | 4001 |
4000 #endif // V8_TARGET_ARCH_MIPS64 | 4002 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |