| 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/arm/lithium-arm.h" | 5 #include "src/crankshaft/arm/lithium-arm.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/crankshaft/arm/lithium-codegen-arm.h" | 9 #include "src/crankshaft/arm/lithium-codegen-arm.h" |
| 10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 539 |
| 540 | 540 |
| 541 LInstruction* LChunkBuilder::DefineFixedDouble( | 541 LInstruction* LChunkBuilder::DefineFixedDouble( |
| 542 LTemplateResultInstruction<1>* instr, DoubleRegister reg) { | 542 LTemplateResultInstruction<1>* instr, DoubleRegister reg) { |
| 543 return Define(instr, ToUnallocated(reg)); | 543 return Define(instr, ToUnallocated(reg)); |
| 544 } | 544 } |
| 545 | 545 |
| 546 | 546 |
| 547 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { | 547 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { |
| 548 HEnvironment* hydrogen_env = current_block_->last_environment(); | 548 HEnvironment* hydrogen_env = current_block_->last_environment(); |
| 549 return LChunkBuilderBase::AssignEnvironment(instr, hydrogen_env); | 549 int argument_index_accumulator = 0; |
| 550 ZoneList<HValue*> objects_to_materialize(0, zone()); |
| 551 instr->set_environment(CreateEnvironment(hydrogen_env, |
| 552 &argument_index_accumulator, |
| 553 &objects_to_materialize)); |
| 554 return instr; |
| 550 } | 555 } |
| 551 | 556 |
| 552 | 557 |
| 553 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, | 558 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, |
| 554 HInstruction* hinstr, | 559 HInstruction* hinstr, |
| 555 CanDeoptimize can_deoptimize) { | 560 CanDeoptimize can_deoptimize) { |
| 556 info()->MarkAsNonDeferredCalling(); | 561 info()->MarkAsNonDeferredCalling(); |
| 557 #ifdef DEBUG | 562 #ifdef DEBUG |
| 558 instr->VerifyCall(); | 563 instr->VerifyCall(); |
| 559 #endif | 564 #endif |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 | 870 |
| 866 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 871 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
| 867 instr = AssignPointerMap(instr); | 872 instr = AssignPointerMap(instr); |
| 868 } | 873 } |
| 869 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 874 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
| 870 instr = AssignEnvironment(instr); | 875 instr = AssignEnvironment(instr); |
| 871 } | 876 } |
| 872 chunk_->AddInstruction(instr, current_block_); | 877 chunk_->AddInstruction(instr, current_block_); |
| 873 | 878 |
| 874 if (instr->IsCall()) { | 879 if (instr->IsCall()) { |
| 875 HEnvironment* hydrogen_env = current_block_->last_environment(); | |
| 876 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; | 880 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; |
| 877 DCHECK_NOT_NULL(hydrogen_env); | 881 if (hydrogen_val->HasObservableSideEffects()) { |
| 878 if (instr->IsTailCall()) { | 882 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); |
| 879 hydrogen_env = hydrogen_env->outer(); | 883 sim->ReplayEnvironment(current_block_->last_environment()); |
| 880 if (hydrogen_env != nullptr && | 884 hydrogen_value_for_lazy_bailout = sim; |
| 881 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) { | |
| 882 hydrogen_env = hydrogen_env->outer(); | |
| 883 } | |
| 884 } else { | |
| 885 if (hydrogen_val->HasObservableSideEffects()) { | |
| 886 HSimulate* sim = HSimulate::cast(hydrogen_val->next()); | |
| 887 sim->ReplayEnvironment(hydrogen_env); | |
| 888 hydrogen_value_for_lazy_bailout = sim; | |
| 889 } | |
| 890 } | 885 } |
| 891 if (hydrogen_env != nullptr) { | 886 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout()); |
| 892 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( | 887 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); |
| 893 new (zone()) LLazyBailout(), hydrogen_env); | 888 chunk_->AddInstruction(bailout, current_block_); |
| 894 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); | |
| 895 chunk_->AddInstruction(bailout, current_block_); | |
| 896 } | |
| 897 } | 889 } |
| 898 } | 890 } |
| 899 | 891 |
| 900 | 892 |
| 901 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { | 893 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { |
| 902 LInstruction* result = new (zone()) LPrologue(); | 894 LInstruction* result = new (zone()) LPrologue(); |
| 903 if (info_->num_heap_slots() > 0) { | 895 if (info_->num_heap_slots() > 0) { |
| 904 result = MarkAsCall(result, instr); | 896 result = MarkAsCall(result, instr); |
| 905 } | 897 } |
| 906 return result; | 898 return result; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 i < instr->OperandCount(); i++) { | 1058 i < instr->OperandCount(); i++) { |
| 1067 op = | 1059 op = |
| 1068 UseFixed(instr->OperandAt(i), | 1060 UseFixed(instr->OperandAt(i), |
| 1069 descriptor.GetRegisterParameter( | 1061 descriptor.GetRegisterParameter( |
| 1070 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); | 1062 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); |
| 1071 ops.Add(op, zone()); | 1063 ops.Add(op, zone()); |
| 1072 } | 1064 } |
| 1073 | 1065 |
| 1074 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 1066 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |
| 1075 descriptor, ops, zone()); | 1067 descriptor, ops, zone()); |
| 1076 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { | |
| 1077 result->MarkAsTailCall(); | |
| 1078 } | |
| 1079 return MarkAsCall(DefineFixed(result, r0), instr); | 1068 return MarkAsCall(DefineFixed(result, r0), instr); |
| 1080 } | 1069 } |
| 1081 | 1070 |
| 1082 | 1071 |
| 1083 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1072 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
| 1084 LOperand* context = UseFixed(instr->context(), cp); | 1073 LOperand* context = UseFixed(instr->context(), cp); |
| 1085 LOperand* function = UseFixed(instr->function(), r1); | 1074 LOperand* function = UseFixed(instr->function(), r1); |
| 1086 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); | 1075 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); |
| 1087 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { | |
| 1088 result->MarkAsTailCall(); | |
| 1089 } | |
| 1090 return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1076 return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
| 1091 } | 1077 } |
| 1092 | 1078 |
| 1093 | 1079 |
| 1094 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1080 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1095 switch (instr->op()) { | 1081 switch (instr->op()) { |
| 1096 case kMathFloor: | 1082 case kMathFloor: |
| 1097 return DoMathFloor(instr); | 1083 return DoMathFloor(instr); |
| 1098 case kMathRound: | 1084 case kMathRound: |
| 1099 return DoMathRound(instr); | 1085 return DoMathRound(instr); |
| (...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2561 } | 2547 } |
| 2562 | 2548 |
| 2563 | 2549 |
| 2564 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { | 2550 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { |
| 2565 LOperand* context = UseRegisterAtStart(instr->context()); | 2551 LOperand* context = UseRegisterAtStart(instr->context()); |
| 2566 return new(zone()) LStoreFrameContext(context); | 2552 return new(zone()) LStoreFrameContext(context); |
| 2567 } | 2553 } |
| 2568 | 2554 |
| 2569 } // namespace internal | 2555 } // namespace internal |
| 2570 } // namespace v8 | 2556 } // namespace v8 |
| OLD | NEW |