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

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

Issue 2694173002: Remove thread-local weak processing (Closed)
Patch Set: temp Created 3 years, 10 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 294 }
295 295
296 bool ThreadHeap::popAndInvokePostMarkingCallback(Visitor* visitor) { 296 bool ThreadHeap::popAndInvokePostMarkingCallback(Visitor* visitor) {
297 if (CallbackStack::Item* item = m_postMarkingCallbackStack->pop()) { 297 if (CallbackStack::Item* item = m_postMarkingCallbackStack->pop()) {
298 item->call(visitor); 298 item->call(visitor);
299 return true; 299 return true;
300 } 300 }
301 return false; 301 return false;
302 } 302 }
303 303
304 void ThreadHeap::pushGlobalWeakCallback(void** cell, WeakCallback callback) { 304 void ThreadHeap::pushWeakCallback(void* closure, WeakCallback callback) {
305 ASSERT(ThreadState::current()->isInGC()); 305 ASSERT(ThreadState::current()->isInGC());
306 306
307 CallbackStack::Item* slot = m_globalWeakCallbackStack->allocateEntry(); 307 CallbackStack::Item* slot = m_globalWeakCallbackStack->allocateEntry();
308 *slot = CallbackStack::Item(cell, callback);
309 }
310
311 void ThreadHeap::pushThreadLocalWeakCallback(void* closure,
312 void* object,
313 WeakCallback callback) {
314 ASSERT(ThreadState::current()->isInGC());
315
316 CallbackStack::Item* slot = m_globalWeakCallbackStack->allocateEntry();
317 *slot = CallbackStack::Item(closure, callback); 308 *slot = CallbackStack::Item(closure, callback);
318 } 309 }
319 310
320 bool ThreadHeap::popAndInvokeGlobalWeakCallback(Visitor* visitor) { 311 bool ThreadHeap::popAndInvokeGlobalWeakCallback(Visitor* visitor) {
321 if (CallbackStack::Item* item = m_globalWeakCallbackStack->pop()) { 312 if (CallbackStack::Item* item = m_globalWeakCallbackStack->pop()) {
322 item->call(visitor); 313 item->call(visitor);
323 return true; 314 return true;
324 } 315 }
325 return false; 316 return false;
326 } 317 }
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); 588 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize());
598 589
599 m_stats.reset(); 590 m_stats.reset();
600 for (ThreadState* state : m_threads) 591 for (ThreadState* state : m_threads)
601 state->resetHeapCounters(); 592 state->resetHeapCounters();
602 } 593 }
603 594
604 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; 595 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr;
605 596
606 } // namespace blink 597 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | third_party/WebKit/Source/platform/heap/HeapAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698