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 #include "src/compiler/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/address-map.h" | 9 #include "src/address-map.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 OperatorProperties::GetFrameStateInputCount(node->op()); | 741 OperatorProperties::GetFrameStateInputCount(node->op()); |
742 // Visit value, context and frame state inputs as tagged. | 742 // Visit value, context and frame state inputs as tagged. |
743 for (int i = 0; i < tagged_count; i++) { | 743 for (int i = 0; i < tagged_count; i++) { |
744 ProcessInput(node, i, UseInfo::AnyTagged()); | 744 ProcessInput(node, i, UseInfo::AnyTagged()); |
745 } | 745 } |
746 // Only enqueue other inputs (effects, control). | 746 // Only enqueue other inputs (effects, control). |
747 for (int i = tagged_count; i < node->InputCount(); i++) { | 747 for (int i = tagged_count; i < node->InputCount(); i++) { |
748 EnqueueInput(node, i); | 748 EnqueueInput(node, i); |
749 } | 749 } |
750 } | 750 } |
751 | |
752 void VisitReturn(Node* node) { | |
753 int tagged_limit = node->op()->ValueInputCount() + | |
754 OperatorProperties::GetContextInputCount(node->op()) + | |
755 OperatorProperties::GetFrameStateInputCount(node->op()); | |
756 // Visit integer slot count to pop | |
757 ProcessInput(node, 0, UseInfo::TruncatingWord32()); | |
758 | |
759 // Visit value, context and frame state inputs as tagged. | |
760 for (int i = 1; i < tagged_limit; i++) { | |
761 ProcessInput(node, i, UseInfo::AnyTagged()); | |
762 } | |
763 // Only enqueue other inputs (effects, control). | |
764 for (int i = tagged_limit; i < node->InputCount(); i++) { | |
765 EnqueueInput(node, i); | |
766 } | |
767 } | |
768 | 751 |
769 // Helper for an unused node. | 752 // Helper for an unused node. |
770 void VisitUnused(Node* node) { | 753 void VisitUnused(Node* node) { |
771 int value_count = node->op()->ValueInputCount() + | 754 int value_count = node->op()->ValueInputCount() + |
772 OperatorProperties::GetContextInputCount(node->op()) + | 755 OperatorProperties::GetContextInputCount(node->op()) + |
773 OperatorProperties::GetFrameStateInputCount(node->op()); | 756 OperatorProperties::GetFrameStateInputCount(node->op()); |
774 for (int i = 0; i < value_count; i++) { | 757 for (int i = 0; i < value_count; i++) { |
775 ProcessInput(node, i, UseInfo::None()); | 758 ProcessInput(node, i, UseInfo::None()); |
776 } | 759 } |
777 ProcessRemainingInputs(node, value_count); | 760 ProcessRemainingInputs(node, value_count); |
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2458 MachineRepresentation output = | 2441 MachineRepresentation output = |
2459 GetOutputInfoForPhi(node, TypeOf(node->InputAt(0)), truncation); | 2442 GetOutputInfoForPhi(node, TypeOf(node->InputAt(0)), truncation); |
2460 VisitUnop(node, UseInfo(output, truncation), output); | 2443 VisitUnop(node, UseInfo(output, truncation), output); |
2461 if (lower()) DeferReplacement(node, node->InputAt(0)); | 2444 if (lower()) DeferReplacement(node, node->InputAt(0)); |
2462 return; | 2445 return; |
2463 } | 2446 } |
2464 | 2447 |
2465 case IrOpcode::kOsrGuard: | 2448 case IrOpcode::kOsrGuard: |
2466 return VisitOsrGuard(node); | 2449 return VisitOsrGuard(node); |
2467 | 2450 |
2468 case IrOpcode::kReturn: | |
2469 VisitReturn(node); | |
2470 // Assume the output is tagged. | |
2471 return SetOutput(node, MachineRepresentation::kTagged); | |
2472 | |
2473 // Operators with all inputs tagged and no or tagged output have uniform | 2451 // Operators with all inputs tagged and no or tagged output have uniform |
2474 // handling. | 2452 // handling. |
2475 case IrOpcode::kEnd: | 2453 case IrOpcode::kEnd: |
| 2454 case IrOpcode::kReturn: |
2476 case IrOpcode::kIfSuccess: | 2455 case IrOpcode::kIfSuccess: |
2477 case IrOpcode::kIfException: | 2456 case IrOpcode::kIfException: |
2478 case IrOpcode::kIfTrue: | 2457 case IrOpcode::kIfTrue: |
2479 case IrOpcode::kIfFalse: | 2458 case IrOpcode::kIfFalse: |
2480 case IrOpcode::kDeoptimize: | 2459 case IrOpcode::kDeoptimize: |
2481 case IrOpcode::kEffectPhi: | 2460 case IrOpcode::kEffectPhi: |
2482 case IrOpcode::kTerminate: | 2461 case IrOpcode::kTerminate: |
2483 case IrOpcode::kFrameState: | 2462 case IrOpcode::kFrameState: |
2484 case IrOpcode::kCheckpoint: | 2463 case IrOpcode::kCheckpoint: |
2485 case IrOpcode::kLoop: | 2464 case IrOpcode::kLoop: |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3270 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3249 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3271 Operator::kNoProperties); | 3250 Operator::kNoProperties); |
3272 to_number_operator_.set(common()->Call(desc)); | 3251 to_number_operator_.set(common()->Call(desc)); |
3273 } | 3252 } |
3274 return to_number_operator_.get(); | 3253 return to_number_operator_.get(); |
3275 } | 3254 } |
3276 | 3255 |
3277 } // namespace compiler | 3256 } // namespace compiler |
3278 } // namespace internal | 3257 } // namespace internal |
3279 } // namespace v8 | 3258 } // namespace v8 |
OLD | NEW |