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

Side by Side Diff: third_party/WebKit/Source/platform/heap/Heap.h

Issue 2652923002: Devirtualize Visitor and remove inline visitor specialization. (Closed)
Patch Set: rebased Created 3 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
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*,
440 Address,
441 MarkedPointerCallbackForTesting);
442 #endif
438 443
439 size_t objectPayloadSizeForTesting(); 444 size_t objectPayloadSizeForTesting();
440 445
441 void flushHeapDoesNotContainCache(); 446 void flushHeapDoesNotContainCache();
442 447
443 FreePagePool* getFreePagePool() { return m_freePagePool.get(); } 448 FreePagePool* getFreePagePool() { return m_freePagePool.get(); }
444 OrphanedPagePool* getOrphanedPagePool() { return m_orphanedPagePool.get(); } 449 OrphanedPagePool* getOrphanedPagePool() { return m_orphanedPagePool.get(); }
445 450
446 // This look-up uses the region search tree and a negative contains cache to 451 // 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 452 // provide an efficient mapping from arbitrary addresses to the containing
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 address = ThreadHeap::allocateOnArenaIndex(state, size, arenaIndex, 690 address = ThreadHeap::allocateOnArenaIndex(state, size, arenaIndex,
686 gcInfoIndex, typeName); 691 gcInfoIndex, typeName);
687 } 692 }
688 size_t copySize = previousHeader->payloadSize(); 693 size_t copySize = previousHeader->payloadSize();
689 if (copySize > size) 694 if (copySize > size)
690 copySize = size; 695 copySize = size;
691 memcpy(address, previous, copySize); 696 memcpy(address, previous, copySize);
692 return address; 697 return address;
693 } 698 }
694 699
695 template <typename Derived>
696 template <typename T> 700 template <typename T>
697 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) { 701 void Visitor::handleWeakCell(Visitor* self, void* object) {
698 T** cell = reinterpret_cast<T**>(object); 702 T** cell = reinterpret_cast<T**>(object);
699 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) 703 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell))
700 *cell = nullptr; 704 *cell = nullptr;
701 } 705 }
702 706
703 } // namespace blink 707 } // namespace blink
704 708
709 #include "platform/heap/VisitorImpl.h"
710
705 #endif // Heap_h 711 #endif // Heap_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Handle.h ('k') | third_party/WebKit/Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698