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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/hydrogen-osr.h" | 7 #include "src/hydrogen-osr.h" |
8 #include "src/lithium-inl.h" | 8 #include "src/lithium-inl.h" |
9 #include "src/ppc/lithium-codegen-ppc.h" | 9 #include "src/ppc/lithium-codegen-ppc.h" |
10 | 10 |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 923 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
924 instr = AssignPointerMap(instr); | 924 instr = AssignPointerMap(instr); |
925 } | 925 } |
926 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 926 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
927 instr = AssignEnvironment(instr); | 927 instr = AssignEnvironment(instr); |
928 } | 928 } |
929 chunk_->AddInstruction(instr, current_block_); | 929 chunk_->AddInstruction(instr, current_block_); |
930 | 930 |
931 if (instr->IsCall()) { | 931 if (instr->IsCall()) { |
932 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; | 932 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; |
933 LInstruction* instruction_needing_environment = NULL; | |
934 if (hydrogen_val->HasObservableSideEffects()) { | 933 if (hydrogen_val->HasObservableSideEffects()) { |
935 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); | 934 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); |
936 instruction_needing_environment = instr; | |
937 sim->ReplayEnvironment(current_block_->last_environment()); | 935 sim->ReplayEnvironment(current_block_->last_environment()); |
938 hydrogen_value_for_lazy_bailout = sim; | 936 hydrogen_value_for_lazy_bailout = sim; |
939 } | 937 } |
940 LInstruction* bailout = AssignEnvironment(new (zone()) LLazyBailout()); | 938 LInstruction* bailout = AssignEnvironment(new (zone()) LLazyBailout()); |
941 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); | 939 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); |
942 chunk_->AddInstruction(bailout, current_block_); | 940 chunk_->AddInstruction(bailout, current_block_); |
943 if (instruction_needing_environment != NULL) { | |
944 // Store the lazy deopt environment with the instruction if needed. | |
945 // Right now it is only used for LInstanceOfKnownGlobal. | |
946 instruction_needing_environment->SetDeferredLazyDeoptimizationEnvironment( | |
947 bailout->environment()); | |
948 } | |
949 } | 941 } |
950 } | 942 } |
951 | 943 |
952 | 944 |
953 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { | 945 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { |
954 return new (zone()) LGoto(instr->FirstSuccessor()); | 946 return new (zone()) LGoto(instr->FirstSuccessor()); |
955 } | 947 } |
956 | 948 |
957 | 949 |
958 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { | 950 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 } | 986 } |
995 | 987 |
996 | 988 |
997 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { | 989 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { |
998 info()->MarkAsRequiresFrame(); | 990 info()->MarkAsRequiresFrame(); |
999 return DefineAsRegister(new (zone()) LArgumentsElements); | 991 return DefineAsRegister(new (zone()) LArgumentsElements); |
1000 } | 992 } |
1001 | 993 |
1002 | 994 |
1003 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { | 995 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { |
| 996 LOperand* left = |
| 997 UseFixed(instr->left(), InstanceOfDescriptor::LeftRegister()); |
| 998 LOperand* right = |
| 999 UseFixed(instr->right(), InstanceOfDescriptor::RightRegister()); |
1004 LOperand* context = UseFixed(instr->context(), cp); | 1000 LOperand* context = UseFixed(instr->context(), cp); |
1005 LInstanceOf* result = new (zone()) LInstanceOf( | 1001 LInstanceOf* result = new (zone()) LInstanceOf(context, left, right); |
1006 context, UseFixed(instr->left(), r3), UseFixed(instr->right(), r4)); | |
1007 return MarkAsCall(DefineFixed(result, r3), instr); | 1002 return MarkAsCall(DefineFixed(result, r3), instr); |
1008 } | 1003 } |
1009 | 1004 |
1010 | 1005 |
1011 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( | 1006 LInstruction* LChunkBuilder::DoHasInPrototypeChainAndBranch( |
1012 HInstanceOfKnownGlobal* instr) { | 1007 HHasInPrototypeChainAndBranch* instr) { |
1013 LInstanceOfKnownGlobal* result = new (zone()) | 1008 LOperand* object = UseRegister(instr->object()); |
1014 LInstanceOfKnownGlobal(UseFixed(instr->context(), cp), | 1009 LOperand* prototype = UseRegister(instr->prototype()); |
1015 UseFixed(instr->left(), r3), FixedTemp(r7)); | 1010 return new (zone()) LHasInPrototypeChainAndBranch(object, prototype); |
1016 return MarkAsCall(DefineFixed(result, r3), instr); | |
1017 } | 1011 } |
1018 | 1012 |
1019 | 1013 |
1020 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 1014 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
1021 LOperand* receiver = UseRegisterAtStart(instr->receiver()); | 1015 LOperand* receiver = UseRegisterAtStart(instr->receiver()); |
1022 LOperand* function = UseRegisterAtStart(instr->function()); | 1016 LOperand* function = UseRegisterAtStart(instr->function()); |
1023 LWrapReceiver* result = new (zone()) LWrapReceiver(receiver, function); | 1017 LWrapReceiver* result = new (zone()) LWrapReceiver(receiver, function); |
1024 return AssignEnvironment(DefineAsRegister(result)); | 1018 return AssignEnvironment(DefineAsRegister(result)); |
1025 } | 1019 } |
1026 | 1020 |
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2649 LInstruction* LChunkBuilder::DoAllocateBlockContext( | 2643 LInstruction* LChunkBuilder::DoAllocateBlockContext( |
2650 HAllocateBlockContext* instr) { | 2644 HAllocateBlockContext* instr) { |
2651 LOperand* context = UseFixed(instr->context(), cp); | 2645 LOperand* context = UseFixed(instr->context(), cp); |
2652 LOperand* function = UseRegisterAtStart(instr->function()); | 2646 LOperand* function = UseRegisterAtStart(instr->function()); |
2653 LAllocateBlockContext* result = | 2647 LAllocateBlockContext* result = |
2654 new (zone()) LAllocateBlockContext(context, function); | 2648 new (zone()) LAllocateBlockContext(context, function); |
2655 return MarkAsCall(DefineFixed(result, cp), instr); | 2649 return MarkAsCall(DefineFixed(result, cp), instr); |
2656 } | 2650 } |
2657 } // namespace internal | 2651 } // namespace internal |
2658 } // namespace v8 | 2652 } // namespace v8 |
OLD | NEW |