OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1804 matching lines...) Loading... |
1815 | 1815 |
1816 void CheckpointObjectStats(); | 1816 void CheckpointObjectStats(); |
1817 | 1817 |
1818 // We don't use a ScopedLock here since we want to lock the heap | 1818 // We don't use a ScopedLock here since we want to lock the heap |
1819 // only when FLAG_parallel_recompilation is true. | 1819 // only when FLAG_parallel_recompilation is true. |
1820 class RelocationLock { | 1820 class RelocationLock { |
1821 public: | 1821 public: |
1822 explicit RelocationLock(Heap* heap) : heap_(heap) { | 1822 explicit RelocationLock(Heap* heap) : heap_(heap) { |
1823 if (FLAG_parallel_recompilation) { | 1823 if (FLAG_parallel_recompilation) { |
1824 heap_->relocation_mutex_->Lock(); | 1824 heap_->relocation_mutex_->Lock(); |
| 1825 #ifdef DEBUG |
| 1826 heap_->relocation_mutex_locked_ = true; |
| 1827 #endif // DEBUG |
1825 } | 1828 } |
1826 } | 1829 } |
| 1830 |
1827 ~RelocationLock() { | 1831 ~RelocationLock() { |
1828 if (FLAG_parallel_recompilation) { | 1832 if (FLAG_parallel_recompilation) { |
| 1833 #ifdef DEBUG |
| 1834 heap_->relocation_mutex_locked_ = false; |
| 1835 #endif // DEBUG |
1829 heap_->relocation_mutex_->Unlock(); | 1836 heap_->relocation_mutex_->Unlock(); |
1830 } | 1837 } |
1831 } | 1838 } |
1832 | 1839 |
| 1840 #ifdef DEBUG |
| 1841 static bool IsLocked(Heap* heap) { |
| 1842 return heap->relocation_mutex_locked_; |
| 1843 } |
| 1844 #endif // DEBUG |
| 1845 |
1833 private: | 1846 private: |
1834 Heap* heap_; | 1847 Heap* heap_; |
1835 }; | 1848 }; |
1836 | 1849 |
1837 private: | 1850 private: |
1838 Heap(); | 1851 Heap(); |
1839 | 1852 |
1840 // This can be calculated directly from a pointer to the heap; however, it is | 1853 // This can be calculated directly from a pointer to the heap; however, it is |
1841 // more expedient to get at the isolate directly from within Heap methods. | 1854 // more expedient to get at the isolate directly from within Heap methods. |
1842 Isolate* isolate_; | 1855 Isolate* isolate_; |
(...skipping 454 matching lines...) Loading... |
2297 | 2310 |
2298 ExternalStringTable external_string_table_; | 2311 ExternalStringTable external_string_table_; |
2299 | 2312 |
2300 ErrorObjectList error_object_list_; | 2313 ErrorObjectList error_object_list_; |
2301 | 2314 |
2302 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; | 2315 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; |
2303 | 2316 |
2304 MemoryChunk* chunks_queued_for_free_; | 2317 MemoryChunk* chunks_queued_for_free_; |
2305 | 2318 |
2306 Mutex* relocation_mutex_; | 2319 Mutex* relocation_mutex_; |
| 2320 #ifdef DEBUG |
| 2321 bool relocation_mutex_locked_; |
| 2322 #endif // DEBUG; |
2307 | 2323 |
2308 friend class Factory; | 2324 friend class Factory; |
2309 friend class GCTracer; | 2325 friend class GCTracer; |
2310 friend class DisallowAllocationFailure; | 2326 friend class DisallowAllocationFailure; |
2311 friend class AlwaysAllocateScope; | 2327 friend class AlwaysAllocateScope; |
2312 friend class Page; | 2328 friend class Page; |
2313 friend class Isolate; | 2329 friend class Isolate; |
2314 friend class MarkCompactCollector; | 2330 friend class MarkCompactCollector; |
2315 friend class MarkCompactMarkingVisitor; | 2331 friend class MarkCompactMarkingVisitor; |
2316 friend class MapCompact; | 2332 friend class MapCompact; |
(...skipping 686 matching lines...) Loading... |
3003 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 3019 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
3004 | 3020 |
3005 private: | 3021 private: |
3006 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3022 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
3007 }; | 3023 }; |
3008 #endif // DEBUG | 3024 #endif // DEBUG |
3009 | 3025 |
3010 } } // namespace v8::internal | 3026 } } // namespace v8::internal |
3011 | 3027 |
3012 #endif // V8_HEAP_H_ | 3028 #endif // V8_HEAP_H_ |
OLD | NEW |