OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_BACKGROUND_PARSING_TASK_H_ | 5 #ifndef V8_BACKGROUND_PARSING_TASK_H_ |
6 #define V8_BACKGROUND_PARSING_TASK_H_ | 6 #define V8_BACKGROUND_PARSING_TASK_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
11 #include "src/base/platform/semaphore.h" | 11 #include "src/base/platform/semaphore.h" |
12 #include "src/compiler.h" | 12 #include "src/compiler.h" |
13 #include "src/parsing/parser.h" | 13 #include "src/parsing/parser.h" |
14 | 14 |
15 namespace v8 { | 15 namespace v8 { |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
| 18 class ScriptData; |
| 19 |
18 // Internal representation of v8::ScriptCompiler::StreamedSource. Contains all | 20 // Internal representation of v8::ScriptCompiler::StreamedSource. Contains all |
19 // data which needs to be transmitted between threads for background parsing, | 21 // data which needs to be transmitted between threads for background parsing, |
20 // finalizing it on the main thread, and compiling on the main thread. | 22 // finalizing it on the main thread, and compiling on the main thread. |
21 struct StreamedSource { | 23 struct StreamedSource { |
22 StreamedSource(ScriptCompiler::ExternalSourceStream* source_stream, | 24 StreamedSource(ScriptCompiler::ExternalSourceStream* source_stream, |
23 ScriptCompiler::StreamedSource::Encoding encoding) | 25 ScriptCompiler::StreamedSource::Encoding encoding) |
24 : source_stream(source_stream), encoding(encoding) {} | 26 : source_stream(source_stream), encoding(encoding) {} |
25 | 27 |
26 // Internal implementation of v8::ScriptCompiler::StreamedSource. | 28 // Internal implementation of v8::ScriptCompiler::StreamedSource. |
27 std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream; | 29 std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream; |
(...skipping 19 matching lines...) Expand all Loading... |
47 public: | 49 public: |
48 BackgroundParsingTask(StreamedSource* source, | 50 BackgroundParsingTask(StreamedSource* source, |
49 ScriptCompiler::CompileOptions options, int stack_size, | 51 ScriptCompiler::CompileOptions options, int stack_size, |
50 Isolate* isolate); | 52 Isolate* isolate); |
51 | 53 |
52 virtual void Run(); | 54 virtual void Run(); |
53 | 55 |
54 private: | 56 private: |
55 StreamedSource* source_; // Not owned. | 57 StreamedSource* source_; // Not owned. |
56 int stack_size_; | 58 int stack_size_; |
| 59 ScriptData* script_data_; |
57 }; | 60 }; |
58 } // namespace internal | 61 } // namespace internal |
59 } // namespace v8 | 62 } // namespace v8 |
60 | 63 |
61 #endif // V8_BACKGROUND_PARSING_TASK_H_ | 64 #endif // V8_BACKGROUND_PARSING_TASK_H_ |
OLD | NEW |