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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 kParseRestriction = 1 << 14, | 86 kParseRestriction = 1 << 14, |
87 kSerializing = 1 << 15, | 87 kSerializing = 1 << 15, |
88 kContextSpecializing = 1 << 16, | 88 kContextSpecializing = 1 << 16, |
89 kInliningEnabled = 1 << 17, | 89 kInliningEnabled = 1 << 17, |
90 kTypingEnabled = 1 << 18, | 90 kTypingEnabled = 1 << 18, |
91 kDisableFutureOptimization = 1 << 19, | 91 kDisableFutureOptimization = 1 << 19, |
92 kToplevel = 1 << 20 | 92 kToplevel = 1 << 20 |
93 }; | 93 }; |
94 | 94 |
95 CompilationInfo(Handle<JSFunction> closure, Zone* zone); | 95 CompilationInfo(Handle<JSFunction> closure, Zone* zone); |
| 96 CompilationInfo(Handle<Script> script, Zone* zone); |
96 CompilationInfo(Isolate* isolate, Zone* zone); | 97 CompilationInfo(Isolate* isolate, Zone* zone); |
97 virtual ~CompilationInfo(); | 98 virtual ~CompilationInfo(); |
98 | 99 |
99 Isolate* isolate() const { | 100 Isolate* isolate() const { |
100 return isolate_; | 101 return isolate_; |
101 } | 102 } |
102 Zone* zone() { return zone_; } | 103 Zone* zone() { return zone_; } |
103 bool is_osr() const { return !osr_ast_id_.IsNone(); } | 104 bool is_osr() const { return !osr_ast_id_.IsNone(); } |
104 bool is_lazy() const { return GetFlag(kLazy); } | 105 bool is_lazy() const { return GetFlag(kLazy); } |
105 bool is_eval() const { return GetFlag(kEval); } | 106 bool is_eval() const { return GetFlag(kEval); } |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 int optimization_id() const { return optimization_id_; } | 392 int optimization_id() const { return optimization_id_; } |
392 | 393 |
393 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } | 394 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } |
394 void SetAstValueFactory(AstValueFactory* ast_value_factory, | 395 void SetAstValueFactory(AstValueFactory* ast_value_factory, |
395 bool owned = true) { | 396 bool owned = true) { |
396 ast_value_factory_ = ast_value_factory; | 397 ast_value_factory_ = ast_value_factory; |
397 ast_value_factory_owned_ = owned; | 398 ast_value_factory_owned_ = owned; |
398 } | 399 } |
399 | 400 |
400 protected: | 401 protected: |
401 CompilationInfo(Handle<Script> script, | |
402 Zone* zone); | |
403 CompilationInfo(Handle<SharedFunctionInfo> shared_info, | 402 CompilationInfo(Handle<SharedFunctionInfo> shared_info, |
404 Zone* zone); | 403 Zone* zone); |
405 CompilationInfo(HydrogenCodeStub* stub, | 404 CompilationInfo(HydrogenCodeStub* stub, |
406 Isolate* isolate, | 405 Isolate* isolate, |
407 Zone* zone); | 406 Zone* zone); |
408 CompilationInfo(ScriptCompiler::ExternalSourceStream* source_stream, | 407 CompilationInfo(ScriptCompiler::ExternalSourceStream* source_stream, |
409 ScriptCompiler::StreamedSource::Encoding encoding, | 408 ScriptCompiler::StreamedSource::Encoding encoding, |
410 Isolate* isolate, Zone* zone); | 409 Isolate* isolate, Zone* zone); |
411 | 410 |
412 | 411 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 Zone zone_; | 753 Zone zone_; |
755 unsigned info_zone_start_allocation_size_; | 754 unsigned info_zone_start_allocation_size_; |
756 base::ElapsedTimer timer_; | 755 base::ElapsedTimer timer_; |
757 | 756 |
758 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 757 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
759 }; | 758 }; |
760 | 759 |
761 } } // namespace v8::internal | 760 } } // namespace v8::internal |
762 | 761 |
763 #endif // V8_COMPILER_H_ | 762 #endif // V8_COMPILER_H_ |
OLD | NEW |