| OLD | NEW |
| 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/compiler_stats.h" | 7 #include "vm/compiler_stats.h" |
| 8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
| 9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 void Thread::ClearStackLimit() { | 438 void Thread::ClearStackLimit() { |
| 439 SetStackLimit(~static_cast<uword>(0)); | 439 SetStackLimit(~static_cast<uword>(0)); |
| 440 } | 440 } |
| 441 | 441 |
| 442 | 442 |
| 443 /* static */ | 443 /* static */ |
| 444 uword Thread::GetCurrentStackPointer() { | 444 uword Thread::GetCurrentStackPointer() { |
| 445 #if !defined(TARGET_ARCH_DBC) | 445 #if !defined(TARGET_ARCH_DBC) |
| 446 // Since AddressSanitizer's detect_stack_use_after_return instruments the | 446 // Since AddressSanitizer's detect_stack_use_after_return instruments the |
| 447 // C++ code to give out fake stack addresses, we call a stub in that case. | 447 // C++ code to give out fake stack addresses, we call a stub in that case. |
| 448 ASSERT(StubCode::GetStackPointer_entry() != NULL); | 448 ASSERT(StubCode::GetCStackPointer_entry() != NULL); |
| 449 uword (*func)() = reinterpret_cast<uword (*)()>( | 449 uword (*func)() = reinterpret_cast<uword (*)()>( |
| 450 StubCode::GetStackPointer_entry()->EntryPoint()); | 450 StubCode::GetCStackPointer_entry()->EntryPoint()); |
| 451 #else | 451 #else |
| 452 uword (*func)() = NULL; | 452 uword (*func)() = NULL; |
| 453 #endif | 453 #endif |
| 454 // But for performance (and to support simulators), we normally use a local. | 454 // But for performance (and to support simulators), we normally use a local. |
| 455 #if defined(__has_feature) | 455 #if defined(__has_feature) |
| 456 #if __has_feature(address_sanitizer) || __has_feature(safe_stack) | 456 #if __has_feature(address_sanitizer) || __has_feature(safe_stack) |
| 457 uword current_sp = func(); | 457 uword current_sp = func(); |
| 458 return current_sp; | 458 return current_sp; |
| 459 #else | 459 #else |
| 460 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); | 460 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 | 923 |
| 924 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { | 924 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { |
| 925 if (thread() != NULL) { | 925 if (thread() != NULL) { |
| 926 OSThread* os_thread = thread()->os_thread(); | 926 OSThread* os_thread = thread()->os_thread(); |
| 927 ASSERT(os_thread != NULL); | 927 ASSERT(os_thread != NULL); |
| 928 os_thread->EnableThreadInterrupts(); | 928 os_thread->EnableThreadInterrupts(); |
| 929 } | 929 } |
| 930 } | 930 } |
| 931 | 931 |
| 932 } // namespace dart | 932 } // namespace dart |
| OLD | NEW |