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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 399 } | 399 } |
| 400 | 400 |
| 401 ClearProfileVisitor::ClearProfileVisitor(Isolate* isolate) | 401 ClearProfileVisitor::ClearProfileVisitor(Isolate* isolate) |
| 402 : SampleVisitor(isolate->main_port()) {} | 402 : SampleVisitor(isolate->main_port()) {} |
| 403 | 403 |
| 404 void ClearProfileVisitor::VisitSample(Sample* sample) { | 404 void ClearProfileVisitor::VisitSample(Sample* sample) { |
| 405 sample->Clear(); | 405 sample->Clear(); |
| 406 } | 406 } |
| 407 | 407 |
| 408 static void DumpStackFrame(intptr_t frame_index, uword pc) { | 408 static void DumpStackFrame(intptr_t frame_index, uword pc) { |
| 409 Isolate* isolate = Isolate::Current(); | 409 Thread* thread = Thread::Current(); |
| 410 if ((isolate != NULL) && isolate->is_runnable()) { | 410 if ((thread != NULL) && !thread->IsAtSafepoint()) { |
| 411 Code& code = Code::Handle(Code::LookupCodeInVmIsolate(pc)); | 411 Isolate* isolate = thread->isolate(); |
| 412 if (!code.IsNull()) { | 412 if ((isolate != NULL) && isolate->is_runnable()) { |
| 413 OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName()); | 413 // Attempt to symbolize Dart frames if we have can safely iterate the |
| 414 return; | 414 // current isolate's heap. |
|
danunez
2017/08/08 20:44:02
This comment is unclear to me. It reads like there
rmacnak
2017/08/09 17:58:39
Deleted "have"
| |
| 415 } | 415 Code& code = Code::Handle(Code::LookupCodeInVmIsolate(pc)); |
| 416 code = Code::LookupCode(pc); | 416 if (!code.IsNull()) { |
| 417 if (!code.IsNull()) { | 417 OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName()); |
| 418 OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName()); | 418 return; |
| 419 return; | 419 } |
| 420 code = Code::LookupCode(pc); | |
| 421 if (!code.IsNull()) { | |
| 422 OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName()); | |
| 423 return; | |
| 424 } | |
|
siva
2017/08/08 23:59:55
why not
Code& code = Code::Handle(Code::LookupCo
rmacnak
2017/08/09 17:58:39
Done.
| |
| 420 } | 425 } |
| 421 } | 426 } |
| 422 | 427 |
| 423 uintptr_t start = 0; | 428 uintptr_t start = 0; |
| 424 char* native_symbol_name = NativeSymbolResolver::LookupSymbolName(pc, &start); | 429 char* native_symbol_name = NativeSymbolResolver::LookupSymbolName(pc, &start); |
| 425 if (native_symbol_name == NULL) { | 430 if (native_symbol_name == NULL) { |
| 426 OS::PrintErr(" [0x%" Pp "] Unknown symbol\n", pc); | 431 OS::PrintErr(" [0x%" Pp "] Unknown symbol\n", pc); |
| 427 } else { | 432 } else { |
| 428 OS::PrintErr(" [0x%" Pp "] %s\n", pc, native_symbol_name); | 433 OS::PrintErr(" [0x%" Pp "] %s\n", pc, native_symbol_name); |
| 429 NativeSymbolResolver::FreeSymbolName(native_symbol_name); | 434 NativeSymbolResolver::FreeSymbolName(native_symbol_name); |
| (...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1684 } | 1689 } |
| 1685 | 1690 |
| 1686 ProcessedSampleBuffer::ProcessedSampleBuffer() | 1691 ProcessedSampleBuffer::ProcessedSampleBuffer() |
| 1687 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 1692 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { |
| 1688 ASSERT(code_lookup_table_ != NULL); | 1693 ASSERT(code_lookup_table_ != NULL); |
| 1689 } | 1694 } |
| 1690 | 1695 |
| 1691 #endif // !PRODUCT | 1696 #endif // !PRODUCT |
| 1692 | 1697 |
| 1693 } // namespace dart | 1698 } // namespace dart |
| OLD | NEW |