Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: src/crankshaft/mips/lithium-mips.cc

Issue 1814433002: Revert of [crankshaft] Fixing ES6 tail call elimination. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/crankshaft/mips/lithium-mips.h ('k') | src/crankshaft/mips64/lithium-mips64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/mips/lithium-mips.h" 5 #include "src/crankshaft/mips/lithium-mips.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2511 2497
2512 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { 2498 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) {
2513 LOperand* context = UseRegisterAtStart(instr->context()); 2499 LOperand* context = UseRegisterAtStart(instr->context());
2514 return new(zone()) LStoreFrameContext(context); 2500 return new(zone()) LStoreFrameContext(context);
2515 } 2501 }
2516 2502
2517 } // namespace internal 2503 } // namespace internal
2518 } // namespace v8 2504 } // namespace v8
2519 2505
2520 #endif // V8_TARGET_ARCH_MIPS 2506 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/crankshaft/mips/lithium-mips.h ('k') | src/crankshaft/mips64/lithium-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698