Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "platform/address_sanitizer.h" | 5 #include "platform/address_sanitizer.h" |
| 6 #include "platform/memory_sanitizer.h" | 6 #include "platform/memory_sanitizer.h" |
| 7 #include "platform/utils.h" | 7 #include "platform/utils.h" |
| 8 | 8 |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 941 } | 941 } |
| 942 #else | 942 #else |
| 943 static uintptr_t __attribute__((noinline)) GetProgramCounter() { | 943 static uintptr_t __attribute__((noinline)) GetProgramCounter() { |
| 944 return reinterpret_cast<uintptr_t>( | 944 return reinterpret_cast<uintptr_t>( |
| 945 __builtin_extract_return_addr(__builtin_return_address(0))); | 945 __builtin_extract_return_addr(__builtin_return_address(0))); |
| 946 } | 946 } |
| 947 #endif | 947 #endif |
| 948 | 948 |
| 949 | 949 |
| 950 void Profiler::DumpStackTrace(bool native_stack_trace) { | 950 void Profiler::DumpStackTrace(bool native_stack_trace) { |
| 951 // Allow only one stack trace to prevent recursively printing stack traces if | |
| 952 // we hit an assert while printing the stack. | |
| 953 static bool started_dump = false; | |
|
zra
2016/08/10 17:52:27
It probably doesn't matter that this is not thread
rmacnak
2016/08/11 00:08:02
Done.
| |
| 954 if (started_dump) { | |
| 955 OS::PrintErr("Aborting re-entrant request for stack trace.\n"); | |
| 956 return; | |
| 957 } | |
| 958 started_dump = true; | |
| 959 | |
| 951 Thread* thread = Thread::Current(); | 960 Thread* thread = Thread::Current(); |
| 952 if (thread == NULL) { | 961 if (thread == NULL) { |
| 953 return; | 962 return; |
| 954 } | 963 } |
| 955 OSThread* os_thread = thread->os_thread(); | 964 OSThread* os_thread = thread->os_thread(); |
| 956 ASSERT(os_thread != NULL); | 965 ASSERT(os_thread != NULL); |
| 957 Isolate* isolate = thread->isolate(); | 966 Isolate* isolate = thread->isolate(); |
| 958 if (!CheckIsolate(isolate)) { | 967 if (!CheckIsolate(isolate)) { |
| 959 return; | 968 return; |
| 960 } | 969 } |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1581 | 1590 |
| 1582 | 1591 |
| 1583 ProcessedSampleBuffer::ProcessedSampleBuffer() | 1592 ProcessedSampleBuffer::ProcessedSampleBuffer() |
| 1584 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 1593 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { |
| 1585 ASSERT(code_lookup_table_ != NULL); | 1594 ASSERT(code_lookup_table_ != NULL); |
| 1586 } | 1595 } |
| 1587 | 1596 |
| 1588 #endif // !PRODUCT | 1597 #endif // !PRODUCT |
| 1589 | 1598 |
| 1590 } // namespace dart | 1599 } // namespace dart |
| OLD | NEW |