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/zone.h" | 10 #include "src/zone.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 kNative = 1 << 5, | 72 kNative = 1 << 5, |
73 kDeferredCalling = 1 << 6, | 73 kDeferredCalling = 1 << 6, |
74 kNonDeferredCalling = 1 << 7, | 74 kNonDeferredCalling = 1 << 7, |
75 kSavesCallerDoubles = 1 << 8, | 75 kSavesCallerDoubles = 1 << 8, |
76 kRequiresFrame = 1 << 9, | 76 kRequiresFrame = 1 << 9, |
77 kMustNotHaveEagerFrame = 1 << 10, | 77 kMustNotHaveEagerFrame = 1 << 10, |
78 kDeoptimizationSupport = 1 << 11, | 78 kDeoptimizationSupport = 1 << 11, |
79 kDebug = 1 << 12, | 79 kDebug = 1 << 12, |
80 kCompilingForDebugging = 1 << 13, | 80 kCompilingForDebugging = 1 << 13, |
81 kParseRestriction = 1 << 14, | 81 kParseRestriction = 1 << 14, |
82 kSerializing = 1 << 15 | 82 kSerializing = 1 << 15, |
| 83 kContextSpecializing = 1 << 16 |
83 }; | 84 }; |
84 | 85 |
85 CompilationInfo(Handle<JSFunction> closure, Zone* zone); | 86 CompilationInfo(Handle<JSFunction> closure, Zone* zone); |
86 CompilationInfo(Isolate* isolate, Zone* zone); | 87 CompilationInfo(Isolate* isolate, Zone* zone); |
87 virtual ~CompilationInfo(); | 88 virtual ~CompilationInfo(); |
88 | 89 |
89 Isolate* isolate() const { | 90 Isolate* isolate() const { |
90 return isolate_; | 91 return isolate_; |
91 } | 92 } |
92 Zone* zone() { return zone_; } | 93 Zone* zone() { return zone_; } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 175 } |
175 | 176 |
176 void MarkAsDebug() { SetFlag(kDebug); } | 177 void MarkAsDebug() { SetFlag(kDebug); } |
177 | 178 |
178 bool is_debug() const { return GetFlag(kDebug); } | 179 bool is_debug() const { return GetFlag(kDebug); } |
179 | 180 |
180 void PrepareForSerializing() { SetFlag(kSerializing); } | 181 void PrepareForSerializing() { SetFlag(kSerializing); } |
181 | 182 |
182 bool will_serialize() const { return GetFlag(kSerializing); } | 183 bool will_serialize() const { return GetFlag(kSerializing); } |
183 | 184 |
| 185 void MarkAsContextSpecializing() { SetFlag(kContextSpecializing); } |
| 186 |
| 187 bool is_context_specializing() const { return GetFlag(kContextSpecializing); } |
| 188 |
184 bool IsCodePreAgingActive() const { | 189 bool IsCodePreAgingActive() const { |
185 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && | 190 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && |
186 !is_debug(); | 191 !is_debug(); |
187 } | 192 } |
188 | 193 |
189 void SetParseRestriction(ParseRestriction restriction) { | 194 void SetParseRestriction(ParseRestriction restriction) { |
190 SetFlag(kParseRestriction, restriction != NO_PARSE_RESTRICTION); | 195 SetFlag(kParseRestriction, restriction != NO_PARSE_RESTRICTION); |
191 } | 196 } |
192 | 197 |
193 ParseRestriction parse_restriction() const { | 198 ParseRestriction parse_restriction() const { |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 Zone zone_; | 702 Zone zone_; |
698 unsigned info_zone_start_allocation_size_; | 703 unsigned info_zone_start_allocation_size_; |
699 base::ElapsedTimer timer_; | 704 base::ElapsedTimer timer_; |
700 | 705 |
701 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 706 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
702 }; | 707 }; |
703 | 708 |
704 } } // namespace v8::internal | 709 } } // namespace v8::internal |
705 | 710 |
706 #endif // V8_COMPILER_H_ | 711 #endif // V8_COMPILER_H_ |
OLD | NEW |