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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 } | 295 } |
| 296 | 296 |
| 297 bool ThreadHeap::popAndInvokePostMarkingCallback(Visitor* visitor) { | 297 bool ThreadHeap::popAndInvokePostMarkingCallback(Visitor* visitor) { |
| 298 if (CallbackStack::Item* item = m_postMarkingCallbackStack->pop()) { | 298 if (CallbackStack::Item* item = m_postMarkingCallbackStack->pop()) { |
| 299 item->call(visitor); | 299 item->call(visitor); |
| 300 return true; | 300 return true; |
| 301 } | 301 } |
| 302 return false; | 302 return false; |
| 303 } | 303 } |
| 304 | 304 |
| 305 void ThreadHeap::pushGlobalWeakCallback(void** cell, WeakCallback callback) { | 305 void ThreadHeap::pushWeakCallback(void* closure, WeakCallback callback) { |
| 306 ASSERT(ThreadState::current()->isInGC()); | 306 ASSERT(ThreadState::current()->isInGC()); |
| 307 | 307 |
| 308 CallbackStack::Item* slot = m_globalWeakCallbackStack->allocateEntry(); | 308 CallbackStack::Item* slot = m_globalWeakCallbackStack->allocateEntry(); |
| 309 *slot = CallbackStack::Item(cell, callback); | |
| 310 } | |
| 311 | |
| 312 void ThreadHeap::pushThreadLocalWeakCallback(void* closure, | |
| 313 void* object, | |
| 314 WeakCallback callback) { | |
| 315 ASSERT(ThreadState::current()->isInGC()); | |
| 316 | |
| 317 CallbackStack::Item* slot = m_globalWeakCallbackStack->allocateEntry(); | |
| 318 *slot = CallbackStack::Item(closure, callback); | 309 *slot = CallbackStack::Item(closure, callback); |
| 319 } | 310 } |
| 320 | 311 |
| 321 bool ThreadHeap::popAndInvokeGlobalWeakCallback(Visitor* visitor) { | 312 bool ThreadHeap::popAndInvokeGlobalWeakCallback(Visitor* visitor) { |
|
sof
2017/02/14 07:16:48
We should drop the "Global" from some other entry
| |
| 322 if (CallbackStack::Item* item = m_globalWeakCallbackStack->pop()) { | 313 if (CallbackStack::Item* item = m_globalWeakCallbackStack->pop()) { |
| 323 item->call(visitor); | 314 item->call(visitor); |
| 324 return true; | 315 return true; |
| 325 } | 316 } |
| 326 return false; | 317 return false; |
| 327 } | 318 } |
| 328 | 319 |
| 329 void ThreadHeap::registerWeakTable(void* table, | 320 void ThreadHeap::registerWeakTable(void* table, |
| 330 EphemeronCallback iterationCallback, | 321 EphemeronCallback iterationCallback, |
| 331 EphemeronCallback iterationDoneCallback) { | 322 EphemeronCallback iterationDoneCallback) { |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 599 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); | 590 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); |
| 600 | 591 |
| 601 m_stats.reset(); | 592 m_stats.reset(); |
| 602 for (ThreadState* state : m_threads) | 593 for (ThreadState* state : m_threads) |
| 603 state->resetHeapCounters(); | 594 state->resetHeapCounters(); |
| 604 } | 595 } |
| 605 | 596 |
| 606 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; | 597 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; |
| 607 | 598 |
| 608 } // namespace blink | 599 } // namespace blink |
| OLD | NEW |