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

Side by Side Diff: src/crankshaft/arm64/lithium-arm64.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/arm64/lithium-arm64.h ('k') | src/crankshaft/hydrogen.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/arm64/lithium-arm64.h" 5 #include "src/crankshaft/arm64/lithium-arm64.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" 9 #include "src/crankshaft/arm64/lithium-codegen-arm64.h"
10 #include "src/crankshaft/hydrogen-osr.h" 10 #include "src/crankshaft/hydrogen-osr.h"
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 708
709 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { 709 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
710 instr = AssignPointerMap(instr); 710 instr = AssignPointerMap(instr);
711 } 711 }
712 if (FLAG_stress_environments && !instr->HasEnvironment()) { 712 if (FLAG_stress_environments && !instr->HasEnvironment()) {
713 instr = AssignEnvironment(instr); 713 instr = AssignEnvironment(instr);
714 } 714 }
715 chunk_->AddInstruction(instr, current_block_); 715 chunk_->AddInstruction(instr, current_block_);
716 716
717 if (instr->IsCall()) { 717 if (instr->IsCall()) {
718 HEnvironment* hydrogen_env = current_block_->last_environment();
719 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val; 718 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
720 DCHECK_NOT_NULL(hydrogen_env); 719 if (hydrogen_val->HasObservableSideEffects()) {
721 if (instr->IsTailCall()) { 720 HSimulate* sim = HSimulate::cast(hydrogen_val->next());
722 hydrogen_env = hydrogen_env->outer(); 721 sim->ReplayEnvironment(current_block_->last_environment());
723 if (hydrogen_env != nullptr && 722 hydrogen_value_for_lazy_bailout = sim;
724 hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) {
725 hydrogen_env = hydrogen_env->outer();
726 }
727 } else {
728 if (hydrogen_val->HasObservableSideEffects()) {
729 HSimulate* sim = HSimulate::cast(hydrogen_val->next());
730 sim->ReplayEnvironment(hydrogen_env);
731 hydrogen_value_for_lazy_bailout = sim;
732 }
733 } 723 }
734 if (hydrogen_env != nullptr) { 724 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout());
735 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( 725 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
736 new (zone()) LLazyBailout(), hydrogen_env); 726 chunk_->AddInstruction(bailout, current_block_);
737 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
738 chunk_->AddInstruction(bailout, current_block_);
739 }
740 } 727 }
741 } 728 }
742 729
743 730
744 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { 731 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
745 HEnvironment* hydrogen_env = current_block_->last_environment(); 732 HEnvironment* hydrogen_env = current_block_->last_environment();
746 return LChunkBuilderBase::AssignEnvironment(instr, hydrogen_env); 733 int argument_index_accumulator = 0;
734 ZoneList<HValue*> objects_to_materialize(0, zone());
735 instr->set_environment(CreateEnvironment(hydrogen_env,
736 &argument_index_accumulator,
737 &objects_to_materialize));
738 return instr;
747 } 739 }
748 740
749 741
750 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { 742 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
751 LInstruction* result = new (zone()) LPrologue(); 743 LInstruction* result = new (zone()) LPrologue();
752 if (info_->num_heap_slots() > 0) { 744 if (info_->num_heap_slots() > 0) {
753 result = MarkAsCall(result, instr); 745 result = MarkAsCall(result, instr);
754 } 746 }
755 return result; 747 return result;
756 } 748 }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 op = 1011 op =
1020 UseFixed(instr->OperandAt(i), 1012 UseFixed(instr->OperandAt(i),
1021 descriptor.GetRegisterParameter( 1013 descriptor.GetRegisterParameter(
1022 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); 1014 i - LCallWithDescriptor::kImplicitRegisterParameterCount));
1023 ops.Add(op, zone()); 1015 ops.Add(op, zone());
1024 } 1016 }
1025 1017
1026 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(descriptor, 1018 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(descriptor,
1027 ops, 1019 ops,
1028 zone()); 1020 zone());
1029 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) {
1030 result->MarkAsTailCall();
1031 }
1032 return MarkAsCall(DefineFixed(result, x0), instr); 1021 return MarkAsCall(DefineFixed(result, x0), instr);
1033 } 1022 }
1034 1023
1035 1024
1036 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) { 1025 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) {
1037 LOperand* context = UseFixed(instr->context(), cp); 1026 LOperand* context = UseFixed(instr->context(), cp);
1038 // The call to ArrayConstructCode will expect the constructor to be in x1. 1027 // The call to ArrayConstructCode will expect the constructor to be in x1.
1039 LOperand* constructor = UseFixed(instr->constructor(), x1); 1028 LOperand* constructor = UseFixed(instr->constructor(), x1);
1040 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); 1029 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor);
1041 return MarkAsCall(DefineFixed(result, x0), instr); 1030 return MarkAsCall(DefineFixed(result, x0), instr);
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 LHasInPrototypeChainAndBranch(object, prototype, scratch1, scratch2); 1503 LHasInPrototypeChainAndBranch(object, prototype, scratch1, scratch2);
1515 return AssignEnvironment(result); 1504 return AssignEnvironment(result);
1516 } 1505 }
1517 1506
1518 1507
1519 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { 1508 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) {
1520 LOperand* context = UseFixed(instr->context(), cp); 1509 LOperand* context = UseFixed(instr->context(), cp);
1521 // The function is required (by MacroAssembler::InvokeFunction) to be in x1. 1510 // The function is required (by MacroAssembler::InvokeFunction) to be in x1.
1522 LOperand* function = UseFixed(instr->function(), x1); 1511 LOperand* function = UseFixed(instr->function(), x1);
1523 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); 1512 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function);
1524 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) {
1525 result->MarkAsTailCall();
1526 }
1527 return MarkAsCall(DefineFixed(result, x0), instr, CANNOT_DEOPTIMIZE_EAGERLY); 1513 return MarkAsCall(DefineFixed(result, x0), instr, CANNOT_DEOPTIMIZE_EAGERLY);
1528 } 1514 }
1529 1515
1530 1516
1531 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { 1517 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) {
1532 DCHECK(instr->value()->representation().IsTagged()); 1518 DCHECK(instr->value()->representation().IsTagged());
1533 LOperand* value = UseRegisterAtStart(instr->value()); 1519 LOperand* value = UseRegisterAtStart(instr->value());
1534 LOperand* temp = TempRegister(); 1520 LOperand* temp = TempRegister();
1535 return new(zone()) LIsStringAndBranch(value, temp); 1521 return new(zone()) LIsStringAndBranch(value, temp);
1536 } 1522 }
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 2640
2655 2641
2656 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { 2642 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) {
2657 LOperand* context = UseRegisterAtStart(instr->context()); 2643 LOperand* context = UseRegisterAtStart(instr->context());
2658 return new(zone()) LStoreFrameContext(context); 2644 return new(zone()) LStoreFrameContext(context);
2659 } 2645 }
2660 2646
2661 2647
2662 } // namespace internal 2648 } // namespace internal
2663 } // namespace v8 2649 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/arm64/lithium-arm64.h ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698