OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_H_ | 5 #ifndef V8_COMPILER_H_ |
6 #define V8_COMPILER_H_ | 6 #define V8_COMPILER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 kFunctionContextSpecializing = 1 << 8, | 153 kFunctionContextSpecializing = 1 << 8, |
154 kFrameSpecializing = 1 << 9, | 154 kFrameSpecializing = 1 << 9, |
155 kNativeContextSpecializing = 1 << 10, | 155 kNativeContextSpecializing = 1 << 10, |
156 kInliningEnabled = 1 << 11, | 156 kInliningEnabled = 1 << 11, |
157 kDisableFutureOptimization = 1 << 12, | 157 kDisableFutureOptimization = 1 << 12, |
158 kSplittingEnabled = 1 << 13, | 158 kSplittingEnabled = 1 << 13, |
159 kDeoptimizationEnabled = 1 << 14, | 159 kDeoptimizationEnabled = 1 << 14, |
160 kSourcePositionsEnabled = 1 << 15, | 160 kSourcePositionsEnabled = 1 << 15, |
161 kEffectSchedulingEnabled = 1 << 16, | 161 kEffectSchedulingEnabled = 1 << 16, |
162 kBailoutOnUninitialized = 1 << 17, | 162 kBailoutOnUninitialized = 1 << 17, |
| 163 kOptimizeFromBytecode = 1 << 18, |
163 }; | 164 }; |
164 | 165 |
165 CompilationInfo(ParseInfo* parse_info, Handle<JSFunction> closure); | 166 CompilationInfo(ParseInfo* parse_info, Handle<JSFunction> closure); |
166 CompilationInfo(const char* debug_name, Isolate* isolate, Zone* zone, | 167 CompilationInfo(const char* debug_name, Isolate* isolate, Zone* zone, |
167 Code::Flags code_flags = Code::ComputeFlags(Code::STUB)); | 168 Code::Flags code_flags = Code::ComputeFlags(Code::STUB)); |
168 virtual ~CompilationInfo(); | 169 virtual ~CompilationInfo(); |
169 | 170 |
170 ParseInfo* parse_info() const { return parse_info_; } | 171 ParseInfo* parse_info() const { return parse_info_; } |
171 | 172 |
172 // ----------------------------------------------------------- | 173 // ----------------------------------------------------------- |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 void MarkAsSplittingEnabled() { SetFlag(kSplittingEnabled); } | 298 void MarkAsSplittingEnabled() { SetFlag(kSplittingEnabled); } |
298 | 299 |
299 bool is_splitting_enabled() const { return GetFlag(kSplittingEnabled); } | 300 bool is_splitting_enabled() const { return GetFlag(kSplittingEnabled); } |
300 | 301 |
301 void MarkAsBailoutOnUninitialized() { SetFlag(kBailoutOnUninitialized); } | 302 void MarkAsBailoutOnUninitialized() { SetFlag(kBailoutOnUninitialized); } |
302 | 303 |
303 bool is_bailout_on_uninitialized() const { | 304 bool is_bailout_on_uninitialized() const { |
304 return GetFlag(kBailoutOnUninitialized); | 305 return GetFlag(kBailoutOnUninitialized); |
305 } | 306 } |
306 | 307 |
| 308 void MarkAsOptimizeFromBytecode() { SetFlag(kOptimizeFromBytecode); } |
| 309 |
| 310 bool is_optimizing_from_bytecode() const { |
| 311 return GetFlag(kOptimizeFromBytecode); |
| 312 } |
| 313 |
307 bool GeneratePreagedPrologue() const { | 314 bool GeneratePreagedPrologue() const { |
308 // Generate a pre-aged prologue if we are optimizing for size, which | 315 // Generate a pre-aged prologue if we are optimizing for size, which |
309 // will make code flushing more aggressive. Only apply to Code::FUNCTION, | 316 // will make code flushing more aggressive. Only apply to Code::FUNCTION, |
310 // since StaticMarkingVisitor::IsFlushable only flushes proper functions. | 317 // since StaticMarkingVisitor::IsFlushable only flushes proper functions. |
311 return FLAG_optimize_for_size && FLAG_age_code && !is_debug() && | 318 return FLAG_optimize_for_size && FLAG_age_code && !is_debug() && |
312 output_code_kind() == Code::FUNCTION; | 319 output_code_kind() == Code::FUNCTION; |
313 } | 320 } |
314 | 321 |
315 void SetCode(Handle<Code> code) { code_ = code; } | 322 void SetCode(Handle<Code> code) { code_ = code; } |
316 | 323 |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 MUST_USE_RESULT Status SetLastStatus(Status status) { | 630 MUST_USE_RESULT Status SetLastStatus(Status status) { |
624 last_status_ = status; | 631 last_status_ = status; |
625 return last_status_; | 632 return last_status_; |
626 } | 633 } |
627 }; | 634 }; |
628 | 635 |
629 } // namespace internal | 636 } // namespace internal |
630 } // namespace v8 | 637 } // namespace v8 |
631 | 638 |
632 #endif // V8_COMPILER_H_ | 639 #endif // V8_COMPILER_H_ |
OLD | NEW |