Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: src/compiler-dispatcher/compiler-dispatcher-job.h

Issue 2190333002: Teach compiler jobs how to actually parse (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler-dispatcher/compiler-dispatcher-job.h
diff --git a/src/compiler-dispatcher/compiler-dispatcher-job.h b/src/compiler-dispatcher/compiler-dispatcher-job.h
index e0c339846144da7bd0ba7f625fec2bc1414d4743..c498e49a1589a4b2beebe2bfd88b9f19df645bf5 100644
--- a/src/compiler-dispatcher/compiler-dispatcher-job.h
+++ b/src/compiler-dispatcher/compiler-dispatcher-job.h
@@ -7,6 +7,7 @@
#include <memory>
+#include "src/base/atomic-utils.h"
#include "src/base/macros.h"
#include "src/handles.h"
@@ -17,6 +18,7 @@ class CompilationInfo;
class Isolate;
class JSFunction;
class ParseInfo;
+class Parser;
class UnicodeCache;
class Utf16CharacterStream;
class Zone;
@@ -24,28 +26,39 @@ class Zone;
enum class CompileJobStatus {
kInitial,
kReadyToParse,
+ kParsed,
};
class CompilerDispatcherJob {
public:
- CompilerDispatcherJob(Isolate* isolate, Handle<JSFunction> function);
+ CompilerDispatcherJob(Isolate* isolate, Handle<JSFunction> function,
+ size_t max_stack_size);
~CompilerDispatcherJob();
- CompileJobStatus status() const { return status_; }
+ CompileJobStatus status() const { return status_.Value(); }
+ bool can_parse_on_background_thread() const {
+ return can_parse_on_background_thread_;
+ }
// Transition from kInitial to kReadyToParse.
void PrepareToParseOnMainThread();
+ // Transition from kReadyToParse to kParsed.
+ void Parse();
+
private:
- CompileJobStatus status_ = CompileJobStatus::kInitial;
+ base::AtomicValue<CompileJobStatus> status_ =
+ base::AtomicValue<CompileJobStatus>(CompileJobStatus::kInitial);
vogelheim 2016/07/29 10:19:56 Why initialize here, and not in constructor?
jochen (gone - plz use gerrit) 2016/07/29 10:27:45 so you see in the header that this is independend
Isolate* isolate_;
Handle<JSFunction> function_; // Global handle.
+ size_t max_stack_size_;
// Members required for parsing.
std::unique_ptr<UnicodeCache> unicode_cache_;
std::unique_ptr<Zone> zone_;
std::unique_ptr<Utf16CharacterStream> character_stream_;
std::unique_ptr<ParseInfo> parse_info_;
+ std::unique_ptr<Parser> parser_;
bool can_parse_on_background_thread_;

Powered by Google App Engine
This is Rietveld 408576698