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:
Siva Annamalai
2016-03-17 16:40:02 -07:00
parent aefb7a424c
commit af32c047b1
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -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.
+3
View File
@@ -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_);