| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |