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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Transition from kReadyToCompile to kCompiled. | 76 // Transition from kReadyToCompile to kCompiled. |
77 void Compile(); | 77 void Compile(); |
78 | 78 |
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. |
| 87 double EstimateRuntimeOfNextStepInMs() const; |
| 88 |
86 private: | 89 private: |
87 FRIEND_TEST(CompilerDispatcherJobTest, ScopeChain); | 90 FRIEND_TEST(CompilerDispatcherJobTest, ScopeChain); |
88 | 91 |
89 CompileJobStatus status_ = CompileJobStatus::kInitial; | 92 CompileJobStatus status_ = CompileJobStatus::kInitial; |
90 Isolate* isolate_; | 93 Isolate* isolate_; |
91 CompilerDispatcherTracer* tracer_; | 94 CompilerDispatcherTracer* tracer_; |
92 Handle<SharedFunctionInfo> shared_; // Global handle. | 95 Handle<SharedFunctionInfo> shared_; // Global handle. |
93 Handle<String> source_; // Global handle. | 96 Handle<String> source_; // Global handle. |
94 size_t max_stack_size_; | 97 size_t max_stack_size_; |
95 | 98 |
(...skipping 12 matching lines...) Expand all Loading... |
108 bool can_parse_on_background_thread_; | 111 bool can_parse_on_background_thread_; |
109 bool can_compile_on_background_thread_; | 112 bool can_compile_on_background_thread_; |
110 | 113 |
111 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob); | 114 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob); |
112 }; | 115 }; |
113 | 116 |
114 } // namespace internal | 117 } // namespace internal |
115 } // namespace v8 | 118 } // namespace v8 |
116 | 119 |
117 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ | 120 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ |
OLD | NEW |