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/arm/lithium-arm.h" | 5 #include "src/crankshaft/arm/lithium-arm.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/crankshaft/arm/lithium-codegen-arm.h" | 9 #include "src/crankshaft/arm/lithium-codegen-arm.h" |
10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 // an arguments adaptor frame on top of it (if the latter is present). | 880 // an arguments adaptor frame on top of it (if the latter is present). |
881 hydrogen_env = hydrogen_env->outer(); | 881 hydrogen_env = hydrogen_env->outer(); |
882 if (hydrogen_env != nullptr && | 882 if (hydrogen_env != nullptr && |
883 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { | 883 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { |
884 hydrogen_env = hydrogen_env->outer(); | 884 hydrogen_env = hydrogen_env->outer(); |
885 } | 885 } |
886 if (hydrogen_env != nullptr) { | 886 if (hydrogen_env != nullptr) { |
887 // Push return value on top of outer environment. | 887 // Push return value on top of outer environment. |
888 hydrogen_env = hydrogen_env->Copy(); | 888 hydrogen_env = hydrogen_env->Copy(); |
889 hydrogen_env->Push(hydrogen_val); | 889 hydrogen_env->Push(hydrogen_val); |
| 890 } else { |
| 891 // Although we don't need this lazy bailout for normal execution |
| 892 // (because when we tail call from the outermost function we should pop |
| 893 // its frame) we still need it when debugger is on. |
| 894 hydrogen_env = current_block_->last_environment(); |
890 } | 895 } |
891 } else { | 896 } else { |
892 if (hydrogen_val->HasObservableSideEffects()) { | 897 if (hydrogen_val->HasObservableSideEffects()) { |
893 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); | 898 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); |
894 sim->ReplayEnvironment(hydrogen_env); | 899 sim->ReplayEnvironment(hydrogen_env); |
895 hydrogen_value_for_lazy_bailout = sim; | 900 hydrogen_value_for_lazy_bailout = sim; |
896 } | 901 } |
897 } | 902 } |
898 if (hydrogen_env != nullptr) { | 903 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( |
899 // The |hydrogen_env| can be null at this point only if we are generating | 904 new (zone()) LLazyBailout(), hydrogen_env); |
900 // a syntactic tail call from the outermost function but in this case | 905 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); |
901 // it would be a real tail call which will pop function's frame and | 906 chunk_->AddInstruction(bailout, current_block_); |
902 // therefore this lazy bailout can be skipped. | |
903 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( | |
904 new (zone()) LLazyBailout(), hydrogen_env); | |
905 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); | |
906 chunk_->AddInstruction(bailout, current_block_); | |
907 } | |
908 } | 907 } |
909 } | 908 } |
910 | 909 |
911 | 910 |
912 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { | 911 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { |
913 LInstruction* result = new (zone()) LPrologue(); | 912 LInstruction* result = new (zone()) LPrologue(); |
914 if (info_->num_heap_slots() > 0) { | 913 if (info_->num_heap_slots() > 0) { |
915 result = MarkAsCall(result, instr); | 914 result = MarkAsCall(result, instr); |
916 } | 915 } |
917 return result; | 916 return result; |
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2572 } | 2571 } |
2573 | 2572 |
2574 | 2573 |
2575 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { | 2574 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { |
2576 LOperand* context = UseRegisterAtStart(instr->context()); | 2575 LOperand* context = UseRegisterAtStart(instr->context()); |
2577 return new(zone()) LStoreFrameContext(context); | 2576 return new(zone()) LStoreFrameContext(context); |
2578 } | 2577 } |
2579 | 2578 |
2580 } // namespace internal | 2579 } // namespace internal |
2581 } // namespace v8 | 2580 } // namespace v8 |
OLD | NEW |