OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 3560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3571 #undef SIMD128_TYPE | 3571 #undef SIMD128_TYPE |
3572 // clang-format on | 3572 // clang-format on |
3573 } else { | 3573 } else { |
3574 if (if_false != fall_through) __ b(if_false); | 3574 if (if_false != fall_through) __ b(if_false); |
3575 } | 3575 } |
3576 context()->Plug(if_true, if_false); | 3576 context()->Plug(if_true, if_false); |
3577 } | 3577 } |
3578 | 3578 |
3579 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 3579 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
3580 Comment cmnt(masm_, "[ CompareOperation"); | 3580 Comment cmnt(masm_, "[ CompareOperation"); |
3581 SetExpressionPosition(expr); | |
3582 | 3581 |
3583 // First we try a fast inlined version of the compare when one of | 3582 // First we try a fast inlined version of the compare when one of |
3584 // the operands is a literal. | 3583 // the operands is a literal. |
3585 if (TryLiteralCompare(expr)) return; | 3584 if (TryLiteralCompare(expr)) return; |
3586 | 3585 |
3587 // Always perform the comparison for its control flow. Pack the result | 3586 // Always perform the comparison for its control flow. Pack the result |
3588 // into the expression's context after the comparison is performed. | 3587 // into the expression's context after the comparison is performed. |
3589 Label materialize_true, materialize_false; | 3588 Label materialize_true, materialize_false; |
3590 Label* if_true = NULL; | 3589 Label* if_true = NULL; |
3591 Label* if_false = NULL; | 3590 Label* if_false = NULL; |
3592 Label* fall_through = NULL; | 3591 Label* fall_through = NULL; |
3593 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3592 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
3594 &if_false, &fall_through); | 3593 &if_false, &fall_through); |
3595 | 3594 |
3596 Token::Value op = expr->op(); | 3595 Token::Value op = expr->op(); |
3597 VisitForStackValue(expr->left()); | 3596 VisitForStackValue(expr->left()); |
3598 switch (op) { | 3597 switch (op) { |
3599 case Token::IN: | 3598 case Token::IN: |
3600 VisitForStackValue(expr->right()); | 3599 VisitForStackValue(expr->right()); |
| 3600 SetExpressionPosition(expr); |
3601 CallRuntimeWithOperands(Runtime::kHasProperty); | 3601 CallRuntimeWithOperands(Runtime::kHasProperty); |
3602 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3602 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3603 __ CompareRoot(r2, Heap::kTrueValueRootIndex); | 3603 __ CompareRoot(r2, Heap::kTrueValueRootIndex); |
3604 Split(eq, if_true, if_false, fall_through); | 3604 Split(eq, if_true, if_false, fall_through); |
3605 break; | 3605 break; |
3606 | 3606 |
3607 case Token::INSTANCEOF: { | 3607 case Token::INSTANCEOF: { |
3608 VisitForAccumulatorValue(expr->right()); | 3608 VisitForAccumulatorValue(expr->right()); |
| 3609 SetExpressionPosition(expr); |
3609 PopOperand(r3); | 3610 PopOperand(r3); |
3610 InstanceOfStub stub(isolate()); | 3611 InstanceOfStub stub(isolate()); |
3611 __ CallStub(&stub); | 3612 __ CallStub(&stub); |
3612 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3613 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3613 __ CompareRoot(r2, Heap::kTrueValueRootIndex); | 3614 __ CompareRoot(r2, Heap::kTrueValueRootIndex); |
3614 Split(eq, if_true, if_false, fall_through); | 3615 Split(eq, if_true, if_false, fall_through); |
3615 break; | 3616 break; |
3616 } | 3617 } |
3617 | 3618 |
3618 default: { | 3619 default: { |
3619 VisitForAccumulatorValue(expr->right()); | 3620 VisitForAccumulatorValue(expr->right()); |
| 3621 SetExpressionPosition(expr); |
3620 Condition cond = CompareIC::ComputeCondition(op); | 3622 Condition cond = CompareIC::ComputeCondition(op); |
3621 PopOperand(r3); | 3623 PopOperand(r3); |
3622 | 3624 |
3623 bool inline_smi_code = ShouldInlineSmiCase(op); | 3625 bool inline_smi_code = ShouldInlineSmiCase(op); |
3624 JumpPatchSite patch_site(masm_); | 3626 JumpPatchSite patch_site(masm_); |
3625 if (inline_smi_code) { | 3627 if (inline_smi_code) { |
3626 Label slow_case; | 3628 Label slow_case; |
3627 __ LoadRR(r4, r3); | 3629 __ LoadRR(r4, r3); |
3628 __ OrP(r4, r2); | 3630 __ OrP(r4, r2); |
3629 patch_site.EmitJumpIfNotSmi(r4, &slow_case); | 3631 patch_site.EmitJumpIfNotSmi(r4, &slow_case); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3845 DCHECK(kOSRBranchInstruction == br_instr); | 3847 DCHECK(kOSRBranchInstruction == br_instr); |
3846 | 3848 |
3847 DCHECK(interrupt_address == | 3849 DCHECK(interrupt_address == |
3848 isolate->builtins()->OnStackReplacement()->entry()); | 3850 isolate->builtins()->OnStackReplacement()->entry()); |
3849 return ON_STACK_REPLACEMENT; | 3851 return ON_STACK_REPLACEMENT; |
3850 } | 3852 } |
3851 | 3853 |
3852 } // namespace internal | 3854 } // namespace internal |
3853 } // namespace v8 | 3855 } // namespace v8 |
3854 #endif // V8_TARGET_ARCH_S390 | 3856 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |