| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 kFunctionContextSpecializing = 1 << 8, | 57 kFunctionContextSpecializing = 1 << 8, |
| 58 kFrameSpecializing = 1 << 9, | 58 kFrameSpecializing = 1 << 9, |
| 59 kNativeContextSpecializing = 1 << 10, | 59 kNativeContextSpecializing = 1 << 10, |
| 60 kInliningEnabled = 1 << 11, | 60 kInliningEnabled = 1 << 11, |
| 61 kTypingEnabled = 1 << 12, | 61 kTypingEnabled = 1 << 12, |
| 62 kDisableFutureOptimization = 1 << 13, | 62 kDisableFutureOptimization = 1 << 13, |
| 63 kSplittingEnabled = 1 << 14, | 63 kSplittingEnabled = 1 << 14, |
| 64 kDeoptimizationEnabled = 1 << 16, | 64 kDeoptimizationEnabled = 1 << 16, |
| 65 kSourcePositionsEnabled = 1 << 17, | 65 kSourcePositionsEnabled = 1 << 17, |
| 66 kFirstCompile = 1 << 18, | 66 kFirstCompile = 1 << 18, |
| 67 kBailoutOnUninitialized = 1 << 19, |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 explicit CompilationInfo(ParseInfo* parse_info); | 70 explicit CompilationInfo(ParseInfo* parse_info); |
| 70 CompilationInfo(const char* debug_name, Isolate* isolate, Zone* zone, | 71 CompilationInfo(const char* debug_name, Isolate* isolate, Zone* zone, |
| 71 Code::Flags code_flags = Code::ComputeFlags(Code::STUB)); | 72 Code::Flags code_flags = Code::ComputeFlags(Code::STUB)); |
| 72 virtual ~CompilationInfo(); | 73 virtual ~CompilationInfo(); |
| 73 | 74 |
| 74 ParseInfo* parse_info() const { return parse_info_; } | 75 ParseInfo* parse_info() const { return parse_info_; } |
| 75 | 76 |
| 76 // ----------------------------------------------------------- | 77 // ----------------------------------------------------------- |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void MarkAsSplittingEnabled() { SetFlag(kSplittingEnabled); } | 201 void MarkAsSplittingEnabled() { SetFlag(kSplittingEnabled); } |
| 201 | 202 |
| 202 bool is_splitting_enabled() const { return GetFlag(kSplittingEnabled); } | 203 bool is_splitting_enabled() const { return GetFlag(kSplittingEnabled); } |
| 203 | 204 |
| 204 void MarkAsFirstCompile() { SetFlag(kFirstCompile); } | 205 void MarkAsFirstCompile() { SetFlag(kFirstCompile); } |
| 205 | 206 |
| 206 void MarkAsCompiled() { SetFlag(kFirstCompile, false); } | 207 void MarkAsCompiled() { SetFlag(kFirstCompile, false); } |
| 207 | 208 |
| 208 bool is_first_compile() const { return GetFlag(kFirstCompile); } | 209 bool is_first_compile() const { return GetFlag(kFirstCompile); } |
| 209 | 210 |
| 211 void MarkAsBailoutOnUninitialized() { SetFlag(kBailoutOnUninitialized); } |
| 212 |
| 213 bool is_bailout_on_uninitialized() const { |
| 214 return GetFlag(kBailoutOnUninitialized); |
| 215 } |
| 216 |
| 210 bool GeneratePreagedPrologue() const { | 217 bool GeneratePreagedPrologue() const { |
| 211 // Generate a pre-aged prologue if we are optimizing for size, which | 218 // Generate a pre-aged prologue if we are optimizing for size, which |
| 212 // will make code flushing more aggressive. Only apply to Code::FUNCTION, | 219 // will make code flushing more aggressive. Only apply to Code::FUNCTION, |
| 213 // since StaticMarkingVisitor::IsFlushable only flushes proper functions. | 220 // since StaticMarkingVisitor::IsFlushable only flushes proper functions. |
| 214 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && | 221 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && |
| 215 !is_debug() && output_code_kind() == Code::FUNCTION; | 222 !is_debug() && output_code_kind() == Code::FUNCTION; |
| 216 } | 223 } |
| 217 | 224 |
| 218 void EnsureFeedbackVector(); | 225 void EnsureFeedbackVector(); |
| 219 Handle<TypeFeedbackVector> feedback_vector() const { | 226 Handle<TypeFeedbackVector> feedback_vector() const { |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 size_t info_zone_start_allocation_size_; | 672 size_t info_zone_start_allocation_size_; |
| 666 base::ElapsedTimer timer_; | 673 base::ElapsedTimer timer_; |
| 667 | 674 |
| 668 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 675 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
| 669 }; | 676 }; |
| 670 | 677 |
| 671 } // namespace internal | 678 } // namespace internal |
| 672 } // namespace v8 | 679 } // namespace v8 |
| 673 | 680 |
| 674 #endif // V8_COMPILER_H_ | 681 #endif // V8_COMPILER_H_ |
| OLD | NEW |