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

Side by Side Diff: src/compiler/arm/code-generator-arm.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.h ('k') | src/compiler/arm64/code-generator-arm64.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 6
7 #include "src/arm/macro-assembler-arm.h" 7 #include "src/arm/macro-assembler-arm.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
11 #include "src/compiler/osr.h"
12 #include "src/scopes.h" 11 #include "src/scopes.h"
13 12
14 namespace v8 { 13 namespace v8 {
15 namespace internal { 14 namespace internal {
16 namespace compiler { 15 namespace compiler {
17 16
18 #define __ masm()-> 17 #define __ masm()->
19 18
20 19
21 #define kScratchReg r9 20 #define kScratchReg r9
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 if (info()->is_osr()) { 799 if (info()->is_osr()) {
801 // TurboFan OSR-compiled functions cannot be entered directly. 800 // TurboFan OSR-compiled functions cannot be entered directly.
802 __ Abort(kShouldNotDirectlyEnterOsrFunction); 801 __ Abort(kShouldNotDirectlyEnterOsrFunction);
803 802
804 // Unoptimized code jumps directly to this entrypoint while the unoptimized 803 // Unoptimized code jumps directly to this entrypoint while the unoptimized
805 // frame is still on the stack. Optimized code uses OSR values directly from 804 // frame is still on the stack. Optimized code uses OSR values directly from
806 // the unoptimized frame. Thus, all that needs to be done is to allocate the 805 // the unoptimized frame. Thus, all that needs to be done is to allocate the
807 // remaining stack slots. 806 // remaining stack slots.
808 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); 807 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
809 osr_pc_offset_ = __ pc_offset(); 808 osr_pc_offset_ = __ pc_offset();
810 int unoptimized_slots = 809 DCHECK(stack_slots >= frame()->GetOsrStackSlotCount());
811 static_cast<int>(OsrHelper(info()).UnoptimizedFrameSlots()); 810 stack_slots -= frame()->GetOsrStackSlotCount();
812 DCHECK(stack_slots >= unoptimized_slots);
813 stack_slots -= unoptimized_slots;
814 } 811 }
815 812
816 if (stack_slots > 0) { 813 if (stack_slots > 0) {
817 __ sub(sp, sp, Operand(stack_slots * kPointerSize)); 814 __ sub(sp, sp, Operand(stack_slots * kPointerSize));
818 } 815 }
819 } 816 }
820 817
821 818
822 void CodeGenerator::AssembleReturn() { 819 void CodeGenerator::AssembleReturn() {
823 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); 820 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 } 1032 }
1036 } 1033 }
1037 MarkLazyDeoptSite(); 1034 MarkLazyDeoptSite();
1038 } 1035 }
1039 1036
1040 #undef __ 1037 #undef __
1041 1038
1042 } // namespace compiler 1039 } // namespace compiler
1043 } // namespace internal 1040 } // namespace internal
1044 } // namespace v8 1041 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/compiler/arm64/code-generator-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698