OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 3652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3663 // clang-format on | 3663 // clang-format on |
3664 } else { | 3664 } else { |
3665 if (if_false != fall_through) __ b(if_false); | 3665 if (if_false != fall_through) __ b(if_false); |
3666 } | 3666 } |
3667 context()->Plug(if_true, if_false); | 3667 context()->Plug(if_true, if_false); |
3668 } | 3668 } |
3669 | 3669 |
3670 | 3670 |
3671 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 3671 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
3672 Comment cmnt(masm_, "[ CompareOperation"); | 3672 Comment cmnt(masm_, "[ CompareOperation"); |
3673 SetExpressionPosition(expr); | |
3674 | 3673 |
3675 // First we try a fast inlined version of the compare when one of | 3674 // First we try a fast inlined version of the compare when one of |
3676 // the operands is a literal. | 3675 // the operands is a literal. |
3677 if (TryLiteralCompare(expr)) return; | 3676 if (TryLiteralCompare(expr)) return; |
3678 | 3677 |
3679 // Always perform the comparison for its control flow. Pack the result | 3678 // Always perform the comparison for its control flow. Pack the result |
3680 // into the expression's context after the comparison is performed. | 3679 // into the expression's context after the comparison is performed. |
3681 Label materialize_true, materialize_false; | 3680 Label materialize_true, materialize_false; |
3682 Label* if_true = NULL; | 3681 Label* if_true = NULL; |
3683 Label* if_false = NULL; | 3682 Label* if_false = NULL; |
3684 Label* fall_through = NULL; | 3683 Label* fall_through = NULL; |
3685 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3684 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
3686 &if_false, &fall_through); | 3685 &if_false, &fall_through); |
3687 | 3686 |
3688 Token::Value op = expr->op(); | 3687 Token::Value op = expr->op(); |
3689 VisitForStackValue(expr->left()); | 3688 VisitForStackValue(expr->left()); |
3690 switch (op) { | 3689 switch (op) { |
3691 case Token::IN: | 3690 case Token::IN: |
3692 VisitForStackValue(expr->right()); | 3691 VisitForStackValue(expr->right()); |
| 3692 SetExpressionPosition(expr); |
3693 CallRuntimeWithOperands(Runtime::kHasProperty); | 3693 CallRuntimeWithOperands(Runtime::kHasProperty); |
3694 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3694 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3695 __ CompareRoot(r3, Heap::kTrueValueRootIndex); | 3695 __ CompareRoot(r3, Heap::kTrueValueRootIndex); |
3696 Split(eq, if_true, if_false, fall_through); | 3696 Split(eq, if_true, if_false, fall_through); |
3697 break; | 3697 break; |
3698 | 3698 |
3699 case Token::INSTANCEOF: { | 3699 case Token::INSTANCEOF: { |
3700 VisitForAccumulatorValue(expr->right()); | 3700 VisitForAccumulatorValue(expr->right()); |
| 3701 SetExpressionPosition(expr); |
3701 PopOperand(r4); | 3702 PopOperand(r4); |
3702 InstanceOfStub stub(isolate()); | 3703 InstanceOfStub stub(isolate()); |
3703 __ CallStub(&stub); | 3704 __ CallStub(&stub); |
3704 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3705 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3705 __ CompareRoot(r3, Heap::kTrueValueRootIndex); | 3706 __ CompareRoot(r3, Heap::kTrueValueRootIndex); |
3706 Split(eq, if_true, if_false, fall_through); | 3707 Split(eq, if_true, if_false, fall_through); |
3707 break; | 3708 break; |
3708 } | 3709 } |
3709 | 3710 |
3710 default: { | 3711 default: { |
3711 VisitForAccumulatorValue(expr->right()); | 3712 VisitForAccumulatorValue(expr->right()); |
| 3713 SetExpressionPosition(expr); |
3712 Condition cond = CompareIC::ComputeCondition(op); | 3714 Condition cond = CompareIC::ComputeCondition(op); |
3713 PopOperand(r4); | 3715 PopOperand(r4); |
3714 | 3716 |
3715 bool inline_smi_code = ShouldInlineSmiCase(op); | 3717 bool inline_smi_code = ShouldInlineSmiCase(op); |
3716 JumpPatchSite patch_site(masm_); | 3718 JumpPatchSite patch_site(masm_); |
3717 if (inline_smi_code) { | 3719 if (inline_smi_code) { |
3718 Label slow_case; | 3720 Label slow_case; |
3719 __ orx(r5, r3, r4); | 3721 __ orx(r5, r3, r4); |
3720 patch_site.EmitJumpIfNotSmi(r5, &slow_case); | 3722 patch_site.EmitJumpIfNotSmi(r5, &slow_case); |
3721 __ cmp(r4, r3); | 3723 __ cmp(r4, r3); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3939 | 3941 |
3940 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3942 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3941 | 3943 |
3942 DCHECK(interrupt_address == | 3944 DCHECK(interrupt_address == |
3943 isolate->builtins()->OnStackReplacement()->entry()); | 3945 isolate->builtins()->OnStackReplacement()->entry()); |
3944 return ON_STACK_REPLACEMENT; | 3946 return ON_STACK_REPLACEMENT; |
3945 } | 3947 } |
3946 } // namespace internal | 3948 } // namespace internal |
3947 } // namespace v8 | 3949 } // namespace v8 |
3948 #endif // V8_TARGET_ARCH_PPC | 3950 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |