| 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 uintptr_t started_dump = 0; |
| 954 if (AtomicOperations::FetchAndIncrement(&started_dump) != 0) { |
| 955 OS::PrintErr("Aborting re-entrant request for stack trace.\n"); |
| 956 return; |
| 957 } |
| 958 |
| 951 Thread* thread = Thread::Current(); | 959 Thread* thread = Thread::Current(); |
| 952 if (thread == NULL) { | 960 if (thread == NULL) { |
| 953 return; | 961 return; |
| 954 } | 962 } |
| 955 OSThread* os_thread = thread->os_thread(); | 963 OSThread* os_thread = thread->os_thread(); |
| 956 ASSERT(os_thread != NULL); | 964 ASSERT(os_thread != NULL); |
| 957 Isolate* isolate = thread->isolate(); | 965 Isolate* isolate = thread->isolate(); |
| 958 if (!CheckIsolate(isolate)) { | 966 if (!CheckIsolate(isolate)) { |
| 959 return; | 967 return; |
| 960 } | 968 } |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1581 | 1589 |
| 1582 | 1590 |
| 1583 ProcessedSampleBuffer::ProcessedSampleBuffer() | 1591 ProcessedSampleBuffer::ProcessedSampleBuffer() |
| 1584 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 1592 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { |
| 1585 ASSERT(code_lookup_table_ != NULL); | 1593 ASSERT(code_lookup_table_ != NULL); |
| 1586 } | 1594 } |
| 1587 | 1595 |
| 1588 #endif // !PRODUCT | 1596 #endif // !PRODUCT |
| 1589 | 1597 |
| 1590 } // namespace dart | 1598 } // namespace dart |
| OLD | NEW |