OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ | 5 #ifndef V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ |
6 #define V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ | 6 #define V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/base/macros.h" | 10 #include "src/base/macros.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Transition from kCompiled to kDone (or kFailed). Returns false when | 79 // Transition from kCompiled to kDone (or kFailed). Returns false when |
80 // transitioning to kFailed. In that case, an exception is pending. | 80 // transitioning to kFailed. In that case, an exception is pending. |
81 bool FinalizeCompilingOnMainThread(); | 81 bool FinalizeCompilingOnMainThread(); |
82 | 82 |
83 // Transition from any state to kInitial and free all resources. | 83 // Transition from any state to kInitial and free all resources. |
84 void ResetOnMainThread(); | 84 void ResetOnMainThread(); |
85 | 85 |
86 // Estimate how long the next step will take using the tracer. | 86 // Estimate how long the next step will take using the tracer. |
87 double EstimateRuntimeOfNextStepInMs() const; | 87 double EstimateRuntimeOfNextStepInMs() const; |
88 | 88 |
| 89 // Even though the name does not imply this, ShortPrint() must only be invoked |
| 90 // on the main thread. |
| 91 void ShortPrint(); |
| 92 |
89 private: | 93 private: |
90 FRIEND_TEST(CompilerDispatcherJobTest, ScopeChain); | 94 FRIEND_TEST(CompilerDispatcherJobTest, ScopeChain); |
91 | 95 |
92 CompileJobStatus status_ = CompileJobStatus::kInitial; | 96 CompileJobStatus status_ = CompileJobStatus::kInitial; |
93 Isolate* isolate_; | 97 Isolate* isolate_; |
94 CompilerDispatcherTracer* tracer_; | 98 CompilerDispatcherTracer* tracer_; |
95 Handle<SharedFunctionInfo> shared_; // Global handle. | 99 Handle<SharedFunctionInfo> shared_; // Global handle. |
96 Handle<String> source_; // Global handle. | 100 Handle<String> source_; // Global handle. |
97 size_t max_stack_size_; | 101 size_t max_stack_size_; |
98 | 102 |
99 // Members required for parsing. | 103 // Members required for parsing. |
100 std::unique_ptr<UnicodeCache> unicode_cache_; | 104 std::unique_ptr<UnicodeCache> unicode_cache_; |
101 std::unique_ptr<Zone> zone_; | 105 std::unique_ptr<Zone> zone_; |
102 std::unique_ptr<Utf16CharacterStream> character_stream_; | 106 std::unique_ptr<Utf16CharacterStream> character_stream_; |
103 std::unique_ptr<ParseInfo> parse_info_; | 107 std::unique_ptr<ParseInfo> parse_info_; |
104 std::unique_ptr<Parser> parser_; | 108 std::unique_ptr<Parser> parser_; |
105 std::unique_ptr<DeferredHandles> handles_from_parsing_; | 109 std::unique_ptr<DeferredHandles> handles_from_parsing_; |
106 | 110 |
107 // Members required for compiling. | 111 // Members required for compiling. |
108 std::unique_ptr<CompilationInfo> compile_info_; | 112 std::unique_ptr<CompilationInfo> compile_info_; |
109 std::unique_ptr<CompilationJob> compile_job_; | 113 std::unique_ptr<CompilationJob> compile_job_; |
110 | 114 |
111 bool can_parse_on_background_thread_; | 115 bool can_parse_on_background_thread_; |
112 bool can_compile_on_background_thread_; | 116 bool can_compile_on_background_thread_; |
113 | 117 |
| 118 bool trace_compiler_dispatcher_jobs_; |
| 119 |
114 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob); | 120 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob); |
115 }; | 121 }; |
116 | 122 |
117 } // namespace internal | 123 } // namespace internal |
118 } // namespace v8 | 124 } // namespace v8 |
119 | 125 |
120 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ | 126 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ |
OLD | NEW |