Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/compiler/instruction-selector.cc

Issue 1849503002: [crankshaft] [turbofan] Fix environment handling when generating a tail call from inlined function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/crankshaft/arm/lithium-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 // follows (n is the number of value inputs to the frame state): 608 // follows (n is the number of value inputs to the frame state):
609 // arg 1 : deoptimization id. 609 // arg 1 : deoptimization id.
610 // arg 2 - arg (n + 1) : value inputs to the frame state. 610 // arg 2 - arg (n + 1) : value inputs to the frame state.
611 size_t frame_state_entries = 0; 611 size_t frame_state_entries = 0;
612 USE(frame_state_entries); // frame_state_entries is only used for debug. 612 USE(frame_state_entries); // frame_state_entries is only used for debug.
613 if (buffer->frame_state_descriptor != nullptr) { 613 if (buffer->frame_state_descriptor != nullptr) {
614 Node* frame_state = 614 Node* frame_state =
615 call->InputAt(static_cast<int>(buffer->descriptor->InputCount())); 615 call->InputAt(static_cast<int>(buffer->descriptor->InputCount()));
616 616
617 // If it was a syntactic tail call we need to drop the current frame and 617 // If it was a syntactic tail call we need to drop the current frame and
618 // an arguments adaptor frame on top of it (if the latter is present). 618 // all the frames on top of it that are either an arguments adaptor frame
619 // or a tail caller frame.
619 if (buffer->descriptor->SupportsTailCalls()) { 620 if (buffer->descriptor->SupportsTailCalls()) {
620 frame_state = NodeProperties::GetFrameStateInput(frame_state, 0); 621 frame_state = NodeProperties::GetFrameStateInput(frame_state, 0);
621 buffer->frame_state_descriptor = 622 buffer->frame_state_descriptor =
622 buffer->frame_state_descriptor->outer_state(); 623 buffer->frame_state_descriptor->outer_state();
623 624 while (buffer->frame_state_descriptor != nullptr &&
624 if (buffer->frame_state_descriptor != nullptr && 625 (buffer->frame_state_descriptor->type() ==
625 buffer->frame_state_descriptor->type() == 626 FrameStateType::kArgumentsAdaptor ||
626 FrameStateType::kArgumentsAdaptor) { 627 buffer->frame_state_descriptor->type() ==
628 FrameStateType::kTailCallerFunction)) {
627 frame_state = NodeProperties::GetFrameStateInput(frame_state, 0); 629 frame_state = NodeProperties::GetFrameStateInput(frame_state, 0);
628 buffer->frame_state_descriptor = 630 buffer->frame_state_descriptor =
629 buffer->frame_state_descriptor->outer_state(); 631 buffer->frame_state_descriptor->outer_state();
630 } 632 }
631 } 633 }
632 634
633 InstructionSequence::StateId state_id = 635 InstructionSequence::StateId state_id =
634 sequence()->AddFrameStateDescriptor(buffer->frame_state_descriptor); 636 sequence()->AddFrameStateDescriptor(buffer->frame_state_descriptor);
635 buffer->instruction_args.push_back(g.TempImmediate(state_id.ToInt())); 637 buffer->instruction_args.push_back(g.TempImmediate(state_id.ToInt()));
636 638
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1793 return new (instruction_zone()) FrameStateDescriptor( 1795 return new (instruction_zone()) FrameStateDescriptor(
1794 instruction_zone(), state_info.type(), state_info.bailout_id(), 1796 instruction_zone(), state_info.type(), state_info.bailout_id(),
1795 state_info.state_combine(), parameters, locals, stack, 1797 state_info.state_combine(), parameters, locals, stack,
1796 state_info.shared_info(), outer_state); 1798 state_info.shared_info(), outer_state);
1797 } 1799 }
1798 1800
1799 1801
1800 } // namespace compiler 1802 } // namespace compiler
1801 } // namespace internal 1803 } // namespace internal
1802 } // namespace v8 1804 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/crankshaft/arm/lithium-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698