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

Side by Side Diff: src/crankshaft/ia32/lithium-ia32.cc

Issue 1816113002: [crankshaft] Always generate lazy bailout points for tail calls ... (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/arm64/lithium-arm64.cc ('k') | src/crankshaft/mips/lithium-mips.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/ia32/lithium-ia32.h" 5 #include "src/crankshaft/ia32/lithium-ia32.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #if V8_TARGET_ARCH_IA32 9 #if V8_TARGET_ARCH_IA32
10 10
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 // an arguments adaptor frame on top of it (if the latter is present). 913 // an arguments adaptor frame on top of it (if the latter is present).
914 hydrogen_env = hydrogen_env->outer(); 914 hydrogen_env = hydrogen_env->outer();
915 if (hydrogen_env != nullptr && 915 if (hydrogen_env != nullptr &&
916 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { 916 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) {
917 hydrogen_env = hydrogen_env->outer(); 917 hydrogen_env = hydrogen_env->outer();
918 } 918 }
919 if (hydrogen_env != nullptr) { 919 if (hydrogen_env != nullptr) {
920 // Push return value on top of outer environment. 920 // Push return value on top of outer environment.
921 hydrogen_env = hydrogen_env->Copy(); 921 hydrogen_env = hydrogen_env->Copy();
922 hydrogen_env->Push(hydrogen_val); 922 hydrogen_env->Push(hydrogen_val);
923 } else {
924 // Although we don't need this lazy bailout for normal execution
925 // (because when we tail call from the outermost function we should pop
926 // its frame) we still need it when debugger is on.
927 hydrogen_env = current_block_->last_environment();
923 } 928 }
924 } else { 929 } else {
925 if (hydrogen_val->HasObservableSideEffects()) { 930 if (hydrogen_val->HasObservableSideEffects()) {
926 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); 931 HSimulate* sim = HSimulate::cast(hydrogen_val->next());
927 sim->ReplayEnvironment(hydrogen_env); 932 sim->ReplayEnvironment(hydrogen_env);
928 hydrogen_value_for_lazy_bailout = sim; 933 hydrogen_value_for_lazy_bailout = sim;
929 } 934 }
930 } 935 }
931 if (hydrogen_env != nullptr) { 936 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment(
932 // The |hydrogen_env| can be null at this point only if we are generating 937 new (zone()) LLazyBailout(), hydrogen_env);
933 // a syntactic tail call from the outermost function but in this case 938 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
934 // it would be a real tail call which will pop function's frame and 939 chunk_->AddInstruction(bailout, current_block_);
935 // therefore this lazy bailout can be skipped.
936 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment(
937 new (zone()) LLazyBailout(), hydrogen_env);
938 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
939 chunk_->AddInstruction(bailout, current_block_);
940 }
941 } 940 }
942 } 941 }
943 942
944 943
945 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { 944 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
946 LInstruction* result = new (zone()) LPrologue(); 945 LInstruction* result = new (zone()) LPrologue();
947 if (info_->num_heap_slots() > 0) { 946 if (info_->num_heap_slots() > 0) {
948 result = MarkAsCall(result, instr); 947 result = MarkAsCall(result, instr);
949 } 948 }
950 return result; 949 return result;
(...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after
2628 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { 2627 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) {
2629 LOperand* context = UseRegisterAtStart(instr->context()); 2628 LOperand* context = UseRegisterAtStart(instr->context());
2630 return new(zone()) LStoreFrameContext(context); 2629 return new(zone()) LStoreFrameContext(context);
2631 } 2630 }
2632 2631
2633 2632
2634 } // namespace internal 2633 } // namespace internal
2635 } // namespace v8 2634 } // namespace v8
2636 2635
2637 #endif // V8_TARGET_ARCH_IA32 2636 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/arm64/lithium-arm64.cc ('k') | src/crankshaft/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698