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

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

Issue 915723002: Make ASAN/MSAN ignore Dart frames. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 return false; 401 return false;
402 } 402 }
403 // Success, update fp and pc. 403 // Success, update fp and pc.
404 fp_ = new_fp; 404 fp_ = new_fp;
405 pc_ = CallerPC(); 405 pc_ = CallerPC();
406 return true; 406 return true;
407 } 407 }
408 408
409 uword InitialReturnAddress() const { 409 uword InitialReturnAddress() const {
410 ASSERT(sp_ != NULL); 410 ASSERT(sp_ != NULL);
411 // MSan/ASan are unaware of frames initialized by generated code.
412 MSAN_UNPOISON(sp_, kWordSize);
413 ASAN_UNPOISON(sp_, kWordSize);
411 return *(sp_); 414 return *(sp_);
412 } 415 }
413 416
414 uword* CallerPC() const { 417 uword* CallerPC() const {
415 ASSERT(fp_ != NULL); 418 ASSERT(fp_ != NULL);
416 return reinterpret_cast<uword*>(*(fp_ + kSavedCallerPcSlotFromFp)); 419 uword* caller_pc_ptr = fp_ + kSavedCallerPcSlotFromFp;
420 // MSan/ASan are unaware of frames initialized by generated code.
421 MSAN_UNPOISON(caller_pc_ptr, kWordSize);
422 ASAN_UNPOISON(caller_pc_ptr, kWordSize);
423 return reinterpret_cast<uword*>(*caller_pc_ptr);
417 } 424 }
418 425
419 uword* CallerFP() const { 426 uword* CallerFP() const {
420 ASSERT(fp_ != NULL); 427 ASSERT(fp_ != NULL);
421 return reinterpret_cast<uword*>(*(fp_ + kSavedCallerFpSlotFromFp)); 428 uword* caller_fp_ptr = fp_ + kSavedCallerFpSlotFromFp;
429 // MSan/ASan are unaware of frames initialized by generated code.
430 MSAN_UNPOISON(caller_fp_ptr, kWordSize);
431 ASAN_UNPOISON(caller_fp_ptr, kWordSize);
432 return reinterpret_cast<uword*>(*caller_fp_ptr);
422 } 433 }
423 434
424 uword* ExitLink() const { 435 uword* ExitLink() const {
425 ASSERT(fp_ != NULL); 436 ASSERT(fp_ != NULL);
426 return reinterpret_cast<uword*>(*(fp_ + kExitLinkSlotFromEntryFp)); 437 uword* exit_link_ptr = fp_ + kExitLinkSlotFromEntryFp;
438 // MSan/ASan are unaware of frames initialized by generated code.
439 MSAN_UNPOISON(exit_link_ptr, kWordSize);
440 ASAN_UNPOISON(exit_link_ptr, kWordSize);
441 return reinterpret_cast<uword*>(*exit_link_ptr);
427 } 442 }
428 443
429 bool ValidFramePointer() const { 444 bool ValidFramePointer() const {
430 return ValidFramePointer(fp_); 445 return ValidFramePointer(fp_);
431 } 446 }
432 447
433 bool ValidFramePointer(uword* fp) const { 448 bool ValidFramePointer(uword* fp) const {
434 if (fp == NULL) { 449 if (fp == NULL) {
435 return false; 450 return false;
436 } 451 }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 state.pc, 729 state.pc,
715 state.fp, 730 state.fp,
716 sp); 731 sp);
717 stackWalker.walk(); 732 stackWalker.walk();
718 #endif 733 #endif
719 } 734 }
720 } 735 }
721 } 736 }
722 737
723 } // namespace dart 738 } // 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