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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/lithium-inl.h" | 10 #include "src/lithium-inl.h" |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 926 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
927 instr = AssignPointerMap(instr); | 927 instr = AssignPointerMap(instr); |
928 } | 928 } |
929 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 929 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
930 instr = AssignEnvironment(instr); | 930 instr = AssignEnvironment(instr); |
931 } | 931 } |
932 chunk_->AddInstruction(instr, current_block_); | 932 chunk_->AddInstruction(instr, current_block_); |
933 | 933 |
934 if (instr->IsCall()) { | 934 if (instr->IsCall()) { |
935 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; | 935 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; |
936 LInstruction* instruction_needing_environment = NULL; | |
937 if (hydrogen_val->HasObservableSideEffects()) { | 936 if (hydrogen_val->HasObservableSideEffects()) { |
938 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); | 937 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); |
939 instruction_needing_environment = instr; | |
940 sim->ReplayEnvironment(current_block_->last_environment()); | 938 sim->ReplayEnvironment(current_block_->last_environment()); |
941 hydrogen_value_for_lazy_bailout = sim; | 939 hydrogen_value_for_lazy_bailout = sim; |
942 } | 940 } |
943 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout()); | 941 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout()); |
944 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); | 942 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); |
945 chunk_->AddInstruction(bailout, current_block_); | 943 chunk_->AddInstruction(bailout, current_block_); |
946 if (instruction_needing_environment != NULL) { | |
947 // Store the lazy deopt environment with the instruction if needed. | |
948 // Right now it is only used for LInstanceOfKnownGlobal. | |
949 instruction_needing_environment-> | |
950 SetDeferredLazyDeoptimizationEnvironment(bailout->environment()); | |
951 } | |
952 } | 944 } |
953 } | 945 } |
954 | 946 |
955 | 947 |
956 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { | 948 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { |
957 return new(zone()) LGoto(instr->FirstSuccessor()); | 949 return new(zone()) LGoto(instr->FirstSuccessor()); |
958 } | 950 } |
959 | 951 |
960 | 952 |
961 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { | 953 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { |
(...skipping 30 matching lines...) Expand all Loading... |
992 } | 984 } |
993 | 985 |
994 | 986 |
995 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { | 987 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { |
996 info()->MarkAsRequiresFrame(); | 988 info()->MarkAsRequiresFrame(); |
997 return DefineAsRegister(new(zone()) LArgumentsElements); | 989 return DefineAsRegister(new(zone()) LArgumentsElements); |
998 } | 990 } |
999 | 991 |
1000 | 992 |
1001 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { | 993 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { |
| 994 LOperand* left = |
| 995 UseFixed(instr->left(), InstanceOfDescriptor::LeftRegister()); |
| 996 LOperand* right = |
| 997 UseFixed(instr->right(), InstanceOfDescriptor::RightRegister()); |
1002 LOperand* context = UseFixed(instr->context(), cp); | 998 LOperand* context = UseFixed(instr->context(), cp); |
1003 LInstanceOf* result = | 999 LInstanceOf* result = new (zone()) LInstanceOf(context, left, right); |
1004 new(zone()) LInstanceOf(context, UseFixed(instr->left(), a0), | |
1005 UseFixed(instr->right(), a1)); | |
1006 return MarkAsCall(DefineFixed(result, v0), instr); | 1000 return MarkAsCall(DefineFixed(result, v0), instr); |
1007 } | 1001 } |
1008 | 1002 |
1009 | 1003 |
1010 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( | 1004 LInstruction* LChunkBuilder::DoHasInPrototypeChainAndBranch( |
1011 HInstanceOfKnownGlobal* instr) { | 1005 HHasInPrototypeChainAndBranch* instr) { |
1012 LInstanceOfKnownGlobal* result = | 1006 LOperand* object = UseRegister(instr->object()); |
1013 new(zone()) LInstanceOfKnownGlobal( | 1007 LOperand* prototype = UseRegister(instr->prototype()); |
1014 UseFixed(instr->context(), cp), | 1008 return new (zone()) LHasInPrototypeChainAndBranch(object, prototype); |
1015 UseFixed(instr->left(), a0), | |
1016 FixedTemp(a4)); | |
1017 return MarkAsCall(DefineFixed(result, v0), instr); | |
1018 } | 1009 } |
1019 | 1010 |
1020 | 1011 |
1021 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 1012 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
1022 LOperand* receiver = UseRegisterAtStart(instr->receiver()); | 1013 LOperand* receiver = UseRegisterAtStart(instr->receiver()); |
1023 LOperand* function = UseRegisterAtStart(instr->function()); | 1014 LOperand* function = UseRegisterAtStart(instr->function()); |
1024 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); | 1015 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); |
1025 return AssignEnvironment(DefineAsRegister(result)); | 1016 return AssignEnvironment(DefineAsRegister(result)); |
1026 } | 1017 } |
1027 | 1018 |
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2671 LAllocateBlockContext* result = | 2662 LAllocateBlockContext* result = |
2672 new(zone()) LAllocateBlockContext(context, function); | 2663 new(zone()) LAllocateBlockContext(context, function); |
2673 return MarkAsCall(DefineFixed(result, cp), instr); | 2664 return MarkAsCall(DefineFixed(result, cp), instr); |
2674 } | 2665 } |
2675 | 2666 |
2676 | 2667 |
2677 } // namespace internal | 2668 } // namespace internal |
2678 } // namespace v8 | 2669 } // namespace v8 |
2679 | 2670 |
2680 #endif // V8_TARGET_ARCH_MIPS64 | 2671 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |