Set the stack base value for thread pool threads at the start so that profile ticks for threads show up even if it never runs Dart code.
R=rmacnak@google.com Review URL: https://codereview.chromium.org/1815533002 .
This commit is contained in:
@@ -331,6 +331,7 @@ void Thread::ClearStackLimit() {
|
||||
uword Thread::GetCurrentStackPointer() {
|
||||
// Since AddressSanitizer's detect_stack_use_after_return instruments the
|
||||
// C++ code to give out fake stack addresses, we call a stub in that case.
|
||||
ASSERT(StubCode::GetStackPointer_entry() != NULL);
|
||||
uword (*func)() = reinterpret_cast<uword (*)()>(
|
||||
StubCode::GetStackPointer_entry()->EntryPoint());
|
||||
// But for performance (and to support simulators), we normally use a local.
|
||||
|
||||
@@ -433,6 +433,9 @@ void ThreadPool::Worker::Main(uword args) {
|
||||
ThreadJoinId join_id = os_thread->join_id();
|
||||
ThreadPool* pool;
|
||||
|
||||
// Set the thread's stack_base based on the current stack pointer.
|
||||
os_thread->set_stack_base(Thread::GetCurrentStackPointer());
|
||||
|
||||
{
|
||||
MonitorLocker ml(&worker->monitor_);
|
||||
ASSERT(worker->task_);
|
||||
|
||||
Reference in New Issue
Block a user