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

Unified Diff: src/compiler/pipeline.cc

Issue 2684033007: Allow a ParseInfo without a script for %SetCode users (Closed)
Patch Set: Some comments. Created 3 years, 10 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/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 2de587e820ee3cd39cdec13604cc5883132cc837..d53ccc3078661e00757e6360a50595fdf62c49a9 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -545,13 +545,13 @@ PipelineStatistics* CreatePipelineStatistics(CompilationInfo* info,
class PipelineCompilationJob final : public CompilationJob {
public:
- PipelineCompilationJob(Isolate* isolate, Handle<JSFunction> function)
+ PipelineCompilationJob(ParseInfo* parse_info, Handle<JSFunction> function)
// Note that the CompilationInfo is not initialized at the time we pass it
// to the CompilationJob constructor, but it is not dereferenced there.
- : CompilationJob(isolate, &info_, "TurboFan"),
- parse_info_(handle(function->shared())),
- zone_stats_(isolate->allocator()),
- info_(parse_info_.zone(), &parse_info_, function),
+ : CompilationJob(parse_info->isolate(), &info_, "TurboFan"),
+ parse_info_(parse_info),
+ zone_stats_(parse_info->isolate()->allocator()),
+ info_(parse_info_.get()->zone(), parse_info_.get(), function),
pipeline_statistics_(CreatePipelineStatistics(info(), &zone_stats_)),
data_(&zone_stats_, info(), pipeline_statistics_.get()),
pipeline_(&data_),
@@ -563,7 +563,7 @@ class PipelineCompilationJob final : public CompilationJob {
Status FinalizeJobImpl() final;
private:
- ParseInfo parse_info_;
+ std::unique_ptr<ParseInfo> parse_info_;
ZoneStats zone_stats_;
CompilationInfo info_;
std::unique_ptr<PipelineStatistics> pipeline_statistics_;
@@ -1750,8 +1750,17 @@ Handle<Code> Pipeline::GenerateCodeForTesting(
}
// static
-CompilationJob* Pipeline::NewCompilationJob(Handle<JSFunction> function) {
- return new PipelineCompilationJob(function->GetIsolate(), function);
+CompilationJob* Pipeline::NewCompilationJob(Handle<JSFunction> function,
+ bool has_script) {
+ Isolate* isolate = function->shared()->GetIsolate();
Michael Starzinger 2017/02/15 14:51:48 nit: The isolate is only used for the handle alloc
mvstanton 2017/02/15 15:18:46 Done.
+ Handle<SharedFunctionInfo> shared = handle(function->shared(), isolate);
+ ParseInfo* p;
Michael Starzinger 2017/02/15 14:51:48 nit: s/p/parse_info/
mvstanton 2017/02/15 15:18:47 Done.
+ if (!has_script) {
+ p = ParseInfo::AllocateWithoutScript(shared);
+ } else {
+ p = new ParseInfo(shared);
+ }
+ return new PipelineCompilationJob(p, function);
}
// static

Powered by Google App Engine
This is Rietveld 408576698