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/instruction-selector.h" | 5 #include "src/compiler/instruction-selector.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/base/adapters.h" | 9 #include "src/base/adapters.h" |
10 #include "src/compiler/instruction-selector-impl.h" | 10 #include "src/compiler/instruction-selector-impl.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 size_t frame_state_entries = 0; | 630 size_t frame_state_entries = 0; |
631 USE(frame_state_entries); // frame_state_entries is only used for debug. | 631 USE(frame_state_entries); // frame_state_entries is only used for debug. |
632 if (buffer->frame_state_descriptor != nullptr) { | 632 if (buffer->frame_state_descriptor != nullptr) { |
633 Node* frame_state = | 633 Node* frame_state = |
634 call->InputAt(static_cast<int>(buffer->descriptor->InputCount())); | 634 call->InputAt(static_cast<int>(buffer->descriptor->InputCount())); |
635 | 635 |
636 // If it was a syntactic tail call we need to drop the current frame and | 636 // If it was a syntactic tail call we need to drop the current frame and |
637 // all the frames on top of it that are either an arguments adaptor frame | 637 // all the frames on top of it that are either an arguments adaptor frame |
638 // or a tail caller frame. | 638 // or a tail caller frame. |
639 if (buffer->descriptor->SupportsTailCalls()) { | 639 if (buffer->descriptor->SupportsTailCalls()) { |
640 frame_state = NodeProperties::GetFrameStateInput(frame_state, 0); | 640 frame_state = NodeProperties::GetFrameStateInput(frame_state); |
641 buffer->frame_state_descriptor = | 641 buffer->frame_state_descriptor = |
642 buffer->frame_state_descriptor->outer_state(); | 642 buffer->frame_state_descriptor->outer_state(); |
643 while (buffer->frame_state_descriptor != nullptr && | 643 while (buffer->frame_state_descriptor != nullptr && |
644 (buffer->frame_state_descriptor->type() == | 644 (buffer->frame_state_descriptor->type() == |
645 FrameStateType::kArgumentsAdaptor || | 645 FrameStateType::kArgumentsAdaptor || |
646 buffer->frame_state_descriptor->type() == | 646 buffer->frame_state_descriptor->type() == |
647 FrameStateType::kTailCallerFunction)) { | 647 FrameStateType::kTailCallerFunction)) { |
648 frame_state = NodeProperties::GetFrameStateInput(frame_state, 0); | 648 frame_state = NodeProperties::GetFrameStateInput(frame_state); |
649 buffer->frame_state_descriptor = | 649 buffer->frame_state_descriptor = |
650 buffer->frame_state_descriptor->outer_state(); | 650 buffer->frame_state_descriptor->outer_state(); |
651 } | 651 } |
652 } | 652 } |
653 | 653 |
654 int const state_id = sequence()->AddDeoptimizationEntry( | 654 int const state_id = sequence()->AddDeoptimizationEntry( |
655 buffer->frame_state_descriptor, DeoptimizeReason::kNoReason); | 655 buffer->frame_state_descriptor, DeoptimizeReason::kNoReason); |
656 buffer->instruction_args.push_back(g.TempImmediate(state_id)); | 656 buffer->instruction_args.push_back(g.TempImmediate(state_id)); |
657 | 657 |
658 StateObjectDeduplicator deduplicator(instruction_zone()); | 658 StateObjectDeduplicator deduplicator(instruction_zone()); |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2067 return new (instruction_zone()) FrameStateDescriptor( | 2067 return new (instruction_zone()) FrameStateDescriptor( |
2068 instruction_zone(), state_info.type(), state_info.bailout_id(), | 2068 instruction_zone(), state_info.type(), state_info.bailout_id(), |
2069 state_info.state_combine(), parameters, locals, stack, | 2069 state_info.state_combine(), parameters, locals, stack, |
2070 state_info.shared_info(), outer_state); | 2070 state_info.shared_info(), outer_state); |
2071 } | 2071 } |
2072 | 2072 |
2073 | 2073 |
2074 } // namespace compiler | 2074 } // namespace compiler |
2075 } // namespace internal | 2075 } // namespace internal |
2076 } // namespace v8 | 2076 } // namespace v8 |
OLD | NEW |