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

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

Issue 1757703004: Rename BaseHeap to BaseArena part 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/HeapAllocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 #if !ENABLE(OILPAN) 482 #if !ENABLE(OILPAN)
483 #define EAGERLY_FINALIZE_WILL_BE_REMOVED() EAGERLY_FINALIZE() 483 #define EAGERLY_FINALIZE_WILL_BE_REMOVED() EAGERLY_FINALIZE()
484 #else 484 #else
485 #define EAGERLY_FINALIZE_WILL_BE_REMOVED() 485 #define EAGERLY_FINALIZE_WILL_BE_REMOVED()
486 #endif 486 #endif
487 487
488 inline Address Heap::allocateOnArenaIndex(ThreadState* state, size_t size, int a renaIndex, size_t gcInfoIndex) 488 inline Address Heap::allocateOnArenaIndex(ThreadState* state, size_t size, int a renaIndex, size_t gcInfoIndex)
489 { 489 {
490 ASSERT(state->isAllocationAllowed()); 490 ASSERT(state->isAllocationAllowed());
491 ASSERT(arenaIndex != BlinkGC::LargeObjectArenaIndex); 491 ASSERT(arenaIndex != BlinkGC::LargeObjectArenaIndex);
492 NormalPageHeap* heap = static_cast<NormalPageHeap*>(state->arena(arenaIndex) ); 492 NormalPageArena* arena = static_cast<NormalPageArena*>(state->arena(arenaInd ex));
493 return heap->allocateObject(allocationSizeFromSize(size), gcInfoIndex); 493 return arena->allocateObject(allocationSizeFromSize(size), gcInfoIndex);
494 } 494 }
495 495
496 template<typename T> 496 template<typename T>
497 Address Heap::allocate(size_t size, bool eagerlySweep) 497 Address Heap::allocate(size_t size, bool eagerlySweep)
498 { 498 {
499 ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state(); 499 ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state();
500 Address address = Heap::allocateOnArenaIndex(state, size, eagerlySweep ? Bli nkGC::EagerSweepArenaIndex : Heap::arenaIndexForObjectSize(size), GCInfoTrait<T> ::index()); 500 Address address = Heap::allocateOnArenaIndex(state, size, eagerlySweep ? Bli nkGC::EagerSweepArenaIndex : Heap::arenaIndexForObjectSize(size), GCInfoTrait<T> ::index());
501 const char* typeName = WTF_HEAP_PROFILER_TYPE_NAME(T); 501 const char* typeName = WTF_HEAP_PROFILER_TYPE_NAME(T);
502 HeapAllocHooks::allocationHookIfEnabled(address, size, typeName); 502 HeapAllocHooks::allocationHookIfEnabled(address, size, typeName);
503 return address; 503 return address;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) 543 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object)
544 { 544 {
545 T** cell = reinterpret_cast<T**>(object); 545 T** cell = reinterpret_cast<T**>(object);
546 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) 546 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell))
547 *cell = nullptr; 547 *cell = nullptr;
548 } 548 }
549 549
550 } // namespace blink 550 } // namespace blink
551 551
552 #endif // Heap_h 552 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/HeapAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698