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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 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 |
752 // Helper for an unused node. | 769 // Helper for an unused node. |
753 void VisitUnused(Node* node) { | 770 void VisitUnused(Node* node) { |
754 int value_count = node->op()->ValueInputCount() + | 771 int value_count = node->op()->ValueInputCount() + |
755 OperatorProperties::GetContextInputCount(node->op()) + | 772 OperatorProperties::GetContextInputCount(node->op()) + |
756 OperatorProperties::GetFrameStateInputCount(node->op()); | 773 OperatorProperties::GetFrameStateInputCount(node->op()); |
757 for (int i = 0; i < value_count; i++) { | 774 for (int i = 0; i < value_count; i++) { |
758 ProcessInput(node, i, UseInfo::None()); | 775 ProcessInput(node, i, UseInfo::None()); |
759 } | 776 } |
760 ProcessRemainingInputs(node, value_count); | 777 ProcessRemainingInputs(node, value_count); |
761 if (lower()) Kill(node); | 778 if (lower()) Kill(node); |
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 MachineRepresentation output = | 2458 MachineRepresentation output = |
2442 GetOutputInfoForPhi(node, TypeOf(node->InputAt(0)), truncation); | 2459 GetOutputInfoForPhi(node, TypeOf(node->InputAt(0)), truncation); |
2443 VisitUnop(node, UseInfo(output, truncation), output); | 2460 VisitUnop(node, UseInfo(output, truncation), output); |
2444 if (lower()) DeferReplacement(node, node->InputAt(0)); | 2461 if (lower()) DeferReplacement(node, node->InputAt(0)); |
2445 return; | 2462 return; |
2446 } | 2463 } |
2447 | 2464 |
2448 case IrOpcode::kOsrGuard: | 2465 case IrOpcode::kOsrGuard: |
2449 return VisitOsrGuard(node); | 2466 return VisitOsrGuard(node); |
2450 | 2467 |
| 2468 case IrOpcode::kReturn: |
| 2469 VisitReturn(node); |
| 2470 // Assume the output is tagged. |
| 2471 return SetOutput(node, MachineRepresentation::kTagged); |
| 2472 |
2451 // Operators with all inputs tagged and no or tagged output have uniform | 2473 // Operators with all inputs tagged and no or tagged output have uniform |
2452 // handling. | 2474 // handling. |
2453 case IrOpcode::kEnd: | 2475 case IrOpcode::kEnd: |
2454 case IrOpcode::kReturn: | |
2455 case IrOpcode::kIfSuccess: | 2476 case IrOpcode::kIfSuccess: |
2456 case IrOpcode::kIfException: | 2477 case IrOpcode::kIfException: |
2457 case IrOpcode::kIfTrue: | 2478 case IrOpcode::kIfTrue: |
2458 case IrOpcode::kIfFalse: | 2479 case IrOpcode::kIfFalse: |
2459 case IrOpcode::kDeoptimize: | 2480 case IrOpcode::kDeoptimize: |
2460 case IrOpcode::kEffectPhi: | 2481 case IrOpcode::kEffectPhi: |
2461 case IrOpcode::kTerminate: | 2482 case IrOpcode::kTerminate: |
2462 case IrOpcode::kFrameState: | 2483 case IrOpcode::kFrameState: |
2463 case IrOpcode::kCheckpoint: | 2484 case IrOpcode::kCheckpoint: |
2464 case IrOpcode::kLoop: | 2485 case IrOpcode::kLoop: |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3249 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3270 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3250 Operator::kNoProperties); | 3271 Operator::kNoProperties); |
3251 to_number_operator_.set(common()->Call(desc)); | 3272 to_number_operator_.set(common()->Call(desc)); |
3252 } | 3273 } |
3253 return to_number_operator_.get(); | 3274 return to_number_operator_.get(); |
3254 } | 3275 } |
3255 | 3276 |
3256 } // namespace compiler | 3277 } // namespace compiler |
3257 } // namespace internal | 3278 } // namespace internal |
3258 } // namespace v8 | 3279 } // namespace v8 |
OLD | NEW |