Commit 3b334b73 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Compiler] Remove ability to create CompilerDispatcher jobs from parsed literal.

The approach to creating compiler dispatcher jobs for inner functions after
they had been parsed didn't provide the startup benifits we hoped for due
to the need to hold onto the whole zone memory AST while waiting for the
jobs to complete.

This CL removes the ability to create these compilation jobs (which was never
enabled by default anyway). Going forward we will potentially use the
parser task approach to parse+compile inner functions in their own job.

BUG=v8:5203

Change-Id: I63134746aa23b4aa6e3bfa17c539954890fd9b0f
Reviewed-on: https://chromium-review.googlesource.com/590007Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46948}
parent c5e9416b
......@@ -299,50 +299,6 @@ bool CompilerDispatcher::EnqueueAndStep(Handle<SharedFunctionInfo> function) {
return true;
}
bool CompilerDispatcher::Enqueue(
Handle<Script> script, Handle<SharedFunctionInfo> function,
FunctionLiteral* literal, ParseInfo* outer_parse_info,
std::shared_ptr<DeferredHandles> compile_handles) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.CompilerDispatcherEnqueue");
if (!CanEnqueue(function)) return false;
if (IsEnqueued(function)) return true;
if (trace_compiler_dispatcher_) {
PrintF("CompilerDispatcher: enqueuing ");
function->ShortPrint();
PrintF(" for compile\n");
}
std::unique_ptr<CompilerDispatcherJob> job(new UnoptimizedCompileJob(
isolate_, tracer_.get(), script, function, literal, outer_parse_info,
compile_handles, max_stack_size_));
Enqueue(std::move(job));
return true;
}
bool CompilerDispatcher::EnqueueAndStep(
Handle<Script> script, Handle<SharedFunctionInfo> function,
FunctionLiteral* literal, ParseInfo* outer_parse_info,
std::shared_ptr<DeferredHandles> compile_handles) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.CompilerDispatcherEnqueueAndStep");
if (!CanEnqueue(function)) return false;
if (IsEnqueued(function)) return true;
if (trace_compiler_dispatcher_) {
PrintF("CompilerDispatcher: enqueuing ");
function->ShortPrint();
PrintF(" for compile\n");
}
std::unique_ptr<CompilerDispatcherJob> job(new UnoptimizedCompileJob(
isolate_, tracer_.get(), script, function, literal, outer_parse_info,
compile_handles, max_stack_size_));
EnqueueAndStep(std::move(job));
return true;
}
bool CompilerDispatcher::IsEnabled() const { return FLAG_compiler_dispatcher; }
bool CompilerDispatcher::IsEnqueued(Handle<SharedFunctionInfo> function) const {
......
......@@ -97,20 +97,6 @@ class V8_EXPORT_PRIVATE CompilerDispatcher {
// true if the job was enqueued.
bool EnqueueAndStep(Handle<SharedFunctionInfo> function);
// Enqueue a job for compilation. Function must have already been parsed and
// analyzed and be ready for compilation. Returns true if a job was enqueued.
bool Enqueue(Handle<Script> script, Handle<SharedFunctionInfo> function,
FunctionLiteral* literal, ParseInfo* outer_parse_info,
std::shared_ptr<DeferredHandles> compile_handles);
// Like Enqueue, but also advances the job so that it can potentially
// continue running on a background thread (if at all possible). Returns
// true if the job was enqueued.
bool EnqueueAndStep(Handle<Script> script,
Handle<SharedFunctionInfo> function,
FunctionLiteral* literal, ParseInfo* outer_parse_info,
std::shared_ptr<DeferredHandles> compile_handles);
// Returns true if there is a pending job for the given function.
bool IsEnqueued(Handle<SharedFunctionInfo> function) const;
......
......@@ -132,37 +132,6 @@ UnoptimizedCompileJob::UnoptimizedCompileJob(Isolate* isolate,
}
}
UnoptimizedCompileJob::UnoptimizedCompileJob(
Isolate* isolate, CompilerDispatcherTracer* tracer, Handle<Script> script,
Handle<SharedFunctionInfo> shared, FunctionLiteral* literal,
ParseInfo* outer_parse_info,
std::shared_ptr<DeferredHandles> compile_handles, size_t max_stack_size)
: status_(Status::kAnalyzed),
isolate_(isolate),
tracer_(tracer),
context_(isolate_->global_handles()->Create(isolate->context())),
shared_(isolate_->global_handles()->Create(*shared)),
max_stack_size_(max_stack_size),
parse_info_(new ParseInfo(shared_)),
compile_zone_(new Zone(isolate->allocator(), ZONE_NAME)),
compile_info_(new CompilationInfo(compile_zone_.get(), parse_info_.get(),
isolate_, shared_,
Handle<JSFunction>::null())),
trace_compiler_dispatcher_jobs_(FLAG_trace_compiler_dispatcher_jobs) {
parse_info_->set_literal(literal);
parse_info_->set_script(script);
parse_info_->ShareAstValueFactory(outer_parse_info);
parse_info_->ShareZone(outer_parse_info);
compile_info_->set_deferred_handles(compile_handles);
if (trace_compiler_dispatcher_jobs_) {
PrintF("UnoptimizedCompileJob[%p] created for ", static_cast<void*>(this));
ShortPrint();
PrintF(" in Analyzed state.\n");
}
}
UnoptimizedCompileJob::~UnoptimizedCompileJob() {
DCHECK(status_ == Status::kInitial ||
(status_ == Status::kReadyToParse && finish_callback_) ||
......
......@@ -64,13 +64,6 @@ class V8_EXPORT_PRIVATE UnoptimizedCompileJob : public CompilerDispatcherJob {
AccountingAllocator* zone_allocator, int compiler_hints,
const AstStringConstants* ast_string_constants,
UnoptimizedCompileJobFinishCallback* finish_callback);
// Creates a UnoptimizedCompileJob in the analyzed state.
UnoptimizedCompileJob(Isolate* isolate, CompilerDispatcherTracer* tracer,
Handle<Script> script,
Handle<SharedFunctionInfo> shared,
FunctionLiteral* literal, ParseInfo* outer_parse_info,
std::shared_ptr<DeferredHandles> compile_handles,
size_t max_stack_size);
~UnoptimizedCompileJob() override;
......
......@@ -288,16 +288,6 @@ bool UseAsmWasm(DeclarationScope* scope, Handle<SharedFunctionInfo> shared_info,
return scope->asm_module();
}
bool UseCompilerDispatcher(ConcurrencyMode inner_function_mode,
CompilerDispatcher* dispatcher,
DeclarationScope* scope,
Handle<SharedFunctionInfo> shared_info,
bool is_debug, bool will_serialize) {
return inner_function_mode == ConcurrencyMode::kConcurrent &&
dispatcher->IsEnabled() && !is_debug && !will_serialize &&
!UseAsmWasm(scope, shared_info, is_debug);
}
CompilationJob* GetUnoptimizedCompilationJob(CompilationInfo* info) {
// Function should have been parsed and analyzed before creating a compilation
// job.
......@@ -454,7 +444,7 @@ bool GenerateUnoptimizedCode(CompilationInfo* info) {
bool CompileUnoptimizedInnerFunctions(
Compiler::EagerInnerFunctionLiterals* literals,
ConcurrencyMode inner_function_mode, CompilationInfo* outer_info) {
CompilationInfo* outer_info) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.CompileUnoptimizedInnerFunctions");
Isolate* isolate = outer_info->isolate();
......@@ -470,36 +460,24 @@ bool CompileUnoptimizedInnerFunctions(
Compiler::GetSharedFunctionInfo(literal, script, outer_info);
if (shared->is_compiled()) continue;
// Try to enqueue the eager function on the compiler dispatcher.
CompilerDispatcher* dispatcher = isolate->compiler_dispatcher();
if (UseCompilerDispatcher(inner_function_mode, dispatcher, literal->scope(),
shared, is_debug, will_serialize) &&
dispatcher->EnqueueAndStep(outer_info->script(), shared, literal,
outer_info->parse_info(),
outer_info->deferred_handles())) {
// If we have successfully queued up the function for compilation on the
// compiler dispatcher then we are done.
continue;
} else {
// Otherwise generate unoptimized code now.
ParseInfo parse_info(script);
CompilationInfo info(parse_info.zone(), &parse_info, isolate, shared,
Handle<JSFunction>::null());
parse_info.set_toplevel(false);
parse_info.set_literal(literal);
parse_info.set_function_literal_id(shared->function_literal_id());
parse_info.set_language_mode(literal->scope()->language_mode());
parse_info.set_source_range_map(
outer_info->parse_info()->source_range_map());
parse_info.ShareAstValueFactory(outer_info->parse_info());
if (will_serialize) info.PrepareForSerializing();
if (is_debug) info.MarkAsDebug();
if (!GenerateUnoptimizedCode(&info)) {
if (!isolate->has_pending_exception()) isolate->StackOverflow();
return false;
}
// Generate unoptimized code now.
ParseInfo parse_info(script);
CompilationInfo info(parse_info.zone(), &parse_info, isolate, shared,
Handle<JSFunction>::null());
parse_info.set_toplevel(false);
parse_info.set_literal(literal);
parse_info.set_function_literal_id(shared->function_literal_id());
parse_info.set_language_mode(literal->scope()->language_mode());
parse_info.set_source_range_map(
outer_info->parse_info()->source_range_map());
parse_info.ShareAstValueFactory(outer_info->parse_info());
if (will_serialize) info.PrepareForSerializing();
if (is_debug) info.MarkAsDebug();
if (!GenerateUnoptimizedCode(&info)) {
if (!isolate->has_pending_exception()) isolate->StackOverflow();
return false;
}
}
return true;
......@@ -514,27 +492,18 @@ bool InnerFunctionShouldUseFullCodegen(
return false;
}
bool CompileUnoptimizedCode(CompilationInfo* info,
ConcurrencyMode inner_function_mode) {
bool CompileUnoptimizedCode(CompilationInfo* info) {
Isolate* isolate = info->isolate();
DCHECK(AllowCompilation::IsAllowed(isolate));
Compiler::EagerInnerFunctionLiterals inner_literals;
{
base::Optional<CompilationHandleScope> compilation_handle_scope;
if (inner_function_mode == ConcurrencyMode::kConcurrent) {
compilation_handle_scope.emplace(info);
}
if (!Compiler::Analyze(info, &inner_literals)) {
if (!isolate->has_pending_exception()) isolate->StackOverflow();
return false;
}
if (!Compiler::Analyze(info, &inner_literals)) {
if (!isolate->has_pending_exception()) isolate->StackOverflow();
return false;
}
if (ShouldUseFullCodegen(info->literal()) ||
InnerFunctionShouldUseFullCodegen(&inner_literals)) {
inner_function_mode = ConcurrencyMode::kNotConcurrent;
// If we might compile with full-codegen internalize now, otherwise
// we internalize when finalizing compilation.
info->parse_info()->ast_value_factory()->Internalize(info->isolate());
......@@ -550,16 +519,8 @@ bool CompileUnoptimizedCode(CompilationInfo* info,
}
}
if (inner_function_mode == ConcurrencyMode::kConcurrent) {
// Seal the parse zone so that it can be shared by parallel inner function
// compilation jobs.
DCHECK_NE(info->parse_info()->zone(), info->zone());
info->parse_info()->zone()->Seal();
}
if (!GenerateUnoptimizedCode(info) ||
!CompileUnoptimizedInnerFunctions(&inner_literals, inner_function_mode,
info)) {
!CompileUnoptimizedInnerFunctions(&inner_literals, info)) {
if (!isolate->has_pending_exception()) isolate->StackOverflow();
return false;
}
......@@ -568,8 +529,7 @@ bool CompileUnoptimizedCode(CompilationInfo* info,
}
MUST_USE_RESULT MaybeHandle<Code> CompileUnoptimizedFunction(
CompilationInfo* info, Handle<SharedFunctionInfo> shared_info,
ConcurrencyMode inner_function_mode) {
CompilationInfo* info, Handle<SharedFunctionInfo> shared_info) {
RuntimeCallTimerScope runtimeTimer(
info->isolate(), &RuntimeCallStats::CompileUnoptimizedFunction);
VMState<COMPILER> state(info->isolate());
......@@ -582,7 +542,7 @@ MUST_USE_RESULT MaybeHandle<Code> CompileUnoptimizedFunction(
}
// Compile either unoptimized code or bytecode for the interpreter.
if (!CompileUnoptimizedCode(info, inner_function_mode)) {
if (!CompileUnoptimizedCode(info)) {
return MaybeHandle<Code>();
}
......@@ -972,13 +932,9 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
shared->set_preparsed_scope_data(isolate->heap()->null_value());
}
}
ConcurrencyMode inner_function_mode = FLAG_compiler_dispatcher_eager_inner
? ConcurrencyMode::kConcurrent
: ConcurrencyMode::kNotConcurrent;
Handle<Code> result;
ASSIGN_RETURN_ON_EXCEPTION(
isolate, result,
CompileUnoptimizedFunction(&info, shared, inner_function_mode), Code);
ASSIGN_RETURN_ON_EXCEPTION(isolate, result,
CompileUnoptimizedFunction(&info, shared), Code);
if (FLAG_always_opt && !info.shared_info()->HasAsmWasmData()) {
if (FLAG_trace_opt) {
......@@ -1007,10 +963,6 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
PostponeInterruptsScope postpone(isolate);
DCHECK(!isolate->native_context().is_null());
ParseInfo* parse_info = info->parse_info();
ConcurrencyMode inner_function_mode = FLAG_compiler_dispatcher_eager_inner
? ConcurrencyMode::kConcurrent
: ConcurrencyMode::kNotConcurrent;
RuntimeCallTimerScope runtimeTimer(
isolate, parse_info->is_eval() ? &RuntimeCallStats::CompileEval
: &RuntimeCallStats::CompileScript);
......@@ -1036,7 +988,7 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile");
// Compile the code.
if (!CompileUnoptimizedCode(info, inner_function_mode)) {
if (!CompileUnoptimizedCode(info)) {
return Handle<SharedFunctionInfo>::null();
}
......@@ -1172,9 +1124,7 @@ bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) {
return false;
}
} else {
if (CompileUnoptimizedFunction(&info, shared,
ConcurrencyMode::kNotConcurrent)
.is_null()) {
if (CompileUnoptimizedFunction(&info, shared).is_null()) {
isolate->clear_pending_exception();
return false;
}
......@@ -1231,9 +1181,7 @@ bool Compiler::EnsureBytecode(CompilationInfo* info) {
CompilerDispatcher* dispatcher = info->isolate()->compiler_dispatcher();
if (dispatcher->IsEnqueued(shared_info)) {
if (!dispatcher->FinishNow(info->shared_info())) return false;
} else if (CompileUnoptimizedFunction(info, shared_info,
ConcurrencyMode::kNotConcurrent)
.is_null()) {
} else if (CompileUnoptimizedFunction(info, shared_info).is_null()) {
return false;
}
}
......
......@@ -808,8 +808,6 @@ DEFINE_BOOL(cache_prototype_transitions, true, "cache prototype transitions")
// compiler-dispatcher.cc
DEFINE_BOOL(compiler_dispatcher, false, "enable compiler dispatcher")
DEFINE_BOOL(compiler_dispatcher_eager_inner, false,
"enable background compilation of eager inner functions")
DEFINE_BOOL(trace_compiler_dispatcher, false,
"trace compiler dispatcher activity")
......
......@@ -950,170 +950,6 @@ TEST_F(CompilerDispatcherTest, EnqueueAndStep) {
platform.ClearBackgroundTasks();
}
TEST_F(CompilerDispatcherTest, EnqueueParsed) {
MockPlatform platform(V8::GetCurrentPlatform()->GetTracingController());
CompilerDispatcher dispatcher(i_isolate(), &platform, FLAG_stack_size);
const char source[] = TEST_SCRIPT();
Handle<JSFunction> f =
Handle<JSFunction>::cast(test::RunJS(isolate(), source));
Handle<SharedFunctionInfo> shared(f->shared(), i_isolate());
Handle<Script> script(Script::cast(shared->script()), i_isolate());
ParseInfo parse_info(shared);
ASSERT_TRUE(Compiler::ParseAndAnalyze(&parse_info, shared, i_isolate()));
std::shared_ptr<DeferredHandles> handles;
ASSERT_FALSE(dispatcher.IsEnqueued(shared));
ASSERT_TRUE(dispatcher.Enqueue(script, shared, parse_info.literal(),
&parse_info, handles));
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
ASSERT_EQ(UnoptimizedCompileJob::Status::kAnalyzed,
GetUnoptimizedJobStatus(dispatcher.jobs_.begin()->second));
ASSERT_TRUE(platform.IdleTaskPending());
platform.ClearIdleTask();
ASSERT_FALSE(platform.BackgroundTasksPending());
}
TEST_F(CompilerDispatcherTest, EnqueueAndStepParsed) {
MockPlatform platform(V8::GetCurrentPlatform()->GetTracingController());
CompilerDispatcher dispatcher(i_isolate(), &platform, FLAG_stack_size);
const char source[] = TEST_SCRIPT();
Handle<JSFunction> f =
Handle<JSFunction>::cast(test::RunJS(isolate(), source));
Handle<SharedFunctionInfo> shared(f->shared(), i_isolate());
Handle<Script> script(Script::cast(shared->script()), i_isolate());
ParseInfo parse_info(shared);
ASSERT_TRUE(Compiler::ParseAndAnalyze(&parse_info, shared, i_isolate()));
std::shared_ptr<DeferredHandles> handles;
ASSERT_FALSE(dispatcher.IsEnqueued(shared));
ASSERT_TRUE(dispatcher.EnqueueAndStep(script, shared, parse_info.literal(),
&parse_info, handles));
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
ASSERT_EQ(UnoptimizedCompileJob::Status::kReadyToCompile,
GetUnoptimizedJobStatus(dispatcher.jobs_.begin()->second));
ASSERT_TRUE(platform.IdleTaskPending());
ASSERT_TRUE(platform.BackgroundTasksPending());
platform.ClearIdleTask();
platform.ClearBackgroundTasks();
}
TEST_F(CompilerDispatcherTest, CompileParsedOutOfScope) {
MockPlatform platform(V8::GetCurrentPlatform()->GetTracingController());
CompilerDispatcher dispatcher(i_isolate(), &platform, FLAG_stack_size);
const char source[] = TEST_SCRIPT();
Handle<JSFunction> f =
Handle<JSFunction>::cast(test::RunJS(isolate(), source));
Handle<SharedFunctionInfo> shared(f->shared(), i_isolate());
Handle<Script> script(Script::cast(shared->script()), i_isolate());
{
HandleScope scope(i_isolate()); // Create handles scope for parsing.
ASSERT_FALSE(shared->is_compiled());
ParseInfo parse_info(shared);
DeferredHandleScope handles_scope(i_isolate());
ASSERT_TRUE(parsing::ParseAny(&parse_info, shared, i_isolate()));
{ ASSERT_TRUE(Compiler::Analyze(&parse_info, i_isolate())); }
std::shared_ptr<DeferredHandles> compilation_handles(
handles_scope.Detach());
ASSERT_FALSE(platform.IdleTaskPending());
ASSERT_TRUE(dispatcher.Enqueue(script, shared, parse_info.literal(),
&parse_info, compilation_handles));
ASSERT_TRUE(platform.IdleTaskPending());
}
// Exit the handles scope and destroy ParseInfo before running the idle task.
// Since time doesn't progress on the MockPlatform, this is enough idle time
// to finish compiling the function.
platform.RunIdleTask(1000.0, 0.0);
ASSERT_FALSE(dispatcher.IsEnqueued(shared));
ASSERT_TRUE(shared->is_compiled());
}
namespace {
const char kExtensionSource[] = "native function Dummy();";
class MockNativeFunctionExtension : public Extension {
public:
MockNativeFunctionExtension()
: Extension("mock-extension", kExtensionSource), function_(&Dummy) {}
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name) {
return v8::FunctionTemplate::New(isolate, function_);
}
static void Dummy(const v8::FunctionCallbackInfo<v8::Value>& args) { return; }
private:
v8::FunctionCallback function_;
DISALLOW_COPY_AND_ASSIGN(MockNativeFunctionExtension);
};
} // namespace
TEST_F(CompilerDispatcherTestWithoutContext, CompileExtensionWithoutContext) {
MockPlatform platform(V8::GetCurrentPlatform()->GetTracingController());
CompilerDispatcher dispatcher(i_isolate(), &platform, FLAG_stack_size);
Local<v8::Context> context = v8::Context::New(isolate());
MockNativeFunctionExtension extension;
Handle<String> script_str =
i_isolate()
->factory()
->NewStringFromUtf8(CStrVector(kExtensionSource))
.ToHandleChecked();
Handle<Script> script = i_isolate()->factory()->NewScript(script_str);
script->set_type(Script::TYPE_EXTENSION);
Handle<SharedFunctionInfo> shared;
{
v8::Context::Scope scope(context);
ParseInfo parse_info(script);
parse_info.set_extension(&extension);
ASSERT_TRUE(parsing::ParseProgram(&parse_info, i_isolate()));
Handle<FixedArray> shared_infos_array(i_isolate()->factory()->NewFixedArray(
parse_info.max_function_literal_id() + 1));
parse_info.script()->set_shared_function_infos(*shared_infos_array);
DeferredHandleScope handles_scope(i_isolate());
{ ASSERT_TRUE(Compiler::Analyze(&parse_info, i_isolate())); }
std::shared_ptr<DeferredHandles> compilation_handles(
handles_scope.Detach());
parse_info.ast_value_factory()->Internalize(i_isolate());
shared = i_isolate()->factory()->NewSharedFunctionInfoForLiteral(
parse_info.literal(), script);
ASSERT_FALSE(platform.IdleTaskPending());
ASSERT_TRUE(dispatcher.Enqueue(script, shared, parse_info.literal(),
&parse_info, compilation_handles));
ASSERT_TRUE(platform.IdleTaskPending());
}
// Exit the context scope before running the idle task.
// Since time doesn't progress on the MockPlatform, this is enough idle time
// to finish compiling the function.
platform.RunIdleTask(1000.0, 0.0);
ASSERT_FALSE(dispatcher.IsEnqueued(shared));
ASSERT_TRUE(shared->is_compiled());
}
TEST_F(CompilerDispatcherTest, CompileLazyFinishesDispatcherJob) {
// Use the real dispatcher so that CompileLazy checks the same one for
// enqueued functions.
......@@ -1167,33 +1003,20 @@ TEST_F(CompilerDispatcherTest, EnqueueAndStepTwice) {
MockPlatform platform(V8::GetCurrentPlatform()->GetTracingController());
CompilerDispatcher dispatcher(i_isolate(), &platform, FLAG_stack_size);
const char source[] = TEST_SCRIPT();
const char script[] = TEST_SCRIPT();
Handle<JSFunction> f =
Handle<JSFunction>::cast(test::RunJS(isolate(), source));
Handle<JSFunction>::cast(test::RunJS(isolate(), script));
Handle<SharedFunctionInfo> shared(f->shared(), i_isolate());
Handle<Script> script(Script::cast(shared->script()), i_isolate());
ParseInfo parse_info(shared);
ASSERT_TRUE(Compiler::ParseAndAnalyze(&parse_info, shared, i_isolate()));
std::shared_ptr<DeferredHandles> handles;
ASSERT_FALSE(dispatcher.IsEnqueued(shared));
ASSERT_TRUE(dispatcher.EnqueueAndStep(script, shared, parse_info.literal(),
&parse_info, handles));
ASSERT_TRUE(dispatcher.EnqueueAndStep(shared));
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
ASSERT_EQ(UnoptimizedCompileJob::Status::kReadyToCompile,
ASSERT_EQ(UnoptimizedCompileJob::Status::kReadyToParse,
GetUnoptimizedJobStatus(dispatcher.jobs_.begin()->second));
// EnqueueAndStep of the same function again (either already parsed or for
// compile and parse) shouldn't step the job.
ASSERT_TRUE(dispatcher.EnqueueAndStep(script, shared, parse_info.literal(),
&parse_info, handles));
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
ASSERT_EQ(UnoptimizedCompileJob::Status::kReadyToCompile,
GetUnoptimizedJobStatus(dispatcher.jobs_.begin()->second));
// EnqueueAndStep of the same function again (shouldn't step the job.
ASSERT_TRUE(dispatcher.EnqueueAndStep(shared));
ASSERT_EQ(UnoptimizedCompileJob::Status::kReadyToCompile,
ASSERT_EQ(UnoptimizedCompileJob::Status::kReadyToParse,
GetUnoptimizedJobStatus(dispatcher.jobs_.begin()->second));
ASSERT_TRUE(platform.IdleTaskPending());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment