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" |
11 #include "src/handles.h" | 11 #include "src/handles.h" |
| 12 #include "testing/gtest/include/gtest/gtest_prod.h" |
12 | 13 |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 | 16 |
16 class CompilationInfo; | 17 class CompilationInfo; |
17 class Isolate; | 18 class Isolate; |
18 class JSFunction; | 19 class JSFunction; |
19 class ParseInfo; | 20 class ParseInfo; |
20 class Parser; | 21 class Parser; |
21 class String; | 22 class String; |
(...skipping 30 matching lines...) Expand all Loading... |
52 // Transition from kParsed to kReadyToCompile (or kFailed). | 53 // Transition from kParsed to kReadyToCompile (or kFailed). |
53 void FinalizeParsingOnMainThread(); | 54 void FinalizeParsingOnMainThread(); |
54 | 55 |
55 // Transition from kFailed to kDone. | 56 // Transition from kFailed to kDone. |
56 void ReportErrorsOnMainThread(); | 57 void ReportErrorsOnMainThread(); |
57 | 58 |
58 // Transition from any state to kInitial and free all resources. | 59 // Transition from any state to kInitial and free all resources. |
59 void ResetOnMainThread(); | 60 void ResetOnMainThread(); |
60 | 61 |
61 private: | 62 private: |
| 63 FRIEND_TEST(CompilerDispatcherJobTest, ScopeChain); |
| 64 |
62 void InternalizeParsingResult(); | 65 void InternalizeParsingResult(); |
63 | 66 |
64 CompileJobStatus status_ = CompileJobStatus::kInitial; | 67 CompileJobStatus status_ = CompileJobStatus::kInitial; |
65 Isolate* isolate_; | 68 Isolate* isolate_; |
66 Handle<JSFunction> function_; // Global handle. | 69 Handle<JSFunction> function_; // Global handle. |
67 Handle<String> source_; // Global handle. | 70 Handle<String> source_; // Global handle. |
68 size_t max_stack_size_; | 71 size_t max_stack_size_; |
69 | 72 |
70 // Members required for parsing. | 73 // Members required for parsing. |
71 std::unique_ptr<UnicodeCache> unicode_cache_; | 74 std::unique_ptr<UnicodeCache> unicode_cache_; |
72 std::unique_ptr<Zone> zone_; | 75 std::unique_ptr<Zone> zone_; |
73 std::unique_ptr<Utf16CharacterStream> character_stream_; | 76 std::unique_ptr<Utf16CharacterStream> character_stream_; |
74 std::unique_ptr<ParseInfo> parse_info_; | 77 std::unique_ptr<ParseInfo> parse_info_; |
75 std::unique_ptr<Parser> parser_; | 78 std::unique_ptr<Parser> parser_; |
76 | 79 |
77 bool can_parse_on_background_thread_; | 80 bool can_parse_on_background_thread_; |
78 | 81 |
79 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob); | 82 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob); |
80 }; | 83 }; |
81 | 84 |
82 } // namespace internal | 85 } // namespace internal |
83 } // namespace v8 | 86 } // namespace v8 |
84 | 87 |
85 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ | 88 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_ |
OLD | NEW |