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

Side by Side Diff: src/compiler/mips/code-generator-mips.cc

Issue 890903002: [turbofan] Fix OSR into functions where the expression stack is not empty. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/mips64/code-generator-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 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/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 #include "src/compiler/code-generator-impl.h" 6 #include "src/compiler/code-generator-impl.h"
7 #include "src/compiler/gap-resolver.h" 7 #include "src/compiler/gap-resolver.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/osr.h"
10 #include "src/mips/macro-assembler-mips.h" 9 #include "src/mips/macro-assembler-mips.h"
11 #include "src/scopes.h" 10 #include "src/scopes.h"
12 11
13 namespace v8 { 12 namespace v8 {
14 namespace internal { 13 namespace internal {
15 namespace compiler { 14 namespace compiler {
16 15
17 #define __ masm()-> 16 #define __ masm()->
18 17
19 18
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 if (info()->is_osr()) { 908 if (info()->is_osr()) {
910 // TurboFan OSR-compiled functions cannot be entered directly. 909 // TurboFan OSR-compiled functions cannot be entered directly.
911 __ Abort(kShouldNotDirectlyEnterOsrFunction); 910 __ Abort(kShouldNotDirectlyEnterOsrFunction);
912 911
913 // Unoptimized code jumps directly to this entrypoint while the unoptimized 912 // Unoptimized code jumps directly to this entrypoint while the unoptimized
914 // frame is still on the stack. Optimized code uses OSR values directly from 913 // frame is still on the stack. Optimized code uses OSR values directly from
915 // the unoptimized frame. Thus, all that needs to be done is to allocate the 914 // the unoptimized frame. Thus, all that needs to be done is to allocate the
916 // remaining stack slots. 915 // remaining stack slots.
917 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); 916 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
918 osr_pc_offset_ = __ pc_offset(); 917 osr_pc_offset_ = __ pc_offset();
919 int unoptimized_slots = 918 DCHECK(stack_slots >= frame()->GetOsrStackSlotCount());
920 static_cast<int>(OsrHelper(info()).UnoptimizedFrameSlots()); 919 stack_slots -= frame()->GetOsrStackSlotCount();
921 DCHECK(stack_slots >= unoptimized_slots);
922 stack_slots -= unoptimized_slots;
923 } 920 }
924 921
925 if (stack_slots > 0) { 922 if (stack_slots > 0) {
926 __ Subu(sp, sp, Operand(stack_slots * kPointerSize)); 923 __ Subu(sp, sp, Operand(stack_slots * kPointerSize));
927 } 924 }
928 } 925 }
929 926
930 927
931 void CodeGenerator::AssembleReturn() { 928 void CodeGenerator::AssembleReturn() {
932 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); 929 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 } 1143 }
1147 } 1144 }
1148 MarkLazyDeoptSite(); 1145 MarkLazyDeoptSite();
1149 } 1146 }
1150 1147
1151 #undef __ 1148 #undef __
1152 1149
1153 } // namespace compiler 1150 } // namespace compiler
1154 } // namespace internal 1151 } // namespace internal
1155 } // namespace v8 1152 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698