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_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3678 // clang-format on | 3678 // clang-format on |
3679 } else { | 3679 } else { |
3680 if (if_false != fall_through) __ jmp(if_false); | 3680 if (if_false != fall_through) __ jmp(if_false); |
3681 } | 3681 } |
3682 context()->Plug(if_true, if_false); | 3682 context()->Plug(if_true, if_false); |
3683 } | 3683 } |
3684 | 3684 |
3685 | 3685 |
3686 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 3686 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
3687 Comment cmnt(masm_, "[ CompareOperation"); | 3687 Comment cmnt(masm_, "[ CompareOperation"); |
3688 SetExpressionPosition(expr); | |
3689 | 3688 |
3690 // First we try a fast inlined version of the compare when one of | 3689 // First we try a fast inlined version of the compare when one of |
3691 // the operands is a literal. | 3690 // the operands is a literal. |
3692 if (TryLiteralCompare(expr)) return; | 3691 if (TryLiteralCompare(expr)) return; |
3693 | 3692 |
3694 // Always perform the comparison for its control flow. Pack the result | 3693 // Always perform the comparison for its control flow. Pack the result |
3695 // into the expression's context after the comparison is performed. | 3694 // into the expression's context after the comparison is performed. |
3696 Label materialize_true, materialize_false; | 3695 Label materialize_true, materialize_false; |
3697 Label* if_true = NULL; | 3696 Label* if_true = NULL; |
3698 Label* if_false = NULL; | 3697 Label* if_false = NULL; |
3699 Label* fall_through = NULL; | 3698 Label* fall_through = NULL; |
3700 context()->PrepareTest(&materialize_true, &materialize_false, | 3699 context()->PrepareTest(&materialize_true, &materialize_false, |
3701 &if_true, &if_false, &fall_through); | 3700 &if_true, &if_false, &fall_through); |
3702 | 3701 |
3703 Token::Value op = expr->op(); | 3702 Token::Value op = expr->op(); |
3704 VisitForStackValue(expr->left()); | 3703 VisitForStackValue(expr->left()); |
3705 switch (op) { | 3704 switch (op) { |
3706 case Token::IN: | 3705 case Token::IN: |
3707 VisitForStackValue(expr->right()); | 3706 VisitForStackValue(expr->right()); |
| 3707 SetExpressionPosition(expr); |
3708 CallRuntimeWithOperands(Runtime::kHasProperty); | 3708 CallRuntimeWithOperands(Runtime::kHasProperty); |
3709 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3709 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3710 __ CompareRoot(r0, Heap::kTrueValueRootIndex); | 3710 __ CompareRoot(r0, Heap::kTrueValueRootIndex); |
3711 Split(eq, if_true, if_false, fall_through); | 3711 Split(eq, if_true, if_false, fall_through); |
3712 break; | 3712 break; |
3713 | 3713 |
3714 case Token::INSTANCEOF: { | 3714 case Token::INSTANCEOF: { |
3715 VisitForAccumulatorValue(expr->right()); | 3715 VisitForAccumulatorValue(expr->right()); |
| 3716 SetExpressionPosition(expr); |
3716 PopOperand(r1); | 3717 PopOperand(r1); |
3717 InstanceOfStub stub(isolate()); | 3718 InstanceOfStub stub(isolate()); |
3718 __ CallStub(&stub); | 3719 __ CallStub(&stub); |
3719 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3720 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3720 __ CompareRoot(r0, Heap::kTrueValueRootIndex); | 3721 __ CompareRoot(r0, Heap::kTrueValueRootIndex); |
3721 Split(eq, if_true, if_false, fall_through); | 3722 Split(eq, if_true, if_false, fall_through); |
3722 break; | 3723 break; |
3723 } | 3724 } |
3724 | 3725 |
3725 default: { | 3726 default: { |
3726 VisitForAccumulatorValue(expr->right()); | 3727 VisitForAccumulatorValue(expr->right()); |
| 3728 SetExpressionPosition(expr); |
3727 Condition cond = CompareIC::ComputeCondition(op); | 3729 Condition cond = CompareIC::ComputeCondition(op); |
3728 PopOperand(r1); | 3730 PopOperand(r1); |
3729 | 3731 |
3730 bool inline_smi_code = ShouldInlineSmiCase(op); | 3732 bool inline_smi_code = ShouldInlineSmiCase(op); |
3731 JumpPatchSite patch_site(masm_); | 3733 JumpPatchSite patch_site(masm_); |
3732 if (inline_smi_code) { | 3734 if (inline_smi_code) { |
3733 Label slow_case; | 3735 Label slow_case; |
3734 __ orr(r2, r0, Operand(r1)); | 3736 __ orr(r2, r0, Operand(r1)); |
3735 patch_site.EmitJumpIfNotSmi(r2, &slow_case); | 3737 patch_site.EmitJumpIfNotSmi(r2, &slow_case); |
3736 __ cmp(r1, r0); | 3738 __ cmp(r1, r0); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4029 DCHECK(interrupt_address == | 4031 DCHECK(interrupt_address == |
4030 isolate->builtins()->OnStackReplacement()->entry()); | 4032 isolate->builtins()->OnStackReplacement()->entry()); |
4031 return ON_STACK_REPLACEMENT; | 4033 return ON_STACK_REPLACEMENT; |
4032 } | 4034 } |
4033 | 4035 |
4034 | 4036 |
4035 } // namespace internal | 4037 } // namespace internal |
4036 } // namespace v8 | 4038 } // namespace v8 |
4037 | 4039 |
4038 #endif // V8_TARGET_ARCH_ARM | 4040 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |