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

Side by Side Diff: src/crankshaft/mips/lithium-mips.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 | « src/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/mips64/lithium-mips64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/crankshaft/mips/lithium-mips.h" 5 #include "src/crankshaft/mips/lithium-mips.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 instr = AssignEnvironment(instr); 880 instr = AssignEnvironment(instr);
881 } 881 }
882 chunk_->AddInstruction(instr, current_block_); 882 chunk_->AddInstruction(instr, current_block_);
883 883
884 if (instr->IsCall()) { 884 if (instr->IsCall()) {
885 HEnvironment* hydrogen_env = current_block_->last_environment(); 885 HEnvironment* hydrogen_env = current_block_->last_environment();
886 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; 886 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
887 DCHECK_NOT_NULL(hydrogen_env); 887 DCHECK_NOT_NULL(hydrogen_env);
888 if (instr->IsSyntacticTailCall()) { 888 if (instr->IsSyntacticTailCall()) {
889 // If it was a syntactic tail call we need to drop the current frame and 889 // If it was a syntactic tail call we need to drop the current frame and
890 // an arguments adaptor frame on top of it (if the latter is present). 890 // all the frames on top of it that are either an arguments adaptor frame
891 // or a tail caller frame.
891 hydrogen_env = hydrogen_env->outer(); 892 hydrogen_env = hydrogen_env->outer();
892 if (hydrogen_env != nullptr && 893 while (hydrogen_env != nullptr &&
893 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { 894 (hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR ||
895 hydrogen_env->frame_type() == TAIL_CALLER_FUNCTION)) {
894 hydrogen_env = hydrogen_env->outer(); 896 hydrogen_env = hydrogen_env->outer();
895 } 897 }
896 if (hydrogen_env != nullptr) { 898 if (hydrogen_env != nullptr) {
897 // Push return value on top of outer environment. 899 // Push return value on top of outer environment.
898 hydrogen_env = hydrogen_env->Copy(); 900 hydrogen_env = hydrogen_env->Copy();
899 hydrogen_env->Push(hydrogen_val); 901 hydrogen_env->Push(hydrogen_val);
900 } else { 902 } else {
901 // Although we don't need this lazy bailout for normal execution 903 // Although we don't need this lazy bailout for normal execution
902 // (because when we tail call from the outermost function we should pop 904 // (because when we tail call from the outermost function we should pop
903 // its frame) we still need it when debugger is on. 905 // its frame) we still need it when debugger is on.
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
2505 LOperand* index = UseTempRegister(instr->index()); 2507 LOperand* index = UseTempRegister(instr->index());
2506 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2508 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2507 LInstruction* result = DefineSameAsFirst(load); 2509 LInstruction* result = DefineSameAsFirst(load);
2508 return AssignPointerMap(result); 2510 return AssignPointerMap(result);
2509 } 2511 }
2510 2512
2511 } // namespace internal 2513 } // namespace internal
2512 } // namespace v8 2514 } // namespace v8
2513 2515
2514 #endif // V8_TARGET_ARCH_MIPS 2516 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/mips64/lithium-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698