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 "include/v8.h" | 10 #include "include/v8.h" |
(...skipping 20 matching lines...) Loading... |
31 | 31 |
32 // Internal implementation of v8::ScriptCompiler::StreamedSource. | 32 // Internal implementation of v8::ScriptCompiler::StreamedSource. |
33 std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream; | 33 std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream; |
34 ScriptCompiler::StreamedSource::Encoding encoding; | 34 ScriptCompiler::StreamedSource::Encoding encoding; |
35 std::unique_ptr<ScriptCompiler::CachedData> cached_data; | 35 std::unique_ptr<ScriptCompiler::CachedData> cached_data; |
36 | 36 |
37 // Data needed for parsing, and data needed to to be passed between thread | 37 // Data needed for parsing, and data needed to to be passed between thread |
38 // between parsing and compilation. These need to be initialized before the | 38 // between parsing and compilation. These need to be initialized before the |
39 // compilation starts. | 39 // compilation starts. |
40 UnicodeCache unicode_cache; | 40 UnicodeCache unicode_cache; |
41 std::unique_ptr<Zone> zone; | |
42 std::unique_ptr<ParseInfo> info; | 41 std::unique_ptr<ParseInfo> info; |
43 std::unique_ptr<Parser> parser; | 42 std::unique_ptr<Parser> parser; |
44 | 43 |
45 // Prevent copying. | 44 // Prevent copying. |
46 StreamedSource(const StreamedSource&) = delete; | 45 StreamedSource(const StreamedSource&) = delete; |
47 StreamedSource& operator=(const StreamedSource&) = delete; | 46 StreamedSource& operator=(const StreamedSource&) = delete; |
48 }; | 47 }; |
49 | 48 |
50 | 49 |
51 class BackgroundParsingTask : public ScriptCompiler::ScriptStreamingTask { | 50 class BackgroundParsingTask : public ScriptCompiler::ScriptStreamingTask { |
52 public: | 51 public: |
53 BackgroundParsingTask(StreamedSource* source, | 52 BackgroundParsingTask(StreamedSource* source, |
54 ScriptCompiler::CompileOptions options, int stack_size, | 53 ScriptCompiler::CompileOptions options, int stack_size, |
55 Isolate* isolate); | 54 Isolate* isolate); |
56 | 55 |
57 virtual void Run(); | 56 virtual void Run(); |
58 | 57 |
59 private: | 58 private: |
60 StreamedSource* source_; // Not owned. | 59 StreamedSource* source_; // Not owned. |
61 int stack_size_; | 60 int stack_size_; |
62 ScriptData* script_data_; | 61 ScriptData* script_data_; |
63 }; | 62 }; |
64 } // namespace internal | 63 } // namespace internal |
65 } // namespace v8 | 64 } // namespace v8 |
66 | 65 |
67 #endif // V8_BACKGROUND_PARSING_TASK_H_ | 66 #endif // V8_BACKGROUND_PARSING_TASK_H_ |
OLD | NEW |