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

Side by Side Diff: src/crankshaft/mips/lithium-mips.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/lithium.cc ('k') | src/crankshaft/mips64/lithium-mips64.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 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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 #endif 874 #endif
875 875
876 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { 876 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
877 instr = AssignPointerMap(instr); 877 instr = AssignPointerMap(instr);
878 } 878 }
879 if (FLAG_stress_environments && !instr->HasEnvironment()) { 879 if (FLAG_stress_environments && !instr->HasEnvironment()) {
880 instr = AssignEnvironment(instr); 880 instr = AssignEnvironment(instr);
881 } 881 }
882 chunk_->AddInstruction(instr, current_block_); 882 chunk_->AddInstruction(instr, current_block_);
883 883
884 if (instr->IsCall()) { 884 CreateLazyBailoutForCall(current_block_, instr, hydrogen_val);
885 HEnvironment* hydrogen_env = current_block_->last_environment();
886 HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
887 DCHECK_NOT_NULL(hydrogen_env);
888 if (instr->IsSyntacticTailCall()) {
889 // If it was a syntactic tail call we need to drop the current frame and
890 // all the frames on top of it that are either an arguments adaptor frame
891 // or a tail caller frame.
892 hydrogen_env = hydrogen_env->outer();
893 while (hydrogen_env != nullptr &&
894 (hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR ||
895 hydrogen_env->frame_type() == TAIL_CALLER_FUNCTION)) {
896 hydrogen_env = hydrogen_env->outer();
897 }
898 if (hydrogen_env != nullptr) {
899 // Push return value on top of outer environment.
900 hydrogen_env = hydrogen_env->Copy();
901 hydrogen_env->Push(hydrogen_val);
902 } else {
903 // Although we don't need this lazy bailout for normal execution
904 // (because when we tail call from the outermost function we should pop
905 // its frame) we still need it when debugger is on.
906 hydrogen_env = current_block_->last_environment();
907 }
908 } else {
909 if (hydrogen_val->HasObservableSideEffects()) {
910 HSimulate* sim = HSimulate::cast(hydrogen_val->next());
911 sim->ReplayEnvironment(hydrogen_env);
912 hydrogen_value_for_lazy_bailout = sim;
913 }
914 }
915 LInstruction* bailout = LChunkBuilderBase::AssignEnvironment(
916 new (zone()) LLazyBailout(), hydrogen_env);
917 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
918 chunk_->AddInstruction(bailout, current_block_);
919 }
920 } 885 }
921 886
922 887
923 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) { 888 LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
924 LInstruction* result = new (zone()) LPrologue(); 889 LInstruction* result = new (zone()) LPrologue();
925 if (info_->scope()->num_heap_slots() > 0) { 890 if (info_->scope()->num_heap_slots() > 0) {
926 result = MarkAsCall(result, instr); 891 result = MarkAsCall(result, instr);
927 } 892 }
928 return result; 893 return result;
929 } 894 }
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 LOperand* index = UseTempRegister(instr->index()); 2472 LOperand* index = UseTempRegister(instr->index());
2508 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2473 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2509 LInstruction* result = DefineSameAsFirst(load); 2474 LInstruction* result = DefineSameAsFirst(load);
2510 return AssignPointerMap(result); 2475 return AssignPointerMap(result);
2511 } 2476 }
2512 2477
2513 } // namespace internal 2478 } // namespace internal
2514 } // namespace v8 2479 } // namespace v8
2515 2480
2516 #endif // V8_TARGET_ARCH_MIPS 2481 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/crankshaft/lithium.cc ('k') | src/crankshaft/mips64/lithium-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698