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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 #endif | 302 #endif |
303 current->trace(visitor); | 303 current->trace(visitor); |
304 } | 304 } |
305 } | 305 } |
306 | 306 |
307 NO_SANITIZE_ADDRESS | 307 NO_SANITIZE_ADDRESS |
308 void ThreadState::visitStack(Visitor* visitor) | 308 void ThreadState::visitStack(Visitor* visitor) |
309 { | 309 { |
310 Address* end = reinterpret_cast<Address*>(m_startOfStack); | 310 Address* end = reinterpret_cast<Address*>(m_startOfStack); |
311 for (Address* current = reinterpret_cast<Address*>(m_endOfStack); current <
end; ++current) { | 311 for (Address* current = reinterpret_cast<Address*>(m_endOfStack); current <
end; ++current) { |
312 Heap::checkAndVisitPointer(visitor, *current); | 312 Heap::checkAndMarkPointer(visitor, *current); |
313 } | 313 } |
314 } | 314 } |
315 | 315 |
316 void ThreadState::trace(Visitor* visitor) | 316 void ThreadState::trace(Visitor* visitor) |
317 { | 317 { |
318 if (m_stackState == HeapPointersOnStack) | 318 if (m_stackState == HeapPointersOnStack) |
319 visitStack(visitor); | 319 visitStack(visitor); |
320 visitPersistents(visitor); | 320 visitPersistents(visitor); |
321 } | 321 } |
322 | 322 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 { | 360 { |
361 // Check large objects in all heaps first | 361 // Check large objects in all heaps first |
362 for (int i = 0; i < NumberOfHeaps; i++) { | 362 for (int i = 0; i < NumberOfHeaps; i++) { |
363 if (m_heaps[i]->largeHeapObjectFromAddress(address)) | 363 if (m_heaps[i]->largeHeapObjectFromAddress(address)) |
364 return true; | 364 return true; |
365 } | 365 } |
366 // Check cache to find page | 366 // Check cache to find page |
367 return heapPageFromAddress(address); | 367 return heapPageFromAddress(address); |
368 } | 368 } |
369 | 369 |
370 bool ThreadState::checkAndVisitPointer(Visitor* visitor, Address address) | 370 bool ThreadState::checkAndMarkPointer(Visitor* visitor, Address address) |
371 { | 371 { |
372 BaseHeapPage* page = heapPageFromAddress(address); | 372 BaseHeapPage* page = heapPageFromAddress(address); |
373 if (page) | 373 if (page) |
374 return page->checkAndVisitPointer(visitor, address); | 374 return page->checkAndMarkPointer(visitor, address); |
375 // Not in heap pages, check large objects | 375 // Not in heap pages, check large objects |
376 for (int i = 0; i < NumberOfHeaps; i++) { | 376 for (int i = 0; i < NumberOfHeaps; i++) { |
377 if (m_heaps[i]->checkAndVisitLargeHeapObjects(visitor, address)) | 377 if (m_heaps[i]->checkAndMarkLargeHeapObjects(visitor, address)) |
378 return true; | 378 return true; |
379 } | 379 } |
380 return false; | 380 return false; |
381 } | 381 } |
382 | 382 |
383 bool ThreadState::isConsistentForGC() | 383 bool ThreadState::isConsistentForGC() |
384 { | 384 { |
385 for (int i = 0; i < NumberOfHeaps; i++) { | 385 for (int i = 0; i < NumberOfHeaps; i++) { |
386 if (!m_heaps[i]->isConsistentForGC()) | 386 if (!m_heaps[i]->isConsistentForGC()) |
387 return false; | 387 return false; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 barrier->doPark(state, stackEnd); | 546 barrier->doPark(state, stackEnd); |
547 } | 547 } |
548 | 548 |
549 static void notifyPausedAfterPushRegisters(SafePointBarrier* barrier, ThreadStat
e* state, intptr_t* stackEnd) | 549 static void notifyPausedAfterPushRegisters(SafePointBarrier* barrier, ThreadStat
e* state, intptr_t* stackEnd) |
550 { | 550 { |
551 barrier->doNotifyPaused(state, stackEnd); | 551 barrier->doNotifyPaused(state, stackEnd); |
552 } | 552 } |
553 | 553 |
554 | 554 |
555 } | 555 } |
OLD | NEW |