| 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 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 objectPayloadSize += m_arenas[i]->objectPayloadSizeForTesting(); | 1165 objectPayloadSize += m_arenas[i]->objectPayloadSizeForTesting(); |
| 1166 return objectPayloadSize; | 1166 return objectPayloadSize; |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 void ThreadState::safePoint(BlinkGC::StackState stackState) { | 1169 void ThreadState::safePoint(BlinkGC::StackState stackState) { |
| 1170 ASSERT(checkThread()); | 1170 ASSERT(checkThread()); |
| 1171 ThreadHeap::reportMemoryUsageForTracing(); | 1171 ThreadHeap::reportMemoryUsageForTracing(); |
| 1172 | 1172 |
| 1173 runScheduledGC(stackState); | 1173 runScheduledGC(stackState); |
| 1174 ASSERT(!m_atSafePoint); | 1174 ASSERT(!m_atSafePoint); |
| 1175 m_stackState = stackState; | |
| 1176 m_atSafePoint = true; | |
| 1177 m_heap->checkAndPark(this, nullptr); | |
| 1178 m_atSafePoint = false; | |
| 1179 m_stackState = BlinkGC::HeapPointersOnStack; | 1175 m_stackState = BlinkGC::HeapPointersOnStack; |
| 1180 } | 1176 } |
| 1181 | 1177 |
| 1182 #ifdef ADDRESS_SANITIZER | 1178 #ifdef ADDRESS_SANITIZER |
| 1183 // When we are running under AddressSanitizer with | 1179 // When we are running under AddressSanitizer with |
| 1184 // detect_stack_use_after_return=1 then stack marker obtained from | 1180 // detect_stack_use_after_return=1 then stack marker obtained from |
| 1185 // SafePointScope will point into a fake stack. Detect this case by checking if | 1181 // SafePointScope will point into a fake stack. Detect this case by checking if |
| 1186 // it falls in between current stack frame and stack start and use an arbitrary | 1182 // it falls in between current stack frame and stack start and use an arbitrary |
| 1187 // high enough value for it. Don't adjust stack marker in any other case to | 1183 // high enough value for it. Don't adjust stack marker in any other case to |
| 1188 // match behavior of code running without AddressSanitizer. | 1184 // match behavior of code running without AddressSanitizer. |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1638 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, | 1634 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, |
| 1639 BlinkGC::ForcedGC); | 1635 BlinkGC::ForcedGC); |
| 1640 size_t liveObjects = heap().heapStats().markedObjectSize(); | 1636 size_t liveObjects = heap().heapStats().markedObjectSize(); |
| 1641 if (liveObjects == previousLiveObjects) | 1637 if (liveObjects == previousLiveObjects) |
| 1642 break; | 1638 break; |
| 1643 previousLiveObjects = liveObjects; | 1639 previousLiveObjects = liveObjects; |
| 1644 } | 1640 } |
| 1645 } | 1641 } |
| 1646 | 1642 |
| 1647 } // namespace blink | 1643 } // namespace blink |
| OLD | NEW |