| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 CallbackStack::Item* slot = s_globalWeakCallbackStack->allocateEntry(); | 263 CallbackStack::Item* slot = s_globalWeakCallbackStack->allocateEntry(); |
| 264 *slot = CallbackStack::Item(cell, callback); | 264 *slot = CallbackStack::Item(cell, callback); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void Heap::pushThreadLocalWeakCallback(void* closure, void* object, WeakCallback
callback) | 267 void Heap::pushThreadLocalWeakCallback(void* closure, void* object, WeakCallback
callback) |
| 268 { | 268 { |
| 269 ASSERT(ThreadState::current()->isInGC()); | 269 ASSERT(ThreadState::current()->isInGC()); |
| 270 | 270 |
| 271 // Trace should never reach an orphaned page. | 271 // Trace should never reach an orphaned page. |
| 272 ASSERT(!Heap::orphanedPagePool()->contains(object)); | 272 ASSERT(!Heap::orphanedPagePool()->contains(object)); |
| 273 ThreadState* state = pageFromObject(object)->heap()->threadState(); | 273 ThreadState* state = pageFromObject(object)->arena()->threadState(); |
| 274 state->pushThreadLocalWeakCallback(closure, callback); | 274 state->pushThreadLocalWeakCallback(closure, callback); |
| 275 } | 275 } |
| 276 | 276 |
| 277 bool Heap::popAndInvokeGlobalWeakCallback(Visitor* visitor) | 277 bool Heap::popAndInvokeGlobalWeakCallback(Visitor* visitor) |
| 278 { | 278 { |
| 279 if (CallbackStack::Item* item = s_globalWeakCallbackStack->pop()) { | 279 if (CallbackStack::Item* item = s_globalWeakCallbackStack->pop()) { |
| 280 item->call(visitor); | 280 item->call(visitor); |
| 281 return true; | 281 return true; |
| 282 } | 282 } |
| 283 return false; | 283 return false; |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 size_t Heap::s_wrapperCountAtLastGC = 0; | 688 size_t Heap::s_wrapperCountAtLastGC = 0; |
| 689 size_t Heap::s_collectedWrapperCount = 0; | 689 size_t Heap::s_collectedWrapperCount = 0; |
| 690 size_t Heap::s_partitionAllocSizeAtLastGC = 0; | 690 size_t Heap::s_partitionAllocSizeAtLastGC = 0; |
| 691 double Heap::s_estimatedMarkingTimePerByte = 0.0; | 691 double Heap::s_estimatedMarkingTimePerByte = 0.0; |
| 692 bool Heap::s_isLowEndDevice = false; | 692 bool Heap::s_isLowEndDevice = false; |
| 693 #if ENABLE(ASSERT) | 693 #if ENABLE(ASSERT) |
| 694 uint16_t Heap::s_gcGeneration = 0; | 694 uint16_t Heap::s_gcGeneration = 0; |
| 695 #endif | 695 #endif |
| 696 | 696 |
| 697 } // namespace blink | 697 } // namespace blink |
| OLD | NEW |