Index: src/background-parsing-task.h |
diff --git a/src/background-parsing-task.h b/src/background-parsing-task.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f82f4234fc761c279e81f32d7fd13b7e015cd57b |
--- /dev/null |
+++ b/src/background-parsing-task.h |
@@ -0,0 +1,51 @@ |
+// Copyright 2014 the V8 project authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef V8_BACKGROUND_PARSING_TASK_H_ |
+#define V8_BACKGROUND_PARSING_TASK_H_ |
+ |
+#include "src/base/platform/platform.h" |
+#include "src/base/platform/semaphore.h" |
+#include "src/compiler.h" |
+ |
+namespace v8 { |
+namespace internal { |
+ |
+class Parser; |
+ |
+// Data which needs to be transmitted between threads for background parsing, |
+// finalizing it on the main thread, and compiling on the main thread. Carried |
+// by ScriptSource. (It cannot be carried by BackgroundParsingTask, because |
+// BackgroundParsingTask is deleted right after it's ran.) |
+class StreamingData { |
jochen (gone - plz use gerrit)
2014/09/08 11:27:06
if it's just a container, this should be a struct
marja
2014/09/08 16:14:47
Done.
|
+ public: |
+ StreamingData(i::CompilationInfo* i, uint32_t h, UnicodeCache* u, bool a) |
jochen (gone - plz use gerrit)
2014/09/08 11:27:06
info, hash_seed, etc..
marja
2014/09/08 16:14:47
This code was deleted.
|
+ : info(i), hash_seed(h), unicode_cache(u), allow_lazy(a), parser(NULL) {} |
+ |
+ ~StreamingData(); |
+ |
+ CompilationInfo* info; |
+ uint32_t hash_seed; |
+ UnicodeCache* unicode_cache; // Owned. |
jochen (gone - plz use gerrit)
2014/09/08 11:27:06
how can this be owned, if the data is copied aroun
marja
2014/09/08 16:14:47
Prevented copying (which was non-prevented by omis
|
+ bool allow_lazy; |
+ Parser* parser; // Owned. |
+}; |
+ |
+class BackgroundParsingTask : public ScriptCompiler::ScriptStreamingTask { |
+ public: |
+ explicit BackgroundParsingTask(ScriptCompiler::StreamedSource* source) |
+ : source_(source), script_data_(NULL) {} |
+ |
+ virtual void Run(); |
+ |
+ private: |
+ friend class v8::ScriptCompiler; |
+ |
+ ScriptCompiler::StreamedSource* source_; |
+ ScriptData* script_data_; |
+}; |
+} |
+} // namespace v8::internal |
+ |
+#endif // V8_BACKGROUND_PARSING_TASK_H_ |