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.h" | 9 #include "src/ast.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // is constructed based on the resources available at compile-time. | 107 // is constructed based on the resources available at compile-time. |
108 class CompilationInfo { | 108 class CompilationInfo { |
109 public: | 109 public: |
110 // Various configuration flags for a compilation, as well as some properties | 110 // Various configuration flags for a compilation, as well as some properties |
111 // of the compiled code produced by a compilation. | 111 // of the compiled code produced by a compilation. |
112 enum Flag { | 112 enum Flag { |
113 kDeferredCalling = 1 << 0, | 113 kDeferredCalling = 1 << 0, |
114 kNonDeferredCalling = 1 << 1, | 114 kNonDeferredCalling = 1 << 1, |
115 kSavesCallerDoubles = 1 << 2, | 115 kSavesCallerDoubles = 1 << 2, |
116 kRequiresFrame = 1 << 3, | 116 kRequiresFrame = 1 << 3, |
117 kThisHasUses = 1 << 4, | 117 kMustNotHaveEagerFrame = 1 << 4, |
118 kMustNotHaveEagerFrame = 1 << 5, | 118 kDeoptimizationSupport = 1 << 5, |
119 kDeoptimizationSupport = 1 << 6, | 119 kDebug = 1 << 6, |
120 kDebug = 1 << 7, | 120 kCompilingForDebugging = 1 << 7, |
121 kCompilingForDebugging = 1 << 8, | 121 kSerializing = 1 << 8, |
122 kSerializing = 1 << 9, | 122 kContextSpecializing = 1 << 9, |
123 kContextSpecializing = 1 << 10, | 123 kInliningEnabled = 1 << 10, |
124 kInliningEnabled = 1 << 11, | 124 kTypingEnabled = 1 << 11, |
125 kTypingEnabled = 1 << 12, | 125 kDisableFutureOptimization = 1 << 12, |
126 kDisableFutureOptimization = 1 << 13, | 126 kSplittingEnabled = 1 << 13, |
127 kSplittingEnabled = 1 << 14, | 127 kBuiltinInliningEnabled = 1 << 14 |
128 kBuiltinInliningEnabled = 1 << 15 | |
129 }; | 128 }; |
130 | 129 |
131 explicit CompilationInfo(ParseInfo* parse_info); | 130 explicit CompilationInfo(ParseInfo* parse_info); |
132 CompilationInfo(CodeStub* stub, Isolate* isolate, Zone* zone); | 131 CompilationInfo(CodeStub* stub, Isolate* isolate, Zone* zone); |
133 virtual ~CompilationInfo(); | 132 virtual ~CompilationInfo(); |
134 | 133 |
135 ParseInfo* parse_info() const { return parse_info_; } | 134 ParseInfo* parse_info() const { return parse_info_; } |
136 | 135 |
137 // ----------------------------------------------------------- | 136 // ----------------------------------------------------------- |
138 // TODO(titzer): inline and delete accessors of ParseInfo | 137 // TODO(titzer): inline and delete accessors of ParseInfo |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 bool is_non_deferred_calling() const { return GetFlag(kNonDeferredCalling); } | 184 bool is_non_deferred_calling() const { return GetFlag(kNonDeferredCalling); } |
186 | 185 |
187 void MarkAsSavesCallerDoubles() { SetFlag(kSavesCallerDoubles); } | 186 void MarkAsSavesCallerDoubles() { SetFlag(kSavesCallerDoubles); } |
188 | 187 |
189 bool saves_caller_doubles() const { return GetFlag(kSavesCallerDoubles); } | 188 bool saves_caller_doubles() const { return GetFlag(kSavesCallerDoubles); } |
190 | 189 |
191 void MarkAsRequiresFrame() { SetFlag(kRequiresFrame); } | 190 void MarkAsRequiresFrame() { SetFlag(kRequiresFrame); } |
192 | 191 |
193 bool requires_frame() const { return GetFlag(kRequiresFrame); } | 192 bool requires_frame() const { return GetFlag(kRequiresFrame); } |
194 | 193 |
195 void SetThisHasUses(bool val) { SetFlag(kThisHasUses, val); } | |
196 | |
197 bool this_has_uses() const { return GetFlag(kThisHasUses); } | |
198 | |
199 void MarkMustNotHaveEagerFrame() { SetFlag(kMustNotHaveEagerFrame); } | 194 void MarkMustNotHaveEagerFrame() { SetFlag(kMustNotHaveEagerFrame); } |
200 | 195 |
201 bool GetMustNotHaveEagerFrame() const { | 196 bool GetMustNotHaveEagerFrame() const { |
202 return GetFlag(kMustNotHaveEagerFrame); | 197 return GetFlag(kMustNotHaveEagerFrame); |
203 } | 198 } |
204 | 199 |
205 void MarkAsDebug() { SetFlag(kDebug); } | 200 void MarkAsDebug() { SetFlag(kDebug); } |
206 | 201 |
207 bool is_debug() const { return GetFlag(kDebug); } | 202 bool is_debug() const { return GetFlag(kDebug); } |
208 | 203 |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 Zone zone_; | 682 Zone zone_; |
688 size_t info_zone_start_allocation_size_; | 683 size_t info_zone_start_allocation_size_; |
689 base::ElapsedTimer timer_; | 684 base::ElapsedTimer timer_; |
690 | 685 |
691 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 686 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
692 }; | 687 }; |
693 | 688 |
694 } } // namespace v8::internal | 689 } } // namespace v8::internal |
695 | 690 |
696 #endif // V8_COMPILER_H_ | 691 #endif // V8_COMPILER_H_ |
OLD | NEW |