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

Unified Diff: src/compiler/pipeline.cc

Issue 2684033007: Allow a ParseInfo without a script for %SetCode users (Closed)
Patch Set: nit 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
« no previous file with comments | « src/compiler/pipeline.h ('k') | src/parsing/parse-info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 2de587e820ee3cd39cdec13604cc5883132cc837..330b0960ec20ec6563867a66d8a5db069cc67fcb 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,16 @@ 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) {
+ Handle<SharedFunctionInfo> shared = handle(function->shared());
+ ParseInfo* parse_info;
+ if (!has_script) {
+ parse_info = ParseInfo::AllocateWithoutScript(shared);
+ } else {
+ parse_info = new ParseInfo(shared);
+ }
+ return new PipelineCompilationJob(parse_info, function);
}
// static
« no previous file with comments | « src/compiler/pipeline.h ('k') | src/parsing/parse-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698