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

Side by Side Diff: Source/heap/ThreadState.cpp

Issue 157593004: Revert of Do not scan the active part of the stack in oilpan conservative garbage collections. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 void ThreadState::visitRoots(Visitor* visitor) 303 void ThreadState::visitRoots(Visitor* visitor)
304 { 304 {
305 AttachedThreadStateSet& threads = attachedThreads(); 305 AttachedThreadStateSet& threads = attachedThreads();
306 for (AttachedThreadStateSet::iterator it = threads.begin(), end = threads.en d(); it != end; ++it) 306 for (AttachedThreadStateSet::iterator it = threads.begin(), end = threads.en d(); it != end; ++it)
307 (*it)->trace(visitor); 307 (*it)->trace(visitor);
308 } 308 }
309 309
310 NO_SANITIZE_ADDRESS 310 NO_SANITIZE_ADDRESS
311 void ThreadState::visitStack(Visitor* visitor) 311 void ThreadState::visitStack(Visitor* visitor)
312 { 312 {
313 Address* start = reinterpret_cast<Address*>(m_startOfStack); 313 Address* end = reinterpret_cast<Address*>(m_startOfStack);
314 // If there is a safepoint scope marker we should stop the stack 314 for (Address* current = reinterpret_cast<Address*>(m_endOfStack); current < end; ++current) {
315 // scanning there to not touch active parts of the stack. Anything
316 // interesting beyond that point is in the safepoint stack copy.
317 // If there is no scope marker the thread is blocked and we should
318 // scan all the way to the recorded end stack pointer.
319 Address* end = reinterpret_cast<Address*>(m_endOfStack);
320 Address* safePointScopeMarker = reinterpret_cast<Address*>(m_safePointScopeM arker);
321 Address* current = safePointScopeMarker ? safePointScopeMarker : end;
322 for (; current < start; ++current) {
323 Heap::checkAndMarkPointer(visitor, *current); 315 Heap::checkAndMarkPointer(visitor, *current);
324 } 316 }
325 317
326 for (Vector<Address>::iterator it = m_safePointStackCopy.begin(); it != m_sa fePointStackCopy.end(); ++it) 318 for (Vector<Address>::iterator it = m_safePointStackCopy.begin(); it != m_sa fePointStackCopy.end(); ++it)
327 Heap::checkAndMarkPointer(visitor, *it); 319 Heap::checkAndMarkPointer(visitor, *it);
328 } 320 }
329 321
330 void ThreadState::visitPersistents(Visitor* visitor) 322 void ThreadState::visitPersistents(Visitor* visitor)
331 { 323 {
332 for (PersistentNode* current = m_persistents->m_next; current != m_persisten ts; current = current->m_next) { 324 for (PersistentNode* current = m_persistents->m_next; current != m_persisten ts; current = current->m_next) {
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 state->safePoint(HeapPointersOnStack); 637 state->safePoint(HeapPointersOnStack);
646 } 638 }
647 639
648 ThreadState::AttachedThreadStateSet& ThreadState::attachedThreads() 640 ThreadState::AttachedThreadStateSet& ThreadState::attachedThreads()
649 { 641 {
650 DEFINE_STATIC_LOCAL(AttachedThreadStateSet, threads, ()); 642 DEFINE_STATIC_LOCAL(AttachedThreadStateSet, threads, ());
651 return threads; 643 return threads;
652 } 644 }
653 645
654 } 646 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698