| 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...) Expand all 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; |
| 41 std::unique_ptr<ParseInfo> info; | 42 std::unique_ptr<ParseInfo> info; |
| 42 std::unique_ptr<Parser> parser; | 43 std::unique_ptr<Parser> parser; |
| 43 | 44 |
| 44 // Prevent copying. | 45 // Prevent copying. |
| 45 StreamedSource(const StreamedSource&) = delete; | 46 StreamedSource(const StreamedSource&) = delete; |
| 46 StreamedSource& operator=(const StreamedSource&) = delete; | 47 StreamedSource& operator=(const StreamedSource&) = delete; |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 | 50 |
| 50 class BackgroundParsingTask : public ScriptCompiler::ScriptStreamingTask { | 51 class BackgroundParsingTask : public ScriptCompiler::ScriptStreamingTask { |
| 51 public: | 52 public: |
| 52 BackgroundParsingTask(StreamedSource* source, | 53 BackgroundParsingTask(StreamedSource* source, |
| 53 ScriptCompiler::CompileOptions options, int stack_size, | 54 ScriptCompiler::CompileOptions options, int stack_size, |
| 54 Isolate* isolate); | 55 Isolate* isolate); |
| 55 | 56 |
| 56 virtual void Run(); | 57 virtual void Run(); |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 StreamedSource* source_; // Not owned. | 60 StreamedSource* source_; // Not owned. |
| 60 int stack_size_; | 61 int stack_size_; |
| 61 ScriptData* script_data_; | 62 ScriptData* script_data_; |
| 62 }; | 63 }; |
| 63 } // namespace internal | 64 } // namespace internal |
| 64 } // namespace v8 | 65 } // namespace v8 |
| 65 | 66 |
| 66 #endif // V8_BACKGROUND_PARSING_TASK_H_ | 67 #endif // V8_BACKGROUND_PARSING_TASK_H_ |
| OLD | NEW |