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 19 matching lines...) Expand all Loading... |
30 // is constructed based on the resources available at compile-time. | 30 // is constructed based on the resources available at compile-time. |
31 class CompilationInfo final { | 31 class CompilationInfo final { |
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 kDeoptimizationSupport = 1 << 4, |
41 kDeoptimizationSupport = 1 << 5, | 41 kAccessorInliningEnabled = 1 << 5, |
42 kAccessorInliningEnabled = 1 << 6, | 42 kSerializing = 1 << 6, |
43 kSerializing = 1 << 7, | 43 kFunctionContextSpecializing = 1 << 7, |
44 kFunctionContextSpecializing = 1 << 8, | 44 kFrameSpecializing = 1 << 8, |
45 kFrameSpecializing = 1 << 9, | 45 kInliningEnabled = 1 << 9, |
46 kInliningEnabled = 1 << 10, | 46 kDisableFutureOptimization = 1 << 10, |
47 kDisableFutureOptimization = 1 << 11, | 47 kSplittingEnabled = 1 << 11, |
48 kSplittingEnabled = 1 << 12, | 48 kDeoptimizationEnabled = 1 << 12, |
49 kDeoptimizationEnabled = 1 << 13, | 49 kSourcePositionsEnabled = 1 << 13, |
50 kSourcePositionsEnabled = 1 << 14, | 50 kBailoutOnUninitialized = 1 << 14, |
51 kBailoutOnUninitialized = 1 << 15, | 51 kOptimizeFromBytecode = 1 << 15, |
52 kOptimizeFromBytecode = 1 << 16, | 52 kTypeFeedbackEnabled = 1 << 16, |
53 kTypeFeedbackEnabled = 1 << 17, | |
54 }; | 53 }; |
55 | 54 |
56 CompilationInfo(ParseInfo* parse_info, Handle<JSFunction> closure); | 55 CompilationInfo(ParseInfo* parse_info, Handle<JSFunction> closure); |
57 CompilationInfo(Vector<const char> debug_name, Isolate* isolate, Zone* zone, | 56 CompilationInfo(Vector<const char> debug_name, Isolate* isolate, Zone* zone, |
58 Code::Flags code_flags); | 57 Code::Flags code_flags); |
59 ~CompilationInfo(); | 58 ~CompilationInfo(); |
60 | 59 |
61 ParseInfo* parse_info() const { return parse_info_; } | 60 ParseInfo* parse_info() const { return parse_info_; } |
62 | 61 |
63 // ----------------------------------------------------------- | 62 // ----------------------------------------------------------- |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 bool is_non_deferred_calling() const { return GetFlag(kNonDeferredCalling); } | 102 bool is_non_deferred_calling() const { return GetFlag(kNonDeferredCalling); } |
104 | 103 |
105 void MarkAsSavesCallerDoubles() { SetFlag(kSavesCallerDoubles); } | 104 void MarkAsSavesCallerDoubles() { SetFlag(kSavesCallerDoubles); } |
106 | 105 |
107 bool saves_caller_doubles() const { return GetFlag(kSavesCallerDoubles); } | 106 bool saves_caller_doubles() const { return GetFlag(kSavesCallerDoubles); } |
108 | 107 |
109 void MarkAsRequiresFrame() { SetFlag(kRequiresFrame); } | 108 void MarkAsRequiresFrame() { SetFlag(kRequiresFrame); } |
110 | 109 |
111 bool requires_frame() const { return GetFlag(kRequiresFrame); } | 110 bool requires_frame() const { return GetFlag(kRequiresFrame); } |
112 | 111 |
113 void MarkMustNotHaveEagerFrame() { SetFlag(kMustNotHaveEagerFrame); } | |
114 | |
115 bool GetMustNotHaveEagerFrame() const { | |
116 return GetFlag(kMustNotHaveEagerFrame); | |
117 } | |
118 | |
119 // Compiles marked as debug produce unoptimized code with debug break slots. | 112 // Compiles marked as debug produce unoptimized code with debug break slots. |
120 // Inner functions that cannot be compiled w/o context are compiled eagerly. | 113 // Inner functions that cannot be compiled w/o context are compiled eagerly. |
121 // Always include deoptimization support to avoid having to recompile again. | 114 // Always include deoptimization support to avoid having to recompile again. |
122 void MarkAsDebug() { | 115 void MarkAsDebug() { |
123 set_is_debug(); | 116 set_is_debug(); |
124 SetFlag(kDeoptimizationSupport); | 117 SetFlag(kDeoptimizationSupport); |
125 } | 118 } |
126 | 119 |
127 bool is_debug() const; | 120 bool is_debug() const; |
128 | 121 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 376 |
384 Vector<const char> debug_name_; | 377 Vector<const char> debug_name_; |
385 | 378 |
386 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); | 379 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
387 }; | 380 }; |
388 | 381 |
389 } // namespace internal | 382 } // namespace internal |
390 } // namespace v8 | 383 } // namespace v8 |
391 | 384 |
392 #endif // V8_COMPILATION_INFO_H_ | 385 #endif // V8_COMPILATION_INFO_H_ |
OLD | NEW |