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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Thread* thread = Thread::Current(); | 951 Thread* thread = Thread::Current(); |
952 ASSERT(thread != NULL); | 952 if (thread == NULL) { |
| 953 return; |
| 954 } |
953 OSThread* os_thread = thread->os_thread(); | 955 OSThread* os_thread = thread->os_thread(); |
954 ASSERT(os_thread != NULL); | 956 ASSERT(os_thread != NULL); |
955 Isolate* isolate = thread->isolate(); | 957 Isolate* isolate = thread->isolate(); |
956 if (!CheckIsolate(isolate)) { | 958 if (!CheckIsolate(isolate)) { |
957 return; | 959 return; |
958 } | 960 } |
959 | 961 |
960 const bool exited_dart_code = thread->HasExitedDartCode(); | 962 const bool exited_dart_code = thread->HasExitedDartCode(); |
961 | 963 |
962 OS::PrintErr("Dumping %s stack trace for thread %" Px "\n", | 964 OS::PrintErr("Dumping %s stack trace for thread %" Px "\n", |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 | 1581 |
1580 | 1582 |
1581 ProcessedSampleBuffer::ProcessedSampleBuffer() | 1583 ProcessedSampleBuffer::ProcessedSampleBuffer() |
1582 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 1584 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { |
1583 ASSERT(code_lookup_table_ != NULL); | 1585 ASSERT(code_lookup_table_ != NULL); |
1584 } | 1586 } |
1585 | 1587 |
1586 #endif // !PRODUCT | 1588 #endif // !PRODUCT |
1587 | 1589 |
1588 } // namespace dart | 1590 } // namespace dart |
OLD | NEW |