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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 #endif | 874 #endif |
875 | 875 |
876 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 876 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
877 instr = AssignPointerMap(instr); | 877 instr = AssignPointerMap(instr); |
878 } | 878 } |
879 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 879 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
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 CreateLazyBailoutForCall(current_block_, instr, hydrogen_val); |
885 HEnvironment* hydrogen_env = current_block_->last_environment(); | |
886 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; | |
887 DCHECK_NOT_NULL(hydrogen_env); | |
888 if (instr->IsSyntacticTailCall()) { | |
889 // If it was a syntactic tail call we need to drop the current frame and | |
890 // all the frames on top of it that are either an arguments adaptor frame | |
891 // or a tail caller frame. | |
892 hydrogen_env = hydrogen_env->outer(); | |
893 while (hydrogen_env != nullptr && | |
894 (hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR || | |
895 hydrogen_env->frame_type() == TAIL_CALLER_FUNCTION)) { | |
896 hydrogen_env = hydrogen_env->outer(); | |
897 } | |
898 if (hydrogen_env != nullptr) { | |
899 // Push return value on top of outer environment. | |
900 hydrogen_env = hydrogen_env->Copy(); | |
901 hydrogen_env->Push(hydrogen_val); | |
902 } else { | |
903 // Although we don't need this lazy bailout for normal execution | |
904 // (because when we tail call from the outermost function we should pop | |
905 // its frame) we still need it when debugger is on. | |
906 hydrogen_env = current_block_->last_environment(); | |
907 } | |
908 } else { | |
909 if (hydrogen_val->HasObservableSideEffects()) { | |
910 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); | |
911 sim->ReplayEnvironment(hydrogen_env); | |
912 hydrogen_value_for_lazy_bailout = sim; | |
913 } | |
914 } | |
915 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( | |
916 new (zone()) LLazyBailout(), hydrogen_env); | |
917 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); | |
918 chunk_->AddInstruction(bailout, current_block_); | |
919 } | |
920 } | 885 } |
921 | 886 |
922 | 887 |
923 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { | 888 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { |
924 LInstruction* result = new (zone()) LPrologue(); | 889 LInstruction* result = new (zone()) LPrologue(); |
925 if (info_->scope()->num_heap_slots() > 0) { | 890 if (info_->scope()->num_heap_slots() > 0) { |
926 result = MarkAsCall(result, instr); | 891 result = MarkAsCall(result, instr); |
927 } | 892 } |
928 return result; | 893 return result; |
929 } | 894 } |
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2512 LOperand* index = UseTempRegister(instr->index()); | 2477 LOperand* index = UseTempRegister(instr->index()); |
2513 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2478 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2514 LInstruction* result = DefineSameAsFirst(load); | 2479 LInstruction* result = DefineSameAsFirst(load); |
2515 return AssignPointerMap(result); | 2480 return AssignPointerMap(result); |
2516 } | 2481 } |
2517 | 2482 |
2518 } // namespace internal | 2483 } // namespace internal |
2519 } // namespace v8 | 2484 } // namespace v8 |
2520 | 2485 |
2521 #endif // V8_TARGET_ARCH_MIPS64 | 2486 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |