OLD | NEW |
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/mips64/lithium-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-mips64.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
10 | 10 |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2527 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { | 2526 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { |
2528 LOperand* context = UseRegisterAtStart(instr->context()); | 2527 LOperand* context = UseRegisterAtStart(instr->context()); |
2529 return new(zone()) LStoreFrameContext(context); | 2528 return new(zone()) LStoreFrameContext(context); |
2530 } | 2529 } |
2531 | 2530 |
2532 | 2531 |
2533 } // namespace internal | 2532 } // namespace internal |
2534 } // namespace v8 | 2533 } // namespace v8 |
2535 | 2534 |
2536 #endif // V8_TARGET_ARCH_MIPS64 | 2535 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |