| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 | 546 |
| 547 | 547 |
| 548 LInstruction* LChunkBuilder::DefineFixedDouble( | 548 LInstruction* LChunkBuilder::DefineFixedDouble( |
| 549 LTemplateResultInstruction<1>* instr, DoubleRegister reg) { | 549 LTemplateResultInstruction<1>* instr, DoubleRegister reg) { |
| 550 return Define(instr, ToUnallocated(reg)); | 550 return Define(instr, ToUnallocated(reg)); |
| 551 } | 551 } |
| 552 | 552 |
| 553 | 553 |
| 554 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { | 554 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { |
| 555 HEnvironment* hydrogen_env = current_block_->last_environment(); | 555 HEnvironment* hydrogen_env = current_block_->last_environment(); |
| 556 return LChunkBuilderBase::AssignEnvironment(instr, hydrogen_env); | 556 int argument_index_accumulator = 0; |
| 557 ZoneList<HValue*> objects_to_materialize(0, zone()); |
| 558 instr->set_environment(CreateEnvironment(hydrogen_env, |
| 559 &argument_index_accumulator, |
| 560 &objects_to_materialize)); |
| 561 return instr; |
| 557 } | 562 } |
| 558 | 563 |
| 559 | 564 |
| 560 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, | 565 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, |
| 561 HInstruction* hinstr, | 566 HInstruction* hinstr, |
| 562 CanDeoptimize can_deoptimize) { | 567 CanDeoptimize can_deoptimize) { |
| 563 info()->MarkAsNonDeferredCalling(); | 568 info()->MarkAsNonDeferredCalling(); |
| 564 #ifdef DEBUG | 569 #ifdef DEBUG |
| 565 instr->VerifyCall(); | 570 instr->VerifyCall(); |
| 566 #endif | 571 #endif |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 | 880 |
| 876 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 881 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
| 877 instr = AssignPointerMap(instr); | 882 instr = AssignPointerMap(instr); |
| 878 } | 883 } |
| 879 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 884 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
| 880 instr = AssignEnvironment(instr); | 885 instr = AssignEnvironment(instr); |
| 881 } | 886 } |
| 882 chunk_->AddInstruction(instr, current_block_); | 887 chunk_->AddInstruction(instr, current_block_); |
| 883 | 888 |
| 884 if (instr->IsCall()) { | 889 if (instr->IsCall()) { |
| 885 HEnvironment* hydrogen_env = current_block_->last_environment(); | |
| 886 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; | 890 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; |
| 887 DCHECK_NOT_NULL(hydrogen_env); | 891 if (hydrogen_val->HasObservableSideEffects()) { |
| 888 if (instr->IsTailCall()) { | 892 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); |
| 889 hydrogen_env = hydrogen_env->outer(); | 893 sim->ReplayEnvironment(current_block_->last_environment()); |
| 890 if (hydrogen_env != nullptr && | 894 hydrogen_value_for_lazy_bailout = sim; |
| 891 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { | |
| 892 hydrogen_env = hydrogen_env->outer(); | |
| 893 } | |
| 894 } else { | |
| 895 if (hydrogen_val->HasObservableSideEffects()) { | |
| 896 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); | |
| 897 sim->ReplayEnvironment(hydrogen_env); | |
| 898 hydrogen_value_for_lazy_bailout = sim; | |
| 899 } | |
| 900 } | 895 } |
| 901 if (hydrogen_env != nullptr) { | 896 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout()); |
| 902 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( | 897 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); |
| 903 new (zone()) LLazyBailout(), hydrogen_env); | 898 chunk_->AddInstruction(bailout, current_block_); |
| 904 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); | |
| 905 chunk_->AddInstruction(bailout, current_block_); | |
| 906 } | |
| 907 } | 899 } |
| 908 } | 900 } |
| 909 | 901 |
| 910 | 902 |
| 911 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { | 903 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { |
| 912 LInstruction* result = new (zone()) LPrologue(); | 904 LInstruction* result = new (zone()) LPrologue(); |
| 913 if (info_->num_heap_slots() > 0) { | 905 if (info_->num_heap_slots() > 0) { |
| 914 result = MarkAsCall(result, instr); | 906 result = MarkAsCall(result, instr); |
| 915 } | 907 } |
| 916 return result; | 908 return result; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 i < instr->OperandCount(); i++) { | 1063 i < instr->OperandCount(); i++) { |
| 1072 op = | 1064 op = |
| 1073 UseFixed(instr->OperandAt(i), | 1065 UseFixed(instr->OperandAt(i), |
| 1074 descriptor.GetRegisterParameter( | 1066 descriptor.GetRegisterParameter( |
| 1075 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); | 1067 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); |
| 1076 ops.Add(op, zone()); | 1068 ops.Add(op, zone()); |
| 1077 } | 1069 } |
| 1078 | 1070 |
| 1079 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 1071 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |
| 1080 descriptor, ops, zone()); | 1072 descriptor, ops, zone()); |
| 1081 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { | |
| 1082 result->MarkAsTailCall(); | |
| 1083 } | |
| 1084 return MarkAsCall(DefineFixed(result, v0), instr); | 1073 return MarkAsCall(DefineFixed(result, v0), instr); |
| 1085 } | 1074 } |
| 1086 | 1075 |
| 1087 | 1076 |
| 1088 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1077 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
| 1089 LOperand* context = UseFixed(instr->context(), cp); | 1078 LOperand* context = UseFixed(instr->context(), cp); |
| 1090 LOperand* function = UseFixed(instr->function(), a1); | 1079 LOperand* function = UseFixed(instr->function(), a1); |
| 1091 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); | 1080 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); |
| 1092 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { | |
| 1093 result->MarkAsTailCall(); | |
| 1094 } | |
| 1095 return MarkAsCall(DefineFixed(result, v0), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1081 return MarkAsCall(DefineFixed(result, v0), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
| 1096 } | 1082 } |
| 1097 | 1083 |
| 1098 | 1084 |
| 1099 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1085 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1100 switch (instr->op()) { | 1086 switch (instr->op()) { |
| 1101 case kMathFloor: | 1087 case kMathFloor: |
| 1102 return DoMathFloor(instr); | 1088 return DoMathFloor(instr); |
| 1103 case kMathRound: | 1089 case kMathRound: |
| 1104 return DoMathRound(instr); | 1090 return DoMathRound(instr); |
| (...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2516 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { | 2502 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { |
| 2517 LOperand* context = UseRegisterAtStart(instr->context()); | 2503 LOperand* context = UseRegisterAtStart(instr->context()); |
| 2518 return new(zone()) LStoreFrameContext(context); | 2504 return new(zone()) LStoreFrameContext(context); |
| 2519 } | 2505 } |
| 2520 | 2506 |
| 2521 | 2507 |
| 2522 } // namespace internal | 2508 } // namespace internal |
| 2523 } // namespace v8 | 2509 } // namespace v8 |
| 2524 | 2510 |
| 2525 #endif // V8_TARGET_ARCH_MIPS64 | 2511 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |