| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 kContextSpecializing = 1 << 16, |
| 84 kInliningEnabled = 1 << 17, | 84 kInliningEnabled = 1 << 17, |
| 85 kTypingEnabled = 1 << 18 | 85 kTypingEnabled = 1 << 18, |
| 86 kToplevel = 1 << 19 |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 CompilationInfo(Handle<JSFunction> closure, Zone* zone); | 89 CompilationInfo(Handle<JSFunction> closure, Zone* zone); |
| 89 CompilationInfo(Isolate* isolate, Zone* zone); | 90 CompilationInfo(Isolate* isolate, Zone* zone); |
| 90 virtual ~CompilationInfo(); | 91 virtual ~CompilationInfo(); |
| 91 | 92 |
| 92 Isolate* isolate() const { | 93 Isolate* isolate() const { |
| 93 return isolate_; | 94 return isolate_; |
| 94 } | 95 } |
| 95 Zone* zone() { return zone_; } | 96 Zone* zone() { return zone_; } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 void MarkAsInliningEnabled() { SetFlag(kInliningEnabled); } | 199 void MarkAsInliningEnabled() { SetFlag(kInliningEnabled); } |
| 199 | 200 |
| 200 void MarkAsInliningDisabled() { SetFlag(kInliningEnabled, false); } | 201 void MarkAsInliningDisabled() { SetFlag(kInliningEnabled, false); } |
| 201 | 202 |
| 202 bool is_inlining_enabled() const { return GetFlag(kInliningEnabled); } | 203 bool is_inlining_enabled() const { return GetFlag(kInliningEnabled); } |
| 203 | 204 |
| 204 void MarkAsTypingEnabled() { SetFlag(kTypingEnabled); } | 205 void MarkAsTypingEnabled() { SetFlag(kTypingEnabled); } |
| 205 | 206 |
| 206 bool is_typing_enabled() const { return GetFlag(kTypingEnabled); } | 207 bool is_typing_enabled() const { return GetFlag(kTypingEnabled); } |
| 207 | 208 |
| 209 void MarkAsToplevel() { SetFlag(kToplevel); } |
| 210 |
| 211 bool is_toplevel() const { return GetFlag(kToplevel); } |
| 212 |
| 208 bool IsCodePreAgingActive() const { | 213 bool IsCodePreAgingActive() const { |
| 209 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && | 214 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && |
| 210 !is_debug(); | 215 !is_debug(); |
| 211 } | 216 } |
| 212 | 217 |
| 213 void SetParseRestriction(ParseRestriction restriction) { | 218 void SetParseRestriction(ParseRestriction restriction) { |
| 214 SetFlag(kParseRestriction, restriction != NO_PARSE_RESTRICTION); | 219 SetFlag(kParseRestriction, restriction != NO_PARSE_RESTRICTION); |
| 215 } | 220 } |
| 216 | 221 |
| 217 ParseRestriction parse_restriction() const { | 222 ParseRestriction parse_restriction() const { |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 Zone zone_; | 742 Zone zone_; |
| 738 unsigned info_zone_start_allocation_size_; | 743 unsigned info_zone_start_allocation_size_; |
| 739 base::ElapsedTimer timer_; | 744 base::ElapsedTimer timer_; |
| 740 | 745 |
| 741 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 746 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
| 742 }; | 747 }; |
| 743 | 748 |
| 744 } } // namespace v8::internal | 749 } } // namespace v8::internal |
| 745 | 750 |
| 746 #endif // V8_COMPILER_H_ | 751 #endif // V8_COMPILER_H_ |
| OLD | NEW |