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

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

Issue 809333002: [turbofan] Implement OSR for outer loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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/arm/code-generator-arm.cc ('k') | src/compiler/ast-graph-builder.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 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/arm64/macro-assembler-arm64.h" 7 #include "src/arm64/macro-assembler-arm64.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/node-properties-inl.h" 11 #include "src/compiler/node-properties-inl.h"
12 #include "src/compiler/osr.h"
12 #include "src/scopes.h" 13 #include "src/scopes.h"
13 14
14 namespace v8 { 15 namespace v8 {
15 namespace internal { 16 namespace internal {
16 namespace compiler { 17 namespace compiler {
17 18
18 #define __ masm()-> 19 #define __ masm()->
19 20
20 21
21 // Adds Arm64-specific methods to convert InstructionOperands. 22 // Adds Arm64-specific methods to convert InstructionOperands.
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 __ Prologue(info->IsCodePreAgingActive()); 970 __ Prologue(info->IsCodePreAgingActive());
970 frame()->SetRegisterSaveAreaSize( 971 frame()->SetRegisterSaveAreaSize(
971 StandardFrameConstants::kFixedFrameSizeFromFp); 972 StandardFrameConstants::kFixedFrameSizeFromFp);
972 } else { 973 } else {
973 __ SetStackPointer(jssp); 974 __ SetStackPointer(jssp);
974 __ StubPrologue(); 975 __ StubPrologue();
975 frame()->SetRegisterSaveAreaSize( 976 frame()->SetRegisterSaveAreaSize(
976 StandardFrameConstants::kFixedFrameSizeFromFp); 977 StandardFrameConstants::kFixedFrameSizeFromFp);
977 } 978 }
978 int stack_slots = frame()->GetSpillSlotCount(); 979 int stack_slots = frame()->GetSpillSlotCount();
980
981 if (info()->is_osr()) {
982 // TurboFan OSR-compiled functions cannot be entered directly.
983 __ Abort(kShouldNotDirectlyEnterOsrFunction);
984
985 // Unoptimized code jumps directly to this entrypoint while the unoptimized
986 // frame is still on the stack. Optimized code uses OSR values directly from
987 // the unoptimized frame. Thus, all that needs to be done is to allocate the
988 // remaining stack slots.
989 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
990 osr_pc_offset_ = __ pc_offset();
991 int unoptimized_slots =
992 static_cast<int>(OsrHelper(info()).UnoptimizedFrameSlots());
993 DCHECK(stack_slots >= unoptimized_slots);
994 stack_slots -= unoptimized_slots;
995 }
996
979 if (stack_slots > 0) { 997 if (stack_slots > 0) {
980 Register sp = __ StackPointer(); 998 Register sp = __ StackPointer();
981 if (!sp.Is(csp)) { 999 if (!sp.Is(csp)) {
982 __ Sub(sp, sp, stack_slots * kPointerSize); 1000 __ Sub(sp, sp, stack_slots * kPointerSize);
983 } 1001 }
984 __ Sub(csp, csp, AlignedStackSlots(stack_slots) * kPointerSize); 1002 __ Sub(csp, csp, AlignedStackSlots(stack_slots) * kPointerSize);
985 } 1003 }
986 } 1004 }
987 1005
988 1006
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 } 1198 }
1181 } 1199 }
1182 MarkLazyDeoptSite(); 1200 MarkLazyDeoptSite();
1183 } 1201 }
1184 1202
1185 #undef __ 1203 #undef __
1186 1204
1187 } // namespace compiler 1205 } // namespace compiler
1188 } // namespace internal 1206 } // namespace internal
1189 } // namespace v8 1207 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm/code-generator-arm.cc ('k') | src/compiler/ast-graph-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698