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

Side by Side Diff: Source/heap/ThreadState.h

Issue 141713008: Use new ASAN APIs for scanning ASAN fake stacks during garbage collection. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Minor style changes. Created 6 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
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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 // corresponding to a given address. Return 0 if the address is 419 // corresponding to a given address. Return 0 if the address is
420 // not contained in any of the pages. 420 // not contained in any of the pages.
421 BaseHeapPage* heapPageFromAddress(Address); 421 BaseHeapPage* heapPageFromAddress(Address);
422 422
423 // List of persistent roots allocated on the given thread. 423 // List of persistent roots allocated on the given thread.
424 PersistentNode* roots() const { return m_persistents; } 424 PersistentNode* roots() const { return m_persistents; }
425 425
426 // Visit local thread stack and trace all pointers conservatively. 426 // Visit local thread stack and trace all pointers conservatively.
427 void visitStack(Visitor*); 427 void visitStack(Visitor*);
428 428
429 #if defined(ADDRESS_SANITIZER) && !OS(WIN)
430 // Visit the asan fake stack frame corresponding to a slot on the
431 // real machine stack if there is one.
432 void visitAsanFakeStackForPointer(Visitor*, Address);
433 #endif
434
429 // Visit all persistents allocated on this thread. 435 // Visit all persistents allocated on this thread.
430 void visitPersistents(Visitor*); 436 void visitPersistents(Visitor*);
431 437
432 // Checks a given address and if a pointer into the oilpan heap marks 438 // Checks a given address and if a pointer into the oilpan heap marks
433 // the object to which it points. 439 // the object to which it points.
434 bool checkAndMarkPointer(Visitor*, Address); 440 bool checkAndMarkPointer(Visitor*, Address);
435 441
436 void getStats(HeapStats&); 442 void getStats(HeapStats&);
437 HeapStats& stats() { return m_stats; } 443 HeapStats& stats() { return m_stats; }
438 HeapStats& statsAfterLastGC() { return m_statsAfterLastGC; } 444 HeapStats& statsAfterLastGC() { return m_statsAfterLastGC; }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 Vector<Interruptor*> m_interruptors; 486 Vector<Interruptor*> m_interruptors;
481 bool m_gcRequested; 487 bool m_gcRequested;
482 volatile int m_sweepRequested; 488 volatile int m_sweepRequested;
483 bool m_sweepInProgress; 489 bool m_sweepInProgress;
484 size_t m_noAllocationCount; 490 size_t m_noAllocationCount;
485 bool m_inGC; 491 bool m_inGC;
486 BaseHeap* m_heaps[NumberOfHeaps]; 492 BaseHeap* m_heaps[NumberOfHeaps];
487 HeapContainsCache* m_heapContainsCache; 493 HeapContainsCache* m_heapContainsCache;
488 HeapStats m_stats; 494 HeapStats m_stats;
489 HeapStats m_statsAfterLastGC; 495 HeapStats m_statsAfterLastGC;
496 #if defined(ADDRESS_SANITIZER) && !OS(WIN)
kcc1 2014/02/06 13:44:06 Why !OS(WIN)? asan will be available on Windows ev
Mads Ager (chromium) 2014/02/06 14:15:17 SyZyAsan uses the same define and they do not have
497 void* m_asanFakeStack;
498 #endif
490 }; 499 };
491 500
492 template<ThreadAffinity affinity> class ThreadStateFor; 501 template<ThreadAffinity affinity> class ThreadStateFor;
493 502
494 template<> class ThreadStateFor<MainThreadOnly> { 503 template<> class ThreadStateFor<MainThreadOnly> {
495 public: 504 public:
496 static ThreadState* state() 505 static ThreadState* state()
497 { 506 {
498 // This specialization must only be used from the main thread. 507 // This specialization must only be used from the main thread.
499 ASSERT(ThreadState::isMainThread()); 508 ASSERT(ThreadState::isMainThread());
500 return ThreadState::mainThreadState(); 509 return ThreadState::mainThreadState();
501 } 510 }
502 }; 511 };
503 512
504 template<> class ThreadStateFor<AnyThread> { 513 template<> class ThreadStateFor<AnyThread> {
505 public: 514 public:
506 static ThreadState* state() { return ThreadState::current(); } 515 static ThreadState* state() { return ThreadState::current(); }
507 }; 516 };
508 517
509 } 518 }
510 519
511 #endif // ThreadState_h 520 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698