| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-ppc.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
| 10 #include "src/crankshaft/lithium-inl.h" | 10 #include "src/crankshaft/lithium-inl.h" |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 #endif | 879 #endif |
| 880 | 880 |
| 881 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 881 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
| 882 instr = AssignPointerMap(instr); | 882 instr = AssignPointerMap(instr); |
| 883 } | 883 } |
| 884 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 884 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
| 885 instr = AssignEnvironment(instr); | 885 instr = AssignEnvironment(instr); |
| 886 } | 886 } |
| 887 chunk_->AddInstruction(instr, current_block_); | 887 chunk_->AddInstruction(instr, current_block_); |
| 888 | 888 |
| 889 if (instr->IsCall()) { | 889 CreateLazyBailoutForCall(current_block_, instr, hydrogen_val); |
| 890 HEnvironment* hydrogen_env = current_block_->last_environment(); | |
| 891 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; | |
| 892 DCHECK_NOT_NULL(hydrogen_env); | |
| 893 if (instr->IsSyntacticTailCall()) { | |
| 894 // If it was a syntactic tail call we need to drop the current frame and | |
| 895 // all the frames on top of it that are either an arguments adaptor frame | |
| 896 // or a tail caller frame. | |
| 897 hydrogen_env = hydrogen_env->outer(); | |
| 898 while (hydrogen_env != nullptr && | |
| 899 (hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR || | |
| 900 hydrogen_env->frame_type() == TAIL_CALLER_FUNCTION)) { | |
| 901 hydrogen_env = hydrogen_env->outer(); | |
| 902 } | |
| 903 if (hydrogen_env != nullptr) { | |
| 904 // Push return value on top of outer environment. | |
| 905 hydrogen_env = hydrogen_env->Copy(); | |
| 906 hydrogen_env->Push(hydrogen_val); | |
| 907 } else { | |
| 908 // Although we don't need this lazy bailout for normal execution | |
| 909 // (because when we tail call from the outermost function we should pop | |
| 910 // its frame) we still need it when debugger is on. | |
| 911 hydrogen_env = current_block_->last_environment(); | |
| 912 } | |
| 913 } else { | |
| 914 if (hydrogen_val->HasObservableSideEffects()) { | |
| 915 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); | |
| 916 sim->ReplayEnvironment(hydrogen_env); | |
| 917 hydrogen_value_for_lazy_bailout = sim; | |
| 918 } | |
| 919 } | |
| 920 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( | |
| 921 new (zone()) LLazyBailout(), hydrogen_env); | |
| 922 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); | |
| 923 chunk_->AddInstruction(bailout, current_block_); | |
| 924 } | |
| 925 } | 890 } |
| 926 | 891 |
| 927 | 892 |
| 928 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { | 893 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { |
| 929 LInstruction* result = new (zone()) LPrologue(); | 894 LInstruction* result = new (zone()) LPrologue(); |
| 930 if (info_->scope()->num_heap_slots() > 0) { | 895 if (info_->scope()->num_heap_slots() > 0) { |
| 931 result = MarkAsCall(result, instr); | 896 result = MarkAsCall(result, instr); |
| 932 } | 897 } |
| 933 return result; | 898 return result; |
| 934 } | 899 } |
| (...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2527 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2492 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2528 LOperand* object = UseRegister(instr->object()); | 2493 LOperand* object = UseRegister(instr->object()); |
| 2529 LOperand* index = UseTempRegister(instr->index()); | 2494 LOperand* index = UseTempRegister(instr->index()); |
| 2530 LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index); | 2495 LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index); |
| 2531 LInstruction* result = DefineSameAsFirst(load); | 2496 LInstruction* result = DefineSameAsFirst(load); |
| 2532 return AssignPointerMap(result); | 2497 return AssignPointerMap(result); |
| 2533 } | 2498 } |
| 2534 | 2499 |
| 2535 } // namespace internal | 2500 } // namespace internal |
| 2536 } // namespace v8 | 2501 } // namespace v8 |
| OLD | NEW |