Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Attributes | List of all members
dart::ICDataTestTask Class Reference
Inheritance diagram for dart::ICDataTestTask:
dart::ThreadPool::Task dart::IntrusiveDListEntry< Task >

Public Member Functions

 ICDataTestTask (IsolateGroup *isolate_group, const Array &ic_datas, Monitor *monitor, intptr_t *exited, std::atomic< bool > *done)
 
virtual void Run ()
 
- Public Member Functions inherited from dart::ThreadPool::Task
virtual ~Task ()
 
virtual void Run ()=0
 
- Public Member Functions inherited from dart::IntrusiveDListEntry< Task >
 IntrusiveDListEntry ()
 
 ~IntrusiveDListEntry ()
 

Static Public Attributes

static constexpr intptr_t kTaskCount = 1
 

Additional Inherited Members

- Protected Member Functions inherited from dart::ThreadPool::Task
 Task ()
 

Detailed Description

Definition at line 381 of file thread_test.cc.

Constructor & Destructor Documentation

◆ ICDataTestTask()

dart::ICDataTestTask::ICDataTestTask ( IsolateGroup isolate_group,
const Array ic_datas,
Monitor monitor,
intptr_t *  exited,
std::atomic< bool > *  done 
)
inline

Definition at line 385 of file thread_test.cc.

390 : isolate_group_(isolate_group),
391 ic_datas_(ic_datas),
392 len_(ic_datas.Length()),
393 monitor_(monitor),
394 exited_(exited),
395 done_(done) {}
static void done(const char *config, const char *src, const char *srcOptions, const char *name)
Definition: DM.cpp:263

Member Function Documentation

◆ Run()

virtual void dart::ICDataTestTask::Run ( )
inlinevirtual

Implements dart::ThreadPool::Task.

Definition at line 397 of file thread_test.cc.

397 {
398 const bool kBypassSafepoint = false;
400 kBypassSafepoint);
401
402 Thread* thread = Thread::Current();
403
404 {
405 StackZone stack_zone(thread);
406
407 ICData& ic_data = ICData::Handle();
408 Array& arr = Array::Handle();
409 while (true) {
410 for (intptr_t cnt = 0; cnt < 0x1000; cnt++) {
411 for (intptr_t i = 0; i < len_; i++) {
412 ic_data ^= ic_datas_.AtAcquire(i);
413 arr = ic_data.entries();
414 intptr_t num_checks = arr.Length() / 3;
415 if (num_checks < 0 || num_checks > 5) {
416 OS::PrintErr("Failure: %" Pd " checks!\n", num_checks);
417 abort();
418 }
419 }
420 }
421
422 if (done_->load(std::memory_order_acquire)) {
423 break;
424 }
425
426 TransitionVMToBlocked blocked(thread);
427 }
428 }
429
430 Thread::ExitIsolateGroupAsHelper(kBypassSafepoint);
431 {
432 MonitorLocker ml(monitor_);
433 ++*exited_;
434 ml.Notify();
435 }
436 }
ObjectPtr AtAcquire(intptr_t index) const
Definition: object.h:10891
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
static Object & Handle()
Definition: object.h:407
@ kUnknownTask
Definition: thread.h:346
static Thread * Current()
Definition: thread.h:362
static void ExitIsolateGroupAsHelper(bool bypass_safepoint)
Definition: thread.cc:499
static bool EnterIsolateGroupAsHelper(IsolateGroup *isolate_group, TaskKind kind, bool bypass_safepoint)
Definition: thread.cc:481
#define Pd
Definition: globals.h:408

Member Data Documentation

◆ kTaskCount

constexpr intptr_t dart::ICDataTestTask::kTaskCount = 1
staticconstexpr

Definition at line 383 of file thread_test.cc.


The documentation for this class was generated from the following file: