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

Side by Side Diff: src/crankshaft/mips/lithium-mips.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/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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 // an arguments adaptor frame on top of it (if the latter is present). 890 // an arguments adaptor frame on top of it (if the latter is present).
891 hydrogen_env = hydrogen_env->outer(); 891 hydrogen_env = hydrogen_env->outer();
892 if (hydrogen_env != nullptr && 892 if (hydrogen_env != nullptr &&
893 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { 893 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) {
894 hydrogen_env = hydrogen_env->outer(); 894 hydrogen_env = hydrogen_env->outer();
895 } 895 }
896 if (hydrogen_env != nullptr) { 896 if (hydrogen_env != nullptr) {
897 // Push return value on top of outer environment. 897 // Push return value on top of outer environment.
898 hydrogen_env = hydrogen_env->Copy(); 898 hydrogen_env = hydrogen_env->Copy();
899 hydrogen_env->Push(hydrogen_val); 899 hydrogen_env->Push(hydrogen_val);
900 } else {
901 // Although we don't need this lazy bailout for normal execution
902 // (because when we tail call from the outermost function we should pop
903 // its frame) we still need it when debugger is on.
904 hydrogen_env = current_block_->last_environment();
900 } 905 }
901 } else { 906 } else {
902 if (hydrogen_val->HasObservableSideEffects()) { 907 if (hydrogen_val->HasObservableSideEffects()) {
903 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); 908 HSimulate* sim = HSimulate::cast(hydrogen_val->next());
904 sim->ReplayEnvironment(hydrogen_env); 909 sim->ReplayEnvironment(hydrogen_env);
905 hydrogen_value_for_lazy_bailout = sim; 910 hydrogen_value_for_lazy_bailout = sim;
906 } 911 }
907 } 912 }
908 if (hydrogen_env != nullptr) { 913 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment(
909 // The |hydrogen_env| can be null at this point only if we are generating 914 new (zone()) LLazyBailout(), hydrogen_env);
910 // a syntactic tail call from the outermost function but in this case 915 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
911 // it would be a real tail call which will pop function's frame and 916 chunk_->AddInstruction(bailout, current_block_);
912 // therefore this lazy bailout can be skipped.
913 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment(
914 new (zone()) LLazyBailout(), hydrogen_env);
915 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
916 chunk_->AddInstruction(bailout, current_block_);
917 }
918 } 917 }
919 } 918 }
920 919
921 920
922 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { 921 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
923 LInstruction* result = new (zone()) LPrologue(); 922 LInstruction* result = new (zone()) LPrologue();
924 if (info_->num_heap_slots() > 0) { 923 if (info_->num_heap_slots() > 0) {
925 result = MarkAsCall(result, instr); 924 result = MarkAsCall(result, instr);
926 } 925 }
927 return result; 926 return result;
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2522 2521
2523 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { 2522 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) {
2524 LOperand* context = UseRegisterAtStart(instr->context()); 2523 LOperand* context = UseRegisterAtStart(instr->context());
2525 return new(zone()) LStoreFrameContext(context); 2524 return new(zone()) LStoreFrameContext(context);
2526 } 2525 }
2527 2526
2528 } // namespace internal 2527 } // namespace internal
2529 } // namespace v8 2528 } // namespace v8
2530 2529
2531 #endif // V8_TARGET_ARCH_MIPS 2530 #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