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

Side by Side Diff: src/compiler/osr.h

Issue 877553007: [turbofan] Gracefully bail out if OSR encounters a loop too deeply nested. (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/bailout-reason.h ('k') | src/compiler/osr.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 #ifndef V8_COMPILER_OSR_H_ 5 #ifndef V8_COMPILER_OSR_H_
6 #define V8_COMPILER_OSR_H_ 6 #define V8_COMPILER_OSR_H_
7 7
8 #include "src/zone.h" 8 #include "src/zone.h"
9 9
10 // TurboFan structures OSR graphs in a way that separates almost all phases of 10 // TurboFan structures OSR graphs in a way that separates almost all phases of
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 class OsrHelper { 92 class OsrHelper {
93 public: 93 public:
94 explicit OsrHelper(CompilationInfo* info); 94 explicit OsrHelper(CompilationInfo* info);
95 // Only for testing. 95 // Only for testing.
96 OsrHelper(size_t parameter_count, size_t stack_slot_count) 96 OsrHelper(size_t parameter_count, size_t stack_slot_count)
97 : parameter_count_(parameter_count), 97 : parameter_count_(parameter_count),
98 stack_slot_count_(stack_slot_count) {} 98 stack_slot_count_(stack_slot_count) {}
99 99
100 // Deconstructs the artificial {OsrNormalEntry} and rewrites the graph so 100 // Deconstructs the artificial {OsrNormalEntry} and rewrites the graph so
101 // that only the path corresponding to {OsrLoopEntry} remains. 101 // that only the path corresponding to {OsrLoopEntry} remains.
102 void Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common, 102 // Return {false} if the OSR deconstruction failed somehow.
103 bool Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
103 Zone* tmp_zone); 104 Zone* tmp_zone);
104 105
105 // Prepares the frame w.r.t. OSR. 106 // Prepares the frame w.r.t. OSR.
106 void SetupFrame(Frame* frame); 107 void SetupFrame(Frame* frame);
107 108
108 // Returns the number of unoptimized frame slots for this OSR. 109 // Returns the number of unoptimized frame slots for this OSR.
109 size_t UnoptimizedFrameSlots() { return stack_slot_count_; } 110 size_t UnoptimizedFrameSlots() { return stack_slot_count_; }
110 111
111 // Returns the environment index of the first stack slot. 112 // Returns the environment index of the first stack slot.
112 static int FirstStackSlotIndex(int parameter_count) { 113 static int FirstStackSlotIndex(int parameter_count) {
113 // n.b. unlike Crankshaft, TurboFan environments do not contain the context. 114 // n.b. unlike Crankshaft, TurboFan environments do not contain the context.
114 return 1 + parameter_count; // receiver + params 115 return 1 + parameter_count; // receiver + params
115 } 116 }
116 117
117 private: 118 private:
118 size_t parameter_count_; 119 size_t parameter_count_;
119 size_t stack_slot_count_; 120 size_t stack_slot_count_;
120 }; 121 };
121 122
122 } // namespace compiler 123 } // namespace compiler
123 } // namespace internal 124 } // namespace internal
124 } // namespace v8 125 } // namespace v8
125 126
126 #endif // V8_COMPILER_OSR_H_ 127 #endif // V8_COMPILER_OSR_H_
OLDNEW
« no previous file with comments | « src/bailout-reason.h ('k') | src/compiler/osr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698