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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 kInliningEnabled = 1 << 18, | 90 kInliningEnabled = 1 << 18, |
91 kTypingEnabled = 1 << 19, | 91 kTypingEnabled = 1 << 19, |
92 kDisableFutureOptimization = 1 << 20, | 92 kDisableFutureOptimization = 1 << 20, |
93 kModule = 1 << 21, | 93 kModule = 1 << 21, |
94 kToplevel = 1 << 22, | 94 kToplevel = 1 << 22, |
95 kSplittingEnabled = 1 << 23 | 95 kSplittingEnabled = 1 << 23 |
96 }; | 96 }; |
97 | 97 |
98 CompilationInfo(Handle<JSFunction> closure, Zone* zone); | 98 CompilationInfo(Handle<JSFunction> closure, Zone* zone); |
99 CompilationInfo(Handle<Script> script, Zone* zone); | 99 CompilationInfo(Handle<Script> script, Zone* zone); |
100 CompilationInfo(Isolate* isolate, Zone* zone); | 100 CompilationInfo(CodeStub* stub, Isolate* isolate, Zone* zone); |
101 virtual ~CompilationInfo(); | 101 virtual ~CompilationInfo(); |
102 | 102 |
103 Isolate* isolate() const { | 103 Isolate* isolate() const { |
104 return isolate_; | 104 return isolate_; |
105 } | 105 } |
106 Zone* zone() { return zone_; } | 106 Zone* zone() { return zone_; } |
107 bool is_osr() const { return !osr_ast_id_.IsNone(); } | 107 bool is_osr() const { return !osr_ast_id_.IsNone(); } |
108 bool is_lazy() const { return GetFlag(kLazy); } | 108 bool is_lazy() const { return GetFlag(kLazy); } |
109 bool is_eval() const { return GetFlag(kEval); } | 109 bool is_eval() const { return GetFlag(kEval); } |
110 bool is_global() const { return GetFlag(kGlobal); } | 110 bool is_global() const { return GetFlag(kGlobal); } |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 osr_expr_stack_height_ = height; | 420 osr_expr_stack_height_ = height; |
421 } | 421 } |
422 | 422 |
423 #if DEBUG | 423 #if DEBUG |
424 void PrintAstForTesting(); | 424 void PrintAstForTesting(); |
425 #endif | 425 #endif |
426 | 426 |
427 protected: | 427 protected: |
428 CompilationInfo(Handle<SharedFunctionInfo> shared_info, | 428 CompilationInfo(Handle<SharedFunctionInfo> shared_info, |
429 Zone* zone); | 429 Zone* zone); |
430 CompilationInfo(CodeStub* stub, Isolate* isolate, Zone* zone); | |
431 CompilationInfo(ScriptCompiler::ExternalSourceStream* source_stream, | 430 CompilationInfo(ScriptCompiler::ExternalSourceStream* source_stream, |
432 ScriptCompiler::StreamedSource::Encoding encoding, | 431 ScriptCompiler::StreamedSource::Encoding encoding, |
433 Isolate* isolate, Zone* zone); | 432 Isolate* isolate, Zone* zone); |
434 | 433 |
435 | 434 |
436 private: | 435 private: |
437 Isolate* isolate_; | 436 Isolate* isolate_; |
438 | 437 |
439 // Compilation mode. | 438 // Compilation mode. |
440 // BASE is generated by the full codegen, optionally prepared for bailouts. | 439 // BASE is generated by the full codegen, optionally prepared for bailouts. |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 Zone zone_; | 774 Zone zone_; |
776 unsigned info_zone_start_allocation_size_; | 775 unsigned info_zone_start_allocation_size_; |
777 base::ElapsedTimer timer_; | 776 base::ElapsedTimer timer_; |
778 | 777 |
779 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 778 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
780 }; | 779 }; |
781 | 780 |
782 } } // namespace v8::internal | 781 } } // namespace v8::internal |
783 | 782 |
784 #endif // V8_COMPILER_H_ | 783 #endif // V8_COMPILER_H_ |
OLD | NEW |