Chromium Code Reviews| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 void processMarkingStack(Visitor*); | 428 void processMarkingStack(Visitor*); |
| 429 void postMarkingProcessing(Visitor*); | 429 void postMarkingProcessing(Visitor*); |
| 430 void globalWeakProcessing(Visitor*); | 430 void globalWeakProcessing(Visitor*); |
| 431 | 431 |
| 432 void preGC(); | 432 void preGC(); |
| 433 void postGC(BlinkGC::GCType); | 433 void postGC(BlinkGC::GCType); |
| 434 | 434 |
| 435 // Conservatively checks whether an address is a pointer in any of the | 435 // Conservatively checks whether an address is a pointer in any of the |
| 436 // thread heaps. If so marks the object pointed to as live. | 436 // thread heaps. If so marks the object pointed to as live. |
| 437 Address checkAndMarkPointer(Visitor*, Address); | 437 Address checkAndMarkPointer(Visitor*, Address); |
| 438 #if DCHECK_IS_ON() | |
| 439 Address checkAndMarkPointer(Visitor*, Address, MarkedPointerCallback); | |
| 440 #endif | |
| 438 | 441 |
| 439 size_t objectPayloadSizeForTesting(); | 442 size_t objectPayloadSizeForTesting(); |
| 440 | 443 |
| 441 void flushHeapDoesNotContainCache(); | 444 void flushHeapDoesNotContainCache(); |
| 442 | 445 |
| 443 FreePagePool* getFreePagePool() { return m_freePagePool.get(); } | 446 FreePagePool* getFreePagePool() { return m_freePagePool.get(); } |
| 444 OrphanedPagePool* getOrphanedPagePool() { return m_orphanedPagePool.get(); } | 447 OrphanedPagePool* getOrphanedPagePool() { return m_orphanedPagePool.get(); } |
| 445 | 448 |
| 446 // This look-up uses the region search tree and a negative contains cache to | 449 // This look-up uses the region search tree and a negative contains cache to |
| 447 // provide an efficient mapping from arbitrary addresses to the containing | 450 // provide an efficient mapping from arbitrary addresses to the containing |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 685 address = ThreadHeap::allocateOnArenaIndex(state, size, arenaIndex, | 688 address = ThreadHeap::allocateOnArenaIndex(state, size, arenaIndex, |
| 686 gcInfoIndex, typeName); | 689 gcInfoIndex, typeName); |
| 687 } | 690 } |
| 688 size_t copySize = previousHeader->payloadSize(); | 691 size_t copySize = previousHeader->payloadSize(); |
| 689 if (copySize > size) | 692 if (copySize > size) |
| 690 copySize = size; | 693 copySize = size; |
| 691 memcpy(address, previous, copySize); | 694 memcpy(address, previous, copySize); |
| 692 return address; | 695 return address; |
| 693 } | 696 } |
| 694 | 697 |
| 695 template <typename Derived> | |
| 696 template <typename T> | 698 template <typename T> |
| 697 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) { | 699 void Visitor::handleWeakCell(Visitor* self, void* object) { |
| 698 T** cell = reinterpret_cast<T**>(object); | 700 T** cell = reinterpret_cast<T**>(object); |
| 699 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) | 701 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) |
| 700 *cell = nullptr; | 702 *cell = nullptr; |
| 701 } | 703 } |
| 702 | 704 |
| 703 } // namespace blink | 705 } // namespace blink |
| 704 | 706 |
| 707 #include "platform/heap/VisitorImpl.h" | |
|
haraken
2017/01/25 06:14:08
It looks weird to include a header file at the end
sof
2017/01/25 06:25:24
The inlines depend on definitions above, so anywhe
| |
| 708 | |
| 705 #endif // Heap_h | 709 #endif // Heap_h |
| OLD | NEW |