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

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

Issue 794223003: Cheaper thread-safe atomic initialization of static references. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add type check for initial value Created 5 years, 11 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
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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 // heap the containing heap page is returned. 466 // heap the containing heap page is returned.
467 BaseHeapPage* findPageFromAddress(Address); 467 BaseHeapPage* findPageFromAddress(Address);
468 BaseHeapPage* findPageFromAddress(void* pointer) { return findPageFromAddres s(reinterpret_cast<Address>(pointer)); } 468 BaseHeapPage* findPageFromAddress(void* pointer) { return findPageFromAddres s(reinterpret_cast<Address>(pointer)); }
469 #endif 469 #endif
470 470
471 // List of persistent roots allocated on the given thread. 471 // List of persistent roots allocated on the given thread.
472 PersistentNode* roots() const { return m_persistents.get(); } 472 PersistentNode* roots() const { return m_persistents.get(); }
473 473
474 // List of global persistent roots not owned by any particular thread. 474 // List of global persistent roots not owned by any particular thread.
475 // globalRootsMutex must be acquired before any modifications. 475 // globalRootsMutex must be acquired before any modifications.
476 static PersistentNode* globalRoots(); 476 static PersistentNode& globalRoots();
477 static Mutex& globalRootsMutex(); 477 static Mutex& globalRootsMutex();
478 478
479 // Visit local thread stack and trace all pointers conservatively. 479 // Visit local thread stack and trace all pointers conservatively.
480 void visitStack(Visitor*); 480 void visitStack(Visitor*);
481 481
482 // Visit the asan fake stack frame corresponding to a slot on the 482 // Visit the asan fake stack frame corresponding to a slot on the
483 // real machine stack if there is one. 483 // real machine stack if there is one.
484 void visitAsanFakeStackForPointer(Visitor*, Address); 484 void visitAsanFakeStackForPointer(Visitor*, Address);
485 485
486 // Visit all persistents allocated on this thread. 486 // Visit all persistents allocated on this thread.
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 m_locked = false; 719 m_locked = false;
720 } 720 }
721 721
722 MutexBase& m_mutex; 722 MutexBase& m_mutex;
723 bool m_locked; 723 bool m_locked;
724 }; 724 };
725 725
726 } // namespace blink 726 } // namespace blink
727 727
728 #endif // ThreadState_h 728 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698