| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_COMPILATION_INFO_H_ | 5 #ifndef V8_COMPILATION_INFO_H_ |
| 6 #define V8_COMPILATION_INFO_H_ | 6 #define V8_COMPILATION_INFO_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "src/compilation-dependencies.h" | 10 #include "src/compilation-dependencies.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 public: | 32 public: |
| 33 // Various configuration flags for a compilation, as well as some properties | 33 // Various configuration flags for a compilation, as well as some properties |
| 34 // of the compiled code produced by a compilation. | 34 // of the compiled code produced by a compilation. |
| 35 enum Flag { | 35 enum Flag { |
| 36 kDeferredCalling = 1 << 0, | 36 kDeferredCalling = 1 << 0, |
| 37 kNonDeferredCalling = 1 << 1, | 37 kNonDeferredCalling = 1 << 1, |
| 38 kSavesCallerDoubles = 1 << 2, | 38 kSavesCallerDoubles = 1 << 2, |
| 39 kRequiresFrame = 1 << 3, | 39 kRequiresFrame = 1 << 3, |
| 40 kMustNotHaveEagerFrame = 1 << 4, | 40 kMustNotHaveEagerFrame = 1 << 4, |
| 41 kDeoptimizationSupport = 1 << 5, | 41 kDeoptimizationSupport = 1 << 5, |
| 42 kDebug = 1 << 6, | 42 kAccessorInliningEnabled = 1 << 6, |
| 43 kSerializing = 1 << 7, | 43 kSerializing = 1 << 7, |
| 44 kFunctionContextSpecializing = 1 << 8, | 44 kFunctionContextSpecializing = 1 << 8, |
| 45 kFrameSpecializing = 1 << 9, | 45 kFrameSpecializing = 1 << 9, |
| 46 kNativeContextSpecializing = 1 << 10, | 46 kNativeContextSpecializing = 1 << 10, |
| 47 kInliningEnabled = 1 << 11, | 47 kInliningEnabled = 1 << 11, |
| 48 kDisableFutureOptimization = 1 << 12, | 48 kDisableFutureOptimization = 1 << 12, |
| 49 kSplittingEnabled = 1 << 13, | 49 kSplittingEnabled = 1 << 13, |
| 50 kDeoptimizationEnabled = 1 << 14, | 50 kDeoptimizationEnabled = 1 << 14, |
| 51 kSourcePositionsEnabled = 1 << 15, | 51 kSourcePositionsEnabled = 1 << 15, |
| 52 kBailoutOnUninitialized = 1 << 16, | 52 kBailoutOnUninitialized = 1 << 16, |
| 53 kOptimizeFromBytecode = 1 << 17, | 53 kOptimizeFromBytecode = 1 << 17, |
| 54 kTypeFeedbackEnabled = 1 << 18, | 54 kTypeFeedbackEnabled = 1 << 18, |
| 55 kAccessorInliningEnabled = 1 << 19, | |
| 56 }; | 55 }; |
| 57 | 56 |
| 58 CompilationInfo(ParseInfo* parse_info, Handle<JSFunction> closure); | 57 CompilationInfo(ParseInfo* parse_info, Handle<JSFunction> closure); |
| 59 CompilationInfo(Vector<const char> debug_name, Isolate* isolate, Zone* zone, | 58 CompilationInfo(Vector<const char> debug_name, Isolate* isolate, Zone* zone, |
| 60 Code::Flags code_flags); | 59 Code::Flags code_flags); |
| 61 ~CompilationInfo(); | 60 ~CompilationInfo(); |
| 62 | 61 |
| 63 ParseInfo* parse_info() const { return parse_info_; } | 62 ParseInfo* parse_info() const { return parse_info_; } |
| 64 | 63 |
| 65 // ----------------------------------------------------------- | 64 // ----------------------------------------------------------- |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 void MarkMustNotHaveEagerFrame() { SetFlag(kMustNotHaveEagerFrame); } | 114 void MarkMustNotHaveEagerFrame() { SetFlag(kMustNotHaveEagerFrame); } |
| 116 | 115 |
| 117 bool GetMustNotHaveEagerFrame() const { | 116 bool GetMustNotHaveEagerFrame() const { |
| 118 return GetFlag(kMustNotHaveEagerFrame); | 117 return GetFlag(kMustNotHaveEagerFrame); |
| 119 } | 118 } |
| 120 | 119 |
| 121 // Compiles marked as debug produce unoptimized code with debug break slots. | 120 // Compiles marked as debug produce unoptimized code with debug break slots. |
| 122 // Inner functions that cannot be compiled w/o context are compiled eagerly. | 121 // Inner functions that cannot be compiled w/o context are compiled eagerly. |
| 123 // Always include deoptimization support to avoid having to recompile again. | 122 // Always include deoptimization support to avoid having to recompile again. |
| 124 void MarkAsDebug() { | 123 void MarkAsDebug() { |
| 125 SetFlag(kDebug); | 124 set_is_debug(); |
| 126 SetFlag(kDeoptimizationSupport); | 125 SetFlag(kDeoptimizationSupport); |
| 127 } | 126 } |
| 128 | 127 |
| 129 bool is_debug() const { return GetFlag(kDebug); } | 128 bool is_debug() const; |
| 130 | 129 |
| 131 void PrepareForSerializing() { SetFlag(kSerializing); } | 130 void PrepareForSerializing(); |
| 132 | 131 |
| 133 bool will_serialize() const { return GetFlag(kSerializing); } | 132 bool will_serialize() const { return GetFlag(kSerializing); } |
| 134 | 133 |
| 135 void MarkAsFunctionContextSpecializing() { | 134 void MarkAsFunctionContextSpecializing() { |
| 136 SetFlag(kFunctionContextSpecializing); | 135 SetFlag(kFunctionContextSpecializing); |
| 137 } | 136 } |
| 138 | 137 |
| 139 bool is_function_context_specializing() const { | 138 bool is_function_context_specializing() const { |
| 140 return GetFlag(kFunctionContextSpecializing); | 139 return GetFlag(kFunctionContextSpecializing); |
| 141 } | 140 } |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 void SetMode(Mode mode) { mode_ = mode; } | 338 void SetMode(Mode mode) { mode_ = mode; } |
| 340 | 339 |
| 341 void SetFlag(Flag flag) { flags_ |= flag; } | 340 void SetFlag(Flag flag) { flags_ |= flag; } |
| 342 | 341 |
| 343 void SetFlag(Flag flag, bool value) { | 342 void SetFlag(Flag flag, bool value) { |
| 344 flags_ = value ? flags_ | flag : flags_ & ~flag; | 343 flags_ = value ? flags_ | flag : flags_ & ~flag; |
| 345 } | 344 } |
| 346 | 345 |
| 347 bool GetFlag(Flag flag) const { return (flags_ & flag) != 0; } | 346 bool GetFlag(Flag flag) const { return (flags_ & flag) != 0; } |
| 348 | 347 |
| 348 void set_is_debug(); |
| 349 |
| 349 unsigned flags_; | 350 unsigned flags_; |
| 350 | 351 |
| 351 Code::Flags code_flags_; | 352 Code::Flags code_flags_; |
| 352 | 353 |
| 353 Handle<JSFunction> closure_; | 354 Handle<JSFunction> closure_; |
| 354 | 355 |
| 355 // The compiled code. | 356 // The compiled code. |
| 356 Handle<Code> code_; | 357 Handle<Code> code_; |
| 357 | 358 |
| 358 // Compilation mode flag and whether deoptimization is allowed. | 359 // Compilation mode flag and whether deoptimization is allowed. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 392 |
| 392 Vector<const char> debug_name_; | 393 Vector<const char> debug_name_; |
| 393 | 394 |
| 394 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); | 395 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
| 395 }; | 396 }; |
| 396 | 397 |
| 397 } // namespace internal | 398 } // namespace internal |
| 398 } // namespace v8 | 399 } // namespace v8 |
| 399 | 400 |
| 400 #endif // V8_COMPILATION_INFO_H_ | 401 #endif // V8_COMPILATION_INFO_H_ |
| OLD | NEW |