Commit 087e95ba authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Compiler] Use IdentityMap to store jobs in CompilerDispatcher.

Stores jobs in an IdentityMap keyed by their SharedFunctionInfo to enable
fast checking of whether a job is enqueued.

BUG=v8:5203

Change-Id: I6c37972093515a27077f79594cad27e32e1a4e7c
Reviewed-on: https://chromium-review.googlesource.com/444768Reviewed-by: 's avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43370}
parent acd85989
......@@ -221,6 +221,7 @@ CompilerDispatcher::CompilerDispatcher(Isolate* isolate, Platform* platform,
trace_compiler_dispatcher_(FLAG_trace_compiler_dispatcher),
tracer_(new CompilerDispatcherTracer(isolate_)),
task_manager_(new CancelableTaskManager()),
jobs_(isolate->heap()),
memory_pressure_level_(MemoryPressureLevel::kNone),
abort_(false),
idle_task_scheduled_(false),
......@@ -234,7 +235,7 @@ CompilerDispatcher::CompilerDispatcher(Isolate* isolate, Platform* platform,
}
CompilerDispatcher::~CompilerDispatcher() {
// To avoid crashing in unit tests due to unfished jobs.
// To avoid crashing in unit tests due to unfinished jobs.
AbortAll(BlockingBehavior::kBlock);
task_manager_->CancelAndWait();
}
......@@ -277,9 +278,7 @@ bool CompilerDispatcher::Enqueue(Handle<SharedFunctionInfo> function) {
std::unique_ptr<CompilerDispatcherJob> job(new CompilerDispatcherJob(
isolate_, tracer_.get(), function, max_stack_size_));
std::pair<int, int> key(Script::cast(function->script())->id(),
function->function_literal_id());
jobs_.insert(std::make_pair(key, std::move(job)));
jobs_.Set(function, job.release());
ScheduleIdleTaskIfNeeded();
return true;
}
......@@ -295,10 +294,9 @@ bool CompilerDispatcher::EnqueueAndStep(Handle<SharedFunctionInfo> function) {
function->ShortPrint();
PrintF("\n");
}
JobMap::const_iterator job = GetJobFor(function);
DoNextStepOnMainThread(isolate_, job->second.get(),
ExceptionHandling::kSwallow);
ConsiderJobForBackgroundProcessing(job->second.get());
CompilerDispatcherJob* job = *jobs_.Find(function);
DoNextStepOnMainThread(isolate_, job, ExceptionHandling::kSwallow);
ConsiderJobForBackgroundProcessing(job);
return true;
}
......@@ -321,9 +319,7 @@ bool CompilerDispatcher::Enqueue(
std::unique_ptr<CompilerDispatcherJob> job(new CompilerDispatcherJob(
isolate_, tracer_.get(), script, function, literal, parse_zone,
parse_handles, compile_handles, max_stack_size_));
std::pair<int, int> key(Script::cast(function->script())->id(),
function->function_literal_id());
jobs_.insert(std::make_pair(key, std::move(job)));
jobs_.Set(function, job.release());
ScheduleIdleTaskIfNeeded();
return true;
}
......@@ -346,18 +342,16 @@ bool CompilerDispatcher::EnqueueAndStep(
function->ShortPrint();
PrintF("\n");
}
JobMap::const_iterator job = GetJobFor(function);
DoNextStepOnMainThread(isolate_, job->second.get(),
ExceptionHandling::kSwallow);
ConsiderJobForBackgroundProcessing(job->second.get());
CompilerDispatcherJob* job = *jobs_.Find(function);
DoNextStepOnMainThread(isolate_, job, ExceptionHandling::kSwallow);
ConsiderJobForBackgroundProcessing(job);
return true;
}
bool CompilerDispatcher::IsEnabled() const { return FLAG_compiler_dispatcher; }
bool CompilerDispatcher::IsEnqueued(Handle<SharedFunctionInfo> function) const {
if (jobs_.empty()) return false;
return GetJobFor(function) != jobs_.end();
return jobs_.Find(function) != nullptr;
}
void CompilerDispatcher::WaitForJobIfRunningOnBackground(
......@@ -384,8 +378,8 @@ void CompilerDispatcher::WaitForJobIfRunningOnBackground(
bool CompilerDispatcher::FinishNow(Handle<SharedFunctionInfo> function) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.CompilerDispatcherFinishNow");
JobMap::const_iterator job = GetJobFor(function);
CHECK(job != jobs_.end());
CompilerDispatcherJob* job = jobs_.Delete(function);
CHECK_NOT_NULL(job);
if (trace_compiler_dispatcher_) {
PrintF("CompilerDispatcher: finishing ");
......@@ -393,12 +387,11 @@ bool CompilerDispatcher::FinishNow(Handle<SharedFunctionInfo> function) {
PrintF(" now\n");
}
WaitForJobIfRunningOnBackground(job->second.get());
while (!IsFinished(job->second.get())) {
DoNextStepOnMainThread(isolate_, job->second.get(),
ExceptionHandling::kThrow);
WaitForJobIfRunningOnBackground(job);
while (!IsFinished(job)) {
DoNextStepOnMainThread(isolate_, job, ExceptionHandling::kThrow);
}
bool result = job->second->status() != CompileJobStatus::kFailed;
bool result = job->status() != CompileJobStatus::kFailed;
if (trace_compiler_dispatcher_) {
PrintF("CompilerDispatcher: finished working on ");
......@@ -407,8 +400,8 @@ bool CompilerDispatcher::FinishNow(Handle<SharedFunctionInfo> function) {
tracer_->DumpStatistics();
}
job->second->ResetOnMainThread();
jobs_.erase(job);
job->ResetOnMainThread();
delete job;
if (jobs_.empty()) {
base::LockGuard<base::Mutex> lock(&mutex_);
abort_ = false;
......@@ -420,16 +413,19 @@ void CompilerDispatcher::AbortAll(BlockingBehavior blocking) {
bool background_tasks_running =
task_manager_->TryAbortAll() == CancelableTaskManager::kTaskRunning;
if (!background_tasks_running || blocking == BlockingBehavior::kBlock) {
for (auto& it : jobs_) {
WaitForJobIfRunningOnBackground(it.second.get());
JobsMap::IteratableScope job_iter_scope(&jobs_);
for (auto it = job_iter_scope.begin(); it != job_iter_scope.end();) {
CompilerDispatcherJob* job = **it;
WaitForJobIfRunningOnBackground(job);
if (trace_compiler_dispatcher_) {
PrintF("CompilerDispatcher: aborted ");
it.second->ShortPrint();
job->ShortPrint();
PrintF("\n");
}
it.second->ResetOnMainThread();
job->ResetOnMainThread();
delete job;
it.DeleteAndIncrement();
}
jobs_.clear();
{
base::LockGuard<base::Mutex> lock(&mutex_);
DCHECK(pending_background_jobs_.empty());
......@@ -459,23 +455,25 @@ void CompilerDispatcher::AbortInactiveJobs() {
// here with nothing left to do.
if (!abort_) return;
}
for (auto it = jobs_.begin(); it != jobs_.end();) {
auto job = it;
++it;
JobsMap::IteratableScope job_iter_scope(&jobs_);
for (auto it = job_iter_scope.begin(); it != job_iter_scope.end();) {
CompilerDispatcherJob* job = **it;
{
base::LockGuard<base::Mutex> lock(&mutex_);
if (running_background_jobs_.find(job->second.get()) !=
if (running_background_jobs_.find(job) !=
running_background_jobs_.end()) {
++it;
continue;
}
}
if (trace_compiler_dispatcher_) {
PrintF("CompilerDispatcher: aborted ");
job->second->ShortPrint();
job->ShortPrint();
PrintF("\n");
}
job->second->ResetOnMainThread();
jobs_.erase(job);
job->ResetOnMainThread();
delete job;
it.DeleteAndIncrement();
}
if (jobs_.empty()) {
base::LockGuard<base::Mutex> lock(&mutex_);
......@@ -514,16 +512,9 @@ void CompilerDispatcher::MemoryPressureNotification(
}
}
CompilerDispatcher::JobMap::const_iterator CompilerDispatcher::GetJobFor(
Handle<SharedFunctionInfo> shared) const {
if (!shared->script()->IsScript()) return jobs_.end();
std::pair<int, int> key(Script::cast(shared->script())->id(),
shared->function_literal_id());
auto range = jobs_.equal_range(key);
for (auto job = range.first; job != range.second; ++job) {
if (job->second->IsAssociatedWith(shared)) return job;
}
return jobs_.end();
void CompilerDispatcher::ScheduleIdleTaskIfNeeded() {
if (jobs_.empty()) return;
ScheduleIdleTaskFromAnyThread();
}
void CompilerDispatcher::ScheduleIdleTaskFromAnyThread() {
......@@ -538,11 +529,6 @@ void CompilerDispatcher::ScheduleIdleTaskFromAnyThread() {
v8_isolate, new IdleTask(isolate_, task_manager_.get(), this));
}
void CompilerDispatcher::ScheduleIdleTaskIfNeeded() {
if (jobs_.empty()) return;
ScheduleIdleTaskFromAnyThread();
}
void CompilerDispatcher::ScheduleAbortTask() {
v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate_);
platform_->CallOnForegroundThread(
......@@ -642,7 +628,7 @@ void CompilerDispatcher::DoIdleWork(double deadline_in_seconds) {
// Number of jobs that are unlikely to make progress during any idle callback
// due to their estimated duration.
size_t too_long_jobs = 0;
int too_long_jobs = 0;
// Iterate over all available jobs & remaining time. For each job, decide
// whether to 1) skip it (if it would take too long), 2) erase it (if it's
......@@ -655,56 +641,57 @@ void CompilerDispatcher::DoIdleWork(double deadline_in_seconds) {
idle_time_in_seconds *
static_cast<double>(base::Time::kMillisecondsPerSecond));
}
for (auto job = jobs_.begin();
job != jobs_.end() && idle_time_in_seconds > 0.0;
JobsMap::IteratableScope job_iter_scope(&jobs_);
for (auto it = job_iter_scope.begin();
it != job_iter_scope.end() && idle_time_in_seconds > 0.0;
idle_time_in_seconds =
deadline_in_seconds - platform_->MonotonicallyIncreasingTime()) {
CompilerDispatcherJob* job = **it;
// Don't work on jobs that are being worked on by background tasks.
// Similarly, remove jobs we work on from the set of available background
// jobs.
std::unique_ptr<base::LockGuard<base::Mutex>> lock(
new base::LockGuard<base::Mutex>(&mutex_));
if (running_background_jobs_.find(job->second.get()) !=
running_background_jobs_.end()) {
++job;
if (running_background_jobs_.find(job) != running_background_jobs_.end()) {
++it;
continue;
}
auto it = pending_background_jobs_.find(job->second.get());
double estimate_in_ms = job->second->EstimateRuntimeOfNextStepInMs();
auto background_jobs_it = pending_background_jobs_.find(job);
double estimate_in_ms = job->EstimateRuntimeOfNextStepInMs();
if (idle_time_in_seconds <
(estimate_in_ms /
static_cast<double>(base::Time::kMillisecondsPerSecond))) {
// If there's not enough time left, try to estimate whether we would
// If there's not enough time left, try to estFdeimate whether we would
// have managed to finish the job in a large idle task to assess
// whether we should ask for another idle callback.
if (estimate_in_ms > kMaxIdleTimeToExpectInMs) ++too_long_jobs;
if (it == pending_background_jobs_.end()) {
if (background_jobs_it == pending_background_jobs_.end()) {
lock.reset();
ConsiderJobForBackgroundProcessing(job->second.get());
ConsiderJobForBackgroundProcessing(job);
}
++job;
} else if (IsFinished(job->second.get())) {
DCHECK(it == pending_background_jobs_.end());
++it;
continue;
} else if (IsFinished(job)) {
DCHECK(background_jobs_it == pending_background_jobs_.end());
if (trace_compiler_dispatcher_) {
PrintF("CompilerDispatcher: finished working on ");
job->second->ShortPrint();
PrintF(": %s\n", job->second->status() == CompileJobStatus::kDone
? "success"
: "failure");
job->ShortPrint();
PrintF(": %s\n", job->status() == CompileJobStatus::kDone ? "success"
: "failure");
tracer_->DumpStatistics();
}
job->second->ResetOnMainThread();
job = jobs_.erase(job);
it.DeleteAndIncrement();
job->ResetOnMainThread();
delete job;
continue;
} else {
// Do one step, and keep processing the job (as we don't advance the
// iterator).
if (it != pending_background_jobs_.end()) {
pending_background_jobs_.erase(it);
if (background_jobs_it != pending_background_jobs_.end()) {
pending_background_jobs_.erase(background_jobs_it);
}
lock.reset();
DoNextStepOnMainThread(isolate_, job->second.get(),
ExceptionHandling::kSwallow);
DoNextStepOnMainThread(isolate_, job, ExceptionHandling::kSwallow);
}
}
if (jobs_.size() > too_long_jobs) ScheduleIdleTaskIfNeeded();
......
......@@ -16,6 +16,7 @@
#include "src/base/platform/mutex.h"
#include "src/base/platform/semaphore.h"
#include "src/globals.h"
#include "src/identity-map.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
namespace v8 {
......@@ -128,9 +129,6 @@ class V8_EXPORT_PRIVATE CompilerDispatcher {
FRIEND_TEST(CompilerDispatcherTest, AsyncAbortAllRunningBackgroundTask);
FRIEND_TEST(CompilerDispatcherTest, FinishNowDuringAbortAll);
typedef std::multimap<std::pair<int, int>,
std::unique_ptr<CompilerDispatcherJob>>
JobMap;
class AbortTask;
class BackgroundTask;
class IdleTask;
......@@ -138,11 +136,10 @@ class V8_EXPORT_PRIVATE CompilerDispatcher {
void WaitForJobIfRunningOnBackground(CompilerDispatcherJob* job);
void AbortInactiveJobs();
bool CanEnqueue(Handle<SharedFunctionInfo> function);
JobMap::const_iterator GetJobFor(Handle<SharedFunctionInfo> shared) const;
void ConsiderJobForBackgroundProcessing(CompilerDispatcherJob* job);
void ScheduleMoreBackgroundTasksIfNeeded();
void ScheduleIdleTaskFromAnyThread();
void ScheduleIdleTaskIfNeeded();
void ScheduleIdleTaskFromAnyThread();
void ScheduleAbortTask();
void DoBackgroundWork();
void DoIdleWork(double deadline_in_seconds);
......@@ -158,9 +155,10 @@ class V8_EXPORT_PRIVATE CompilerDispatcher {
std::unique_ptr<CancelableTaskManager> task_manager_;
// Mapping from (script id, function literal id) to job. We use a multimap,
// as script id is not necessarily unique.
JobMap jobs_;
// Mapping from SharedFunctionInfo to job.
typedef IdentityMap<CompilerDispatcherJob*, FreeStoreAllocationPolicy>
JobsMap;
JobsMap jobs_;
base::AtomicValue<v8::MemoryPressureLevel> memory_pressure_level_;
......
......@@ -16,7 +16,7 @@ class Heap;
// Base class of identity maps contains shared code for all template
// instantions.
class IdentityMapBase {
class V8_EXPORT_PRIVATE IdentityMapBase {
public:
bool empty() const { return size_ == 0; }
int size() const { return size_; }
......@@ -47,8 +47,8 @@ class IdentityMapBase {
void* DeleteIndex(int index);
void Clear();
V8_EXPORT_PRIVATE RawEntry EntryAtIndex(int index) const;
V8_EXPORT_PRIVATE int NextIndex(int index) const;
RawEntry EntryAtIndex(int index) const;
int NextIndex(int index) const;
void EnableIteration();
void DisableIteration();
......
......@@ -341,8 +341,8 @@ TEST_F(CompilerDispatcherTest, IdleTaskSmallIdleTime) {
ASSERT_TRUE(platform.IdleTaskPending());
// The job should be scheduled for the main thread.
ASSERT_EQ(dispatcher.jobs_.size(), 1u);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_EQ(dispatcher.jobs_.size(), 1);
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kInitial);
// Only grant a little idle time and have time advance beyond it in one step.
......@@ -354,8 +354,8 @@ TEST_F(CompilerDispatcherTest, IdleTaskSmallIdleTime) {
// The job should be still scheduled for the main thread, but ready for
// parsing.
ASSERT_EQ(dispatcher.jobs_.size(), 1u);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_EQ(dispatcher.jobs_.size(), 1);
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kReadyToParse);
// Now grant a lot of idle time and freeze time.
......@@ -406,15 +406,15 @@ TEST_F(CompilerDispatcherTest, CompileOnBackgroundThread) {
ASSERT_TRUE(dispatcher.Enqueue(shared));
ASSERT_TRUE(platform.IdleTaskPending());
ASSERT_EQ(dispatcher.jobs_.size(), 1u);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_EQ(dispatcher.jobs_.size(), 1);
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kInitial);
// Make compiling super expensive, and advance job as much as possible on the
// foreground thread.
dispatcher.tracer_->RecordCompile(50000.0, 1);
platform.RunIdleTask(10.0, 0.0);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kReadyToCompile);
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
......@@ -426,7 +426,7 @@ TEST_F(CompilerDispatcherTest, CompileOnBackgroundThread) {
ASSERT_TRUE(platform.IdleTaskPending());
ASSERT_FALSE(platform.BackgroundTasksPending());
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kCompiled);
// Now grant a lot of idle time and freeze time.
......@@ -451,15 +451,15 @@ TEST_F(CompilerDispatcherTest, FinishNowWithBackgroundTask) {
ASSERT_TRUE(dispatcher.Enqueue(shared));
ASSERT_TRUE(platform.IdleTaskPending());
ASSERT_EQ(dispatcher.jobs_.size(), 1u);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_EQ(dispatcher.jobs_.size(), 1);
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kInitial);
// Make compiling super expensive, and advance job as much as possible on the
// foreground thread.
dispatcher.tracer_->RecordCompile(50000.0, 1);
platform.RunIdleTask(10.0, 0.0);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kReadyToCompile);
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
......@@ -550,15 +550,15 @@ TEST_F(CompilerDispatcherTest, AsyncAbortAllPendingBackgroundTask) {
ASSERT_TRUE(dispatcher.Enqueue(shared));
ASSERT_TRUE(platform.IdleTaskPending());
ASSERT_EQ(dispatcher.jobs_.size(), 1u);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_EQ(dispatcher.jobs_.size(), 1);
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kInitial);
// Make compiling super expensive, and advance job as much as possible on the
// foreground thread.
dispatcher.tracer_->RecordCompile(50000.0, 1);
platform.RunIdleTask(10.0, 0.0);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kReadyToCompile);
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
......@@ -600,15 +600,15 @@ TEST_F(CompilerDispatcherTest, AsyncAbortAllRunningBackgroundTask) {
ASSERT_TRUE(dispatcher.Enqueue(shared1));
ASSERT_TRUE(platform.IdleTaskPending());
ASSERT_EQ(dispatcher.jobs_.size(), 1u);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_EQ(dispatcher.jobs_.size(), 1);
ASSERT_TRUE((*dispatcher.jobs_.Find(shared1))->status() ==
CompileJobStatus::kInitial);
// Make compiling super expensive, and advance job as much as possible on the
// foreground thread.
dispatcher.tracer_->RecordCompile(50000.0, 1);
platform.RunIdleTask(10.0, 0.0);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared1))->status() ==
CompileJobStatus::kReadyToCompile);
ASSERT_TRUE(dispatcher.IsEnqueued(shared1));
......@@ -678,15 +678,15 @@ TEST_F(CompilerDispatcherTest, FinishNowDuringAbortAll) {
ASSERT_TRUE(dispatcher.Enqueue(shared));
ASSERT_TRUE(platform.IdleTaskPending());
ASSERT_EQ(dispatcher.jobs_.size(), 1u);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_EQ(dispatcher.jobs_.size(), 1);
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kInitial);
// Make compiling super expensive, and advance job as much as possible on the
// foreground thread.
dispatcher.tracer_->RecordCompile(50000.0, 1);
platform.RunIdleTask(10.0, 0.0);
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kReadyToCompile);
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
......@@ -830,7 +830,7 @@ TEST_F(CompilerDispatcherTest, EnqueueAndStep) {
ASSERT_TRUE(dispatcher.EnqueueAndStep(shared));
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kReadyToParse);
ASSERT_TRUE(platform.IdleTaskPending());
......@@ -859,7 +859,7 @@ TEST_F(CompilerDispatcherTest, EnqueueParsed) {
parse_info.zone_shared(), handles, handles));
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kAnalyzed);
ASSERT_TRUE(platform.IdleTaskPending());
......@@ -888,7 +888,7 @@ TEST_F(CompilerDispatcherTest, EnqueueAndStepParsed) {
handles));
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kReadyToCompile);
ASSERT_TRUE(platform.IdleTaskPending());
......@@ -1081,7 +1081,7 @@ TEST_F(CompilerDispatcherTest, EnqueueAndStepTwice) {
handles));
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kReadyToCompile);
// EnqueueAndStep of the same function again (either already parsed or for
......@@ -1090,10 +1090,10 @@ TEST_F(CompilerDispatcherTest, EnqueueAndStepTwice) {
parse_info.zone_shared(), handles,
handles));
ASSERT_TRUE(dispatcher.IsEnqueued(shared));
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kReadyToCompile);
ASSERT_TRUE(dispatcher.EnqueueAndStep(shared));
ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
ASSERT_TRUE((*dispatcher.jobs_.Find(shared))->status() ==
CompileJobStatus::kReadyToCompile);
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