Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Side by Side Diff: runtime/vm/thread.cc

Issue 1815533002: Set the stack base value for thread pool threads at the start so that profile ticks for threads sho… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/thread_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/thread.h" 5 #include "vm/thread.h"
6 6
7 #include "vm/dart_api_state.h" 7 #include "vm/dart_api_state.h"
8 #include "vm/growable_array.h" 8 #include "vm/growable_array.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/lockers.h" 10 #include "vm/lockers.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 void Thread::ClearStackLimit() { 325 void Thread::ClearStackLimit() {
326 SetStackLimit(~static_cast<uword>(0)); 326 SetStackLimit(~static_cast<uword>(0));
327 } 327 }
328 328
329 329
330 /* static */ 330 /* static */
331 uword Thread::GetCurrentStackPointer() { 331 uword Thread::GetCurrentStackPointer() {
332 // Since AddressSanitizer's detect_stack_use_after_return instruments the 332 // Since AddressSanitizer's detect_stack_use_after_return instruments the
333 // C++ code to give out fake stack addresses, we call a stub in that case. 333 // C++ code to give out fake stack addresses, we call a stub in that case.
334 ASSERT(StubCode::GetStackPointer_entry() != NULL);
334 uword (*func)() = reinterpret_cast<uword (*)()>( 335 uword (*func)() = reinterpret_cast<uword (*)()>(
335 StubCode::GetStackPointer_entry()->EntryPoint()); 336 StubCode::GetStackPointer_entry()->EntryPoint());
336 // But for performance (and to support simulators), we normally use a local. 337 // But for performance (and to support simulators), we normally use a local.
337 #if defined(__has_feature) 338 #if defined(__has_feature)
338 #if __has_feature(address_sanitizer) 339 #if __has_feature(address_sanitizer)
339 uword current_sp = func(); 340 uword current_sp = func();
340 return current_sp; 341 return current_sp;
341 #else 342 #else
342 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); 343 uword stack_allocated_local_address = reinterpret_cast<uword>(&func);
343 return stack_allocated_local_address; 344 return stack_allocated_local_address;
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 704
704 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { 705 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() {
705 if (thread() != NULL) { 706 if (thread() != NULL) {
706 OSThread* os_thread = thread()->os_thread(); 707 OSThread* os_thread = thread()->os_thread();
707 ASSERT(os_thread != NULL); 708 ASSERT(os_thread != NULL);
708 os_thread->EnableThreadInterrupts(); 709 os_thread->EnableThreadInterrupts();
709 } 710 }
710 } 711 }
711 712
712 } // namespace dart 713 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/thread_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698