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

Side by Side Diff: src/compiler.h

Issue 9187005: Enable optimization of top-level code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: fixed problem with eval code, addressed comments Created 8 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 | Annotate | Revision Log
« no previous file with comments | « src/ast.h ('k') | src/compiler.cc » ('j') | src/compiler.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution. 11 // with the distribution.
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 // Deoptimization support. 157 // Deoptimization support.
158 bool HasDeoptimizationSupport() const { 158 bool HasDeoptimizationSupport() const {
159 return SupportsDeoptimization::decode(flags_); 159 return SupportsDeoptimization::decode(flags_);
160 } 160 }
161 void EnableDeoptimizationSupport() { 161 void EnableDeoptimizationSupport() {
162 ASSERT(IsOptimizable()); 162 ASSERT(IsOptimizable());
163 flags_ |= SupportsDeoptimization::encode(true); 163 flags_ |= SupportsDeoptimization::encode(true);
164 } 164 }
165 165
166 // Determine whether or not we can adaptively optimize.
167 bool AllowOptimize() {
168 return V8::UseCrankshaft() && !closure_.is_null();
169 }
170
171 // Determines whether or not to insert a self-optimization header. 166 // Determines whether or not to insert a self-optimization header.
172 bool ShouldSelfOptimize(); 167 bool ShouldSelfOptimize();
173 168
174 // Disable all optimization attempts of this info for the rest of the 169 // Disable all optimization attempts of this info for the rest of the
175 // current compilation pipeline. 170 // current compilation pipeline.
176 void AbortOptimization(); 171 void AbortOptimization();
177 172
178 private: 173 private:
179 Isolate* isolate_; 174 Isolate* isolate_;
180 175
181 // Compilation mode. 176 // Compilation mode.
182 // BASE is generated by the full codegen, optionally prepared for bailouts. 177 // BASE is generated by the full codegen, optionally prepared for bailouts.
183 // OPTIMIZE is optimized code generated by the Hydrogen-based backend. 178 // OPTIMIZE is optimized code generated by the Hydrogen-based backend.
184 // NONOPT is generated by the full codegen or the classic backend 179 // NONOPT is generated by the full codegen and is not prepared for
185 // and is not prepared for recompilation/bailouts. These functions 180 // recompilation/bailouts. These functions are never recompiled.
186 // are never recompiled.
187 enum Mode { 181 enum Mode {
188 BASE, 182 BASE,
189 OPTIMIZE, 183 OPTIMIZE,
190 NONOPT 184 NONOPT
191 }; 185 };
192 186
193 CompilationInfo() : function_(NULL) {} 187 CompilationInfo() : function_(NULL) {}
194 188
195 void Initialize(Mode mode) { 189 void Initialize(Mode mode) {
196 mode_ = V8::UseCrankshaft() ? mode : NONOPT; 190 mode_ = V8::UseCrankshaft() ? mode : NONOPT;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 322
329 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, 323 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
330 CompilationInfo* info, 324 CompilationInfo* info,
331 Handle<SharedFunctionInfo> shared); 325 Handle<SharedFunctionInfo> shared);
332 }; 326 };
333 327
334 328
335 } } // namespace v8::internal 329 } } // namespace v8::internal
336 330
337 #endif // V8_COMPILER_H_ 331 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/compiler.cc » ('j') | src/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698