| 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 kTypeFeedbackEnabled = 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, | |
| 55 kAccessorInliningEnabled = 1 << 19, | |
| 56 }; | 54 }; |
| 57 | 55 |
| 58 CompilationInfo(ParseInfo* parse_info, Handle<JSFunction> closure); | 56 CompilationInfo(ParseInfo* parse_info, Handle<JSFunction> closure); |
| 59 CompilationInfo(Vector<const char> debug_name, Isolate* isolate, Zone* zone, | 57 CompilationInfo(Vector<const char> debug_name, Isolate* isolate, Zone* zone, |
| 60 Code::Flags code_flags); | 58 Code::Flags code_flags); |
| 61 ~CompilationInfo(); | 59 ~CompilationInfo(); |
| 62 | 60 |
| 63 ParseInfo* parse_info() const { return parse_info_; } | 61 ParseInfo* parse_info() const { return parse_info_; } |
| 64 | 62 |
| 65 // ----------------------------------------------------------- | 63 // ----------------------------------------------------------- |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 void MarkMustNotHaveEagerFrame() { SetFlag(kMustNotHaveEagerFrame); } | 113 void MarkMustNotHaveEagerFrame() { SetFlag(kMustNotHaveEagerFrame); } |
| 116 | 114 |
| 117 bool GetMustNotHaveEagerFrame() const { | 115 bool GetMustNotHaveEagerFrame() const { |
| 118 return GetFlag(kMustNotHaveEagerFrame); | 116 return GetFlag(kMustNotHaveEagerFrame); |
| 119 } | 117 } |
| 120 | 118 |
| 121 // Compiles marked as debug produce unoptimized code with debug break slots. | 119 // Compiles marked as debug produce unoptimized code with debug break slots. |
| 122 // Inner functions that cannot be compiled w/o context are compiled eagerly. | 120 // Inner functions that cannot be compiled w/o context are compiled eagerly. |
| 123 // Always include deoptimization support to avoid having to recompile again. | 121 // Always include deoptimization support to avoid having to recompile again. |
| 124 void MarkAsDebug() { | 122 void MarkAsDebug() { |
| 125 SetFlag(kDebug); | 123 set_is_debug(); |
| 126 SetFlag(kDeoptimizationSupport); | 124 SetFlag(kDeoptimizationSupport); |
| 127 } | 125 } |
| 128 | 126 |
| 129 bool is_debug() const { return GetFlag(kDebug); } | 127 bool is_debug() const; |
| 130 | 128 |
| 131 void PrepareForSerializing() { SetFlag(kSerializing); } | 129 void PrepareForSerializing() { set_will_serialize(); } |
| 132 | 130 |
| 133 bool will_serialize() const { return GetFlag(kSerializing); } | 131 bool will_serialize() const; |
| 134 | 132 |
| 135 void MarkAsFunctionContextSpecializing() { | 133 void MarkAsFunctionContextSpecializing() { |
| 136 SetFlag(kFunctionContextSpecializing); | 134 SetFlag(kFunctionContextSpecializing); |
| 137 } | 135 } |
| 138 | 136 |
| 139 bool is_function_context_specializing() const { | 137 bool is_function_context_specializing() const { |
| 140 return GetFlag(kFunctionContextSpecializing); | 138 return GetFlag(kFunctionContextSpecializing); |
| 141 } | 139 } |
| 142 | 140 |
| 143 void MarkAsFrameSpecializing() { SetFlag(kFrameSpecializing); } | 141 void MarkAsFrameSpecializing() { SetFlag(kFrameSpecializing); } |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 void SetMode(Mode mode) { mode_ = mode; } | 337 void SetMode(Mode mode) { mode_ = mode; } |
| 340 | 338 |
| 341 void SetFlag(Flag flag) { flags_ |= flag; } | 339 void SetFlag(Flag flag) { flags_ |= flag; } |
| 342 | 340 |
| 343 void SetFlag(Flag flag, bool value) { | 341 void SetFlag(Flag flag, bool value) { |
| 344 flags_ = value ? flags_ | flag : flags_ & ~flag; | 342 flags_ = value ? flags_ | flag : flags_ & ~flag; |
| 345 } | 343 } |
| 346 | 344 |
| 347 bool GetFlag(Flag flag) const { return (flags_ & flag) != 0; } | 345 bool GetFlag(Flag flag) const { return (flags_ & flag) != 0; } |
| 348 | 346 |
| 347 void set_is_debug(); |
| 348 void set_will_serialize(); |
| 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 |