OLD | NEW |
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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 // | 460 // |
461 // The heap is split into multiple heap parts based on object | 461 // The heap is split into multiple heap parts based on object |
462 // types. To get the index for a given type, use | 462 // types. To get the index for a given type, use |
463 // HeapTrait<Type>::index. | 463 // HeapTrait<Type>::index. |
464 BaseHeap* heap(int index) const { return m_heaps[index]; } | 464 BaseHeap* heap(int index) const { return m_heaps[index]; } |
465 | 465 |
466 // Infrastructure to determine if an address is within one of the | 466 // Infrastructure to determine if an address is within one of the |
467 // address ranges for the Blink heap. If the address is in the Blink | 467 // address ranges for the Blink heap. If the address is in the Blink |
468 // heap the containing heap page is returned. | 468 // heap the containing heap page is returned. |
469 HeapContainsCache* heapContainsCache() { return m_heapContainsCache.get(); } | 469 HeapContainsCache* heapContainsCache() { return m_heapContainsCache.get(); } |
470 BaseHeapPage* contains(Address); | 470 BaseHeapPage* contains(Address address) { return heapPageFromAddress(address
); } |
471 BaseHeapPage* contains(void* pointer) { return contains(reinterpret_cast<Add
ress>(pointer)); } | 471 BaseHeapPage* contains(void* pointer) { return contains(reinterpret_cast<Add
ress>(pointer)); } |
472 BaseHeapPage* contains(const void* pointer) { return contains(const_cast<voi
d*>(pointer)); } | 472 BaseHeapPage* contains(const void* pointer) { return contains(const_cast<voi
d*>(pointer)); } |
473 | 473 |
474 // List of persistent roots allocated on the given thread. | 474 // List of persistent roots allocated on the given thread. |
475 PersistentNode* roots() const { return m_persistents.get(); } | 475 PersistentNode* roots() const { return m_persistents.get(); } |
476 | 476 |
477 // List of global persistent roots not owned by any particular thread. | 477 // List of global persistent roots not owned by any particular thread. |
478 // globalRootsMutex must be acquired before any modifications. | 478 // globalRootsMutex must be acquired before any modifications. |
479 static PersistentNode* globalRoots(); | 479 static PersistentNode* globalRoots(); |
480 static Mutex& globalRootsMutex(); | 480 static Mutex& globalRootsMutex(); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 }; | 596 }; |
597 | 597 |
598 template<> class ThreadStateFor<AnyThread> { | 598 template<> class ThreadStateFor<AnyThread> { |
599 public: | 599 public: |
600 static ThreadState* state() { return ThreadState::current(); } | 600 static ThreadState* state() { return ThreadState::current(); } |
601 }; | 601 }; |
602 | 602 |
603 } | 603 } |
604 | 604 |
605 #endif // ThreadState_h | 605 #endif // ThreadState_h |
OLD | NEW |