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

Side by Side Diff: Source/platform/heap/Heap.cpp

Issue 556443003: Oilpan: Fix ASan instrumentation around heap object headers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 ThreadState::resumeThreads(); 405 ThreadState::resumeThreads();
406 } 406 }
407 } 407 }
408 408
409 private: 409 private:
410 ThreadState* m_state; 410 ThreadState* m_state;
411 ThreadState::SafePointScope m_safePointScope; 411 ThreadState::SafePointScope m_safePointScope;
412 bool m_parkedAllThreads; // False if we fail to park all threads 412 bool m_parkedAllThreads; // False if we fail to park all threads
413 }; 413 };
414 414
415 NO_SANITIZE_ADDRESS
415 bool HeapObjectHeader::isMarked() const 416 bool HeapObjectHeader::isMarked() const
416 { 417 {
417 checkHeader(); 418 checkHeader();
418 // We need to unpoison/poison the header on ASAN since 419 #if defined(ADDRESS_SANITIZER)
zerny-chromium 2014/09/09 06:01:28 ditto
Mads Ager (chromium) 2014/09/09 08:22:14 Done
419 // acquireLoad doesn't have the NO_SANITIZE_ADDRESS flag. 420 unsigned size = asanAcquireLoad(&m_size);
420 ASAN_UNPOISON_MEMORY_REGION(this, sizeof(this)); 421 #else
421 unsigned size = acquireLoad(&m_size); 422 unsigned size = acquireLoad(&m_size);
422 ASAN_POISON_MEMORY_REGION(this, sizeof(this)); 423 #endif
423 return size & markBitMask; 424 return size & markBitMask;
424 } 425 }
425 426
426 NO_SANITIZE_ADDRESS 427 NO_SANITIZE_ADDRESS
427 void HeapObjectHeader::unmark() 428 void HeapObjectHeader::unmark()
428 { 429 {
429 checkHeader(); 430 checkHeader();
430 m_size &= ~markBitMask; 431 m_size &= ~markBitMask;
431 } 432 }
432 433
(...skipping 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after
2846 CallbackStack* Heap::s_markingStack; 2847 CallbackStack* Heap::s_markingStack;
2847 CallbackStack* Heap::s_postMarkingCallbackStack; 2848 CallbackStack* Heap::s_postMarkingCallbackStack;
2848 CallbackStack* Heap::s_weakCallbackStack; 2849 CallbackStack* Heap::s_weakCallbackStack;
2849 CallbackStack* Heap::s_ephemeronStack; 2850 CallbackStack* Heap::s_ephemeronStack;
2850 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; 2851 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache;
2851 bool Heap::s_shutdownCalled = false; 2852 bool Heap::s_shutdownCalled = false;
2852 bool Heap::s_lastGCWasConservative = false; 2853 bool Heap::s_lastGCWasConservative = false;
2853 FreePagePool* Heap::s_freePagePool; 2854 FreePagePool* Heap::s_freePagePool;
2854 OrphanedPagePool* Heap::s_orphanedPagePool; 2855 OrphanedPagePool* Heap::s_orphanedPagePool;
2855 } 2856 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698