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

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

Issue 1936043002: [es6] Properly handle the case when an inlined getter/setter/constructor does a tail call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed too much, fixing Created 4 years, 7 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/ppc/lithium-ppc.cc ('k') | src/crankshaft/x64/lithium-x64.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/s390/lithium-s390.h" 5 #include "src/crankshaft/s390/lithium-s390.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/crankshaft/hydrogen-osr.h" 9 #include "src/crankshaft/hydrogen-osr.h"
10 #include "src/crankshaft/lithium-inl.h" 10 #include "src/crankshaft/lithium-inl.h"
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 #endif 803 #endif
804 804
805 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { 805 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
806 instr = AssignPointerMap(instr); 806 instr = AssignPointerMap(instr);
807 } 807 }
808 if (FLAG_stress_environments && !instr->HasEnvironment()) { 808 if (FLAG_stress_environments && !instr->HasEnvironment()) {
809 instr = AssignEnvironment(instr); 809 instr = AssignEnvironment(instr);
810 } 810 }
811 chunk_->AddInstruction(instr, current_block_); 811 chunk_->AddInstruction(instr, current_block_);
812 812
813 if (instr->IsCall()) { 813 CreateLazyBailoutForCall(current_block_, instr, hydrogen_val);
814 HEnvironment* hydrogen_env = current_block_->last_environment();
815 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
816 DCHECK_NOT_NULL(hydrogen_env);
817 if (instr->IsSyntacticTailCall()) {
818 // If it was a syntactic tail call we need to drop the current frame and
819 // all the frames on top of it that are either an arguments adaptor frame
820 // or a tail caller frame.
821 hydrogen_env = hydrogen_env->outer();
822 while (hydrogen_env != nullptr &&
823 (hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR ||
824 hydrogen_env->frame_type() == TAIL_CALLER_FUNCTION)) {
825 hydrogen_env = hydrogen_env->outer();
826 }
827 if (hydrogen_env != nullptr) {
828 // Push return value on top of outer environment.
829 hydrogen_env = hydrogen_env->Copy();
830 hydrogen_env->Push(hydrogen_val);
831 } else {
832 // Although we don't need this lazy bailout for normal execution
833 // (because when we tail call from the outermost function we should pop
834 // its frame) we still need it when debugger is on.
835 hydrogen_env = current_block_->last_environment();
836 }
837 } else {
838 if (hydrogen_val->HasObservableSideEffects()) {
839 HSimulate* sim = HSimulate::cast(hydrogen_val->next());
840 sim->ReplayEnvironment(hydrogen_env);
841 hydrogen_value_for_lazy_bailout = sim;
842 }
843 }
844 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment(
845 new (zone()) LLazyBailout(), hydrogen_env);
846 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
847 chunk_->AddInstruction(bailout, current_block_);
848 }
849 } 814 }
850 815
851 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { 816 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
852 LInstruction* result = new (zone()) LPrologue(); 817 LInstruction* result = new (zone()) LPrologue();
853 if (info_->scope()->num_heap_slots() > 0) { 818 if (info_->scope()->num_heap_slots() > 0) {
854 result = MarkAsCall(result, instr); 819 result = MarkAsCall(result, instr);
855 } 820 }
856 return result; 821 return result;
857 } 822 }
858 823
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2281 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2317 LOperand* object = UseRegister(instr->object()); 2282 LOperand* object = UseRegister(instr->object());
2318 LOperand* index = UseTempRegister(instr->index()); 2283 LOperand* index = UseTempRegister(instr->index());
2319 LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index); 2284 LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index);
2320 LInstruction* result = DefineSameAsFirst(load); 2285 LInstruction* result = DefineSameAsFirst(load);
2321 return AssignPointerMap(result); 2286 return AssignPointerMap(result);
2322 } 2287 }
2323 2288
2324 } // namespace internal 2289 } // namespace internal
2325 } // namespace v8 2290 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ppc/lithium-ppc.cc ('k') | src/crankshaft/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698