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 #include <vector> |
9 | 10 |
10 #include "src/base/macros.h" | 11 #include "src/base/macros.h" |
11 #include "src/handles.h" | 12 #include "src/handles.h" |
12 #include "testing/gtest/include/gtest/gtest_prod.h" | 13 #include "testing/gtest/include/gtest/gtest_prod.h" |
13 | 14 |
14 namespace v8 { | 15 namespace v8 { |
15 namespace internal { | 16 namespace internal { |
16 | 17 |
17 class CompilationInfo; | 18 class CompilationInfo; |
18 class CompilationJob; | 19 class CompilationJob; |
(...skipping 22 matching lines...) Expand all Loading... |
41 CompilerDispatcherJob(Isolate* isolate, Handle<SharedFunctionInfo> shared, | 42 CompilerDispatcherJob(Isolate* isolate, Handle<SharedFunctionInfo> shared, |
42 size_t max_stack_size); | 43 size_t max_stack_size); |
43 ~CompilerDispatcherJob(); | 44 ~CompilerDispatcherJob(); |
44 | 45 |
45 CompileJobStatus status() const { return status_; } | 46 CompileJobStatus status() const { return status_; } |
46 bool can_parse_on_background_thread() const { | 47 bool can_parse_on_background_thread() const { |
47 return can_parse_on_background_thread_; | 48 return can_parse_on_background_thread_; |
48 } | 49 } |
49 // Should only be called after kReadyToCompile. | 50 // Should only be called after kReadyToCompile. |
50 bool can_compile_on_background_thread() const { | 51 bool can_compile_on_background_thread() const { |
51 DCHECK(compile_job_.get()); | 52 DCHECK(!compile_jobs_.empty()); |
52 return can_compile_on_background_thread_; | 53 return can_compile_on_background_thread_; |
53 } | 54 } |
54 | 55 |
55 // Transition from kInitial to kReadyToParse. | 56 // Transition from kInitial to kReadyToParse. |
56 void PrepareToParseOnMainThread(); | 57 void PrepareToParseOnMainThread(); |
57 | 58 |
58 // Transition from kReadyToParse to kParsed. | 59 // Transition from kReadyToParse to kParsed. |
59 void Parse(); | 60 void Parse(); |
60 | 61 |
61 // Transition from kParsed to kReadyToAnalyse (or kFailed). Returns false | 62 // Transition from kParsed to kReadyToAnalyse (or kFailed). Returns false |
(...skipping 26 matching lines...) Expand all Loading... |
88 // Members required for parsing. | 89 // Members required for parsing. |
89 std::unique_ptr<UnicodeCache> unicode_cache_; | 90 std::unique_ptr<UnicodeCache> unicode_cache_; |
90 std::unique_ptr<Zone> zone_; | 91 std::unique_ptr<Zone> zone_; |
91 std::unique_ptr<Utf16CharacterStream> character_stream_; | 92 std::unique_ptr<Utf16CharacterStream> character_stream_; |
92 std::unique_ptr<ParseInfo> parse_info_; | 93 std::unique_ptr<ParseInfo> parse_info_; |
93 std::unique_ptr<Parser> parser_; | 94 std::unique_ptr<Parser> parser_; |
94 std::unique_ptr<DeferredHandles> handles_from_parsing_; | 95 std::unique_ptr<DeferredHandles> handles_from_parsing_; |
95 | 96 |
96 // Members required for compiling. | 97 // Members required for compiling. |
97 std::unique_ptr<CompilationInfo> compile_info_; | 98 std::unique_ptr<CompilationInfo> compile_info_; |
98 std::unique_ptr<CompilationJob> compile_job_; | 99 std::vector<std::unique_ptr<CompilationJob>> compile_jobs_; |
99 | 100 |
100 bool can_parse_on_background_thread_; | 101 bool can_parse_on_background_thread_; |
101 bool can_compile_on_background_thread_; | 102 bool can_compile_on_background_thread_; |
102 | 103 |
103 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob); | 104 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob); |
104 }; | 105 }; |
105 | 106 |
106 } // namespace internal | 107 } // namespace internal |
107 } // namespace v8 | 108 } // namespace v8 |
108 | 109 |
109 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ | 110 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ |
OLD | NEW |