diff --git a/src/asmjs/asm-js.cc b/src/asmjs/asm-js.cc index 5a38eeef36..28a970da9a 100644 --- a/src/asmjs/asm-js.cc +++ b/src/asmjs/asm-js.cc @@ -319,10 +319,10 @@ void AsmJsCompilationJob::RecordHistograms(Isolate* isolate) { translation_throughput); } -UnoptimizedCompilationJob* AsmJs::NewCompilationJob( +std::unique_ptr AsmJs::NewCompilationJob( ParseInfo* parse_info, FunctionLiteral* literal, AccountingAllocator* allocator) { - return new AsmJsCompilationJob(parse_info, literal, allocator); + return base::make_unique(parse_info, literal, allocator); } namespace { diff --git a/src/asmjs/asm-js.h b/src/asmjs/asm-js.h index 46dd3f2e34..3e714cba7a 100644 --- a/src/asmjs/asm-js.h +++ b/src/asmjs/asm-js.h @@ -23,7 +23,7 @@ class UnoptimizedCompilationJob; // Interface to compile and instantiate for asm.js modules. class AsmJs { public: - static UnoptimizedCompilationJob* NewCompilationJob( + static std::unique_ptr NewCompilationJob( ParseInfo* parse_info, FunctionLiteral* literal, AccountingAllocator* allocator); static MaybeHandle InstantiateAsmWasm(Isolate* isolate, diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc index ff23712716..a8ac33ca40 100644 --- a/src/compiler/pipeline.cc +++ b/src/compiler/pipeline.cc @@ -2479,11 +2479,11 @@ MaybeHandle Pipeline::GenerateCodeForTesting( } // static -OptimizedCompilationJob* Pipeline::NewCompilationJob( +std::unique_ptr Pipeline::NewCompilationJob( Isolate* isolate, Handle function, bool has_script) { Handle shared = handle(function->shared(), function->GetIsolate()); - return new PipelineCompilationJob(isolate, shared, function); + return base::make_unique(isolate, shared, function); } // static diff --git a/src/compiler/pipeline.h b/src/compiler/pipeline.h index 7f9a242d98..476b1cb5db 100644 --- a/src/compiler/pipeline.h +++ b/src/compiler/pipeline.h @@ -41,9 +41,8 @@ class SourcePositionTable; class Pipeline : public AllStatic { public: // Returns a new compilation job for the given JavaScript function. - static OptimizedCompilationJob* NewCompilationJob(Isolate* isolate, - Handle function, - bool has_script); + static std::unique_ptr NewCompilationJob( + Isolate* isolate, Handle function, bool has_script); // Run the pipeline for the WebAssembly compilation info. static void GenerateCodeForWasmFunction( diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc index b84182702e..eb91ae06a4 100644 --- a/src/interpreter/interpreter.cc +++ b/src/interpreter/interpreter.cc @@ -230,12 +230,12 @@ InterpreterCompilationJob::Status InterpreterCompilationJob::FinalizeJobImpl( return SUCCEEDED; } -UnoptimizedCompilationJob* Interpreter::NewCompilationJob( +std::unique_ptr Interpreter::NewCompilationJob( ParseInfo* parse_info, FunctionLiteral* literal, AccountingAllocator* allocator, std::vector* eager_inner_literals) { - return new InterpreterCompilationJob(parse_info, literal, allocator, - eager_inner_literals); + return base::make_unique( + parse_info, literal, allocator, eager_inner_literals); } void Interpreter::ForEachBytecode( diff --git a/src/interpreter/interpreter.h b/src/interpreter/interpreter.h index ca317ddede..e8c494a6ce 100644 --- a/src/interpreter/interpreter.h +++ b/src/interpreter/interpreter.h @@ -43,7 +43,7 @@ class Interpreter { // Creates a compilation job which will generate bytecode for |literal|. // Additionally, if |eager_inner_literals| is not null, adds any eagerly // compilable inner FunctionLiterals to this list. - static UnoptimizedCompilationJob* NewCompilationJob( + static std::unique_ptr NewCompilationJob( ParseInfo* parse_info, FunctionLiteral* literal, AccountingAllocator* allocator, std::vector* eager_inner_literals);