| 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 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2445 if (lower()) DeferReplacement(node, node->InputAt(0)); | 2462 if (lower()) DeferReplacement(node, node->InputAt(0)); |
| 2446 return; | 2463 return; |
| 2447 } | 2464 } |
| 2448 | 2465 |
| 2449 case IrOpcode::kOsrGuard: | 2466 case IrOpcode::kOsrGuard: |
| 2450 return VisitOsrGuard(node); | 2467 return VisitOsrGuard(node); |
| 2451 | 2468 |
| 2452 // Operators with all inputs tagged and no or tagged output have uniform | 2469 // Operators with all inputs tagged and no or tagged output have uniform |
| 2453 // handling. | 2470 // handling. |
| 2454 case IrOpcode::kEnd: | 2471 case IrOpcode::kEnd: |
| 2455 case IrOpcode::kReturn: | |
| 2456 case IrOpcode::kIfSuccess: | 2472 case IrOpcode::kIfSuccess: |
| 2457 case IrOpcode::kIfException: | 2473 case IrOpcode::kIfException: |
| 2458 case IrOpcode::kIfTrue: | 2474 case IrOpcode::kIfTrue: |
| 2459 case IrOpcode::kIfFalse: | 2475 case IrOpcode::kIfFalse: |
| 2460 case IrOpcode::kDeoptimize: | 2476 case IrOpcode::kDeoptimize: |
| 2461 case IrOpcode::kEffectPhi: | 2477 case IrOpcode::kEffectPhi: |
| 2462 case IrOpcode::kTerminate: | 2478 case IrOpcode::kTerminate: |
| 2463 case IrOpcode::kFrameState: | 2479 case IrOpcode::kFrameState: |
| 2464 case IrOpcode::kCheckpoint: | 2480 case IrOpcode::kCheckpoint: |
| 2465 case IrOpcode::kLoop: | 2481 case IrOpcode::kLoop: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2480 #undef OPCODE_CASE | 2496 #undef OPCODE_CASE |
| 2481 case IrOpcode::kJSToInteger: | 2497 case IrOpcode::kJSToInteger: |
| 2482 case IrOpcode::kJSToLength: | 2498 case IrOpcode::kJSToLength: |
| 2483 case IrOpcode::kJSToName: | 2499 case IrOpcode::kJSToName: |
| 2484 case IrOpcode::kJSToObject: | 2500 case IrOpcode::kJSToObject: |
| 2485 case IrOpcode::kJSToString: | 2501 case IrOpcode::kJSToString: |
| 2486 VisitInputs(node); | 2502 VisitInputs(node); |
| 2487 // Assume the output is tagged. | 2503 // Assume the output is tagged. |
| 2488 return SetOutput(node, MachineRepresentation::kTagged); | 2504 return SetOutput(node, MachineRepresentation::kTagged); |
| 2489 | 2505 |
| 2506 case IrOpcode::kReturn: |
| 2507 VisitReturn(node); |
| 2508 // Assume the output is tagged. |
| 2509 return SetOutput(node, MachineRepresentation::kTagged); |
| 2510 |
| 2490 default: | 2511 default: |
| 2491 V8_Fatal( | 2512 V8_Fatal( |
| 2492 __FILE__, __LINE__, | 2513 __FILE__, __LINE__, |
| 2493 "Representation inference: unsupported opcode %i (%s), node #%i\n.", | 2514 "Representation inference: unsupported opcode %i (%s), node #%i\n.", |
| 2494 node->opcode(), node->op()->mnemonic(), node->id()); | 2515 node->opcode(), node->op()->mnemonic(), node->id()); |
| 2495 break; | 2516 break; |
| 2496 } | 2517 } |
| 2497 UNREACHABLE(); | 2518 UNREACHABLE(); |
| 2498 } | 2519 } |
| 2499 | 2520 |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3250 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3271 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
| 3251 Operator::kNoProperties); | 3272 Operator::kNoProperties); |
| 3252 to_number_operator_.set(common()->Call(desc)); | 3273 to_number_operator_.set(common()->Call(desc)); |
| 3253 } | 3274 } |
| 3254 return to_number_operator_.get(); | 3275 return to_number_operator_.get(); |
| 3255 } | 3276 } |
| 3256 | 3277 |
| 3257 } // namespace compiler | 3278 } // namespace compiler |
| 3258 } // namespace internal | 3279 } // namespace internal |
| 3259 } // namespace v8 | 3280 } // namespace v8 |
| OLD | NEW |