Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Side by Side Diff: runtime/vm/profiler.cc

Issue 2990393002: [vm] Make the crash reporter more resilient to crashes during safepoints. (Closed)
Patch Set: . Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // Only attempt to symbolize Dart frames if we can safely iterate the
414 return; 414 // current isolate's heap.
415 } 415 Code& code = Code::Handle(Code::LookupCodeInVmIsolate(pc));
416 code = Code::LookupCode(pc); 416 if (!code.IsNull()) {
417 if (!code.IsNull()) { 417 code = Code::LookupCode(pc); // In current isolate.
418 OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName()); 418 }
419 return; 419 if (!code.IsNull()) {
420 OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName());
421 return;
422 }
420 } 423 }
421 } 424 }
422 425
423 uintptr_t start = 0; 426 uintptr_t start = 0;
424 char* native_symbol_name = NativeSymbolResolver::LookupSymbolName(pc, &start); 427 char* native_symbol_name = NativeSymbolResolver::LookupSymbolName(pc, &start);
425 if (native_symbol_name == NULL) { 428 if (native_symbol_name == NULL) {
426 OS::PrintErr(" [0x%" Pp "] Unknown symbol\n", pc); 429 OS::PrintErr(" [0x%" Pp "] Unknown symbol\n", pc);
427 } else { 430 } else {
428 OS::PrintErr(" [0x%" Pp "] %s\n", pc, native_symbol_name); 431 OS::PrintErr(" [0x%" Pp "] %s\n", pc, native_symbol_name);
429 NativeSymbolResolver::FreeSymbolName(native_symbol_name); 432 NativeSymbolResolver::FreeSymbolName(native_symbol_name);
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 } 1687 }
1685 1688
1686 ProcessedSampleBuffer::ProcessedSampleBuffer() 1689 ProcessedSampleBuffer::ProcessedSampleBuffer()
1687 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { 1690 : code_lookup_table_(new CodeLookupTable(Thread::Current())) {
1688 ASSERT(code_lookup_table_ != NULL); 1691 ASSERT(code_lookup_table_ != NULL);
1689 } 1692 }
1690 1693
1691 #endif // !PRODUCT 1694 #endif // !PRODUCT
1692 1695
1693 } // namespace dart 1696 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698