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 22 matching lines...) Expand all Loading... | |
33 kParsed, | 33 kParsed, |
34 kReadyToAnalyse, | 34 kReadyToAnalyse, |
35 kReadyToCompile, | 35 kReadyToCompile, |
36 kCompiled, | 36 kCompiled, |
37 kFailed, | 37 kFailed, |
38 kDone, | 38 kDone, |
39 }; | 39 }; |
40 | 40 |
41 class V8_EXPORT_PRIVATE CompilerDispatcherJob { | 41 class V8_EXPORT_PRIVATE CompilerDispatcherJob { |
42 public: | 42 public: |
43 CompilerDispatcherJob(Isolate* isolate, Handle<SharedFunctionInfo> shared, | 43 CompilerDispatcherJob(Isolate* isolate, CompilerDispatcherTracer* tracer, |
44 Handle<SharedFunctionInfo> shared, | |
44 size_t max_stack_size); | 45 size_t max_stack_size); |
45 ~CompilerDispatcherJob(); | 46 ~CompilerDispatcherJob(); |
46 | 47 |
47 CompileJobStatus status() const { return status_; } | 48 CompileJobStatus status() const { return status_; } |
48 bool can_parse_on_background_thread() const { | 49 bool can_parse_on_background_thread() const { |
49 return can_parse_on_background_thread_; | 50 return can_parse_on_background_thread_; |
50 } | 51 } |
51 // Should only be called after kReadyToCompile. | 52 // Should only be called after kReadyToCompile. |
52 bool can_compile_on_background_thread() const { | 53 bool can_compile_on_background_thread() const { |
53 DCHECK(compile_job_.get()); | 54 DCHECK(compile_job_.get()); |
54 return can_compile_on_background_thread_; | 55 return can_compile_on_background_thread_; |
55 } | 56 } |
56 | 57 |
58 // Returns true if this CompilerDispatcherJob was created for the given | |
59 // function. | |
60 bool IsProcessing(Handle<SharedFunctionInfo> shared) const; | |
marja
2016/12/12 09:00:02
Naming nit: IsProcessing has a connotation that so
rmcilroy
2016/12/12 09:50:39
Or how about just a getter which returns the SFI a
jochen (gone - plz use gerrit)
2016/12/12 10:51:17
that would require creating a new handle, as the m
jochen (gone - plz use gerrit)
2016/12/12 10:51:17
done
| |
61 | |
57 // Transition from kInitial to kReadyToParse. | 62 // Transition from kInitial to kReadyToParse. |
58 void PrepareToParseOnMainThread(); | 63 void PrepareToParseOnMainThread(); |
59 | 64 |
60 // Transition from kReadyToParse to kParsed. | 65 // Transition from kReadyToParse to kParsed. |
61 void Parse(); | 66 void Parse(); |
62 | 67 |
63 // Transition from kParsed to kReadyToAnalyse (or kFailed). Returns false | 68 // Transition from kParsed to kReadyToAnalyse (or kFailed). Returns false |
64 // when transitioning to kFailed. In that case, an exception is pending. | 69 // when transitioning to kFailed. In that case, an exception is pending. |
65 bool FinalizeParsingOnMainThread(); | 70 bool FinalizeParsingOnMainThread(); |
66 | 71 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 bool can_parse_on_background_thread_; | 108 bool can_parse_on_background_thread_; |
104 bool can_compile_on_background_thread_; | 109 bool can_compile_on_background_thread_; |
105 | 110 |
106 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob); | 111 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob); |
107 }; | 112 }; |
108 | 113 |
109 } // namespace internal | 114 } // namespace internal |
110 } // namespace v8 | 115 } // namespace v8 |
111 | 116 |
112 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ | 117 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ |
OLD | NEW |