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 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1424 public: | 1424 public: |
1425 GCScope(ThreadState::StackState stackState) | 1425 GCScope(ThreadState::StackState stackState) |
1426 : m_state(ThreadState::Current()) | 1426 : m_state(ThreadState::Current()) |
1427 { | 1427 { |
1428 m_state->setGCRequested(false); | 1428 m_state->setGCRequested(false); |
1429 m_state->checkThread(); | 1429 m_state->checkThread(); |
1430 | 1430 |
1431 // FIXME(oilpan): in an unlikely coincidence two threads might decide to
collect | 1431 // FIXME(oilpan): in an unlikely coincidence two threads might decide to
collect |
1432 // garbage at the same time. Avoid doing two GCs in a row. | 1432 // garbage at the same time. Avoid doing two GCs in a row. |
1433 ASSERT(!m_state->isInGC()); | 1433 ASSERT(!m_state->isInGC()); |
1434 ASSERT(!m_state->isPaused()); | 1434 ASSERT(!m_state->isInSafePoint()); |
1435 ThreadState::stopThreads(stackState); | 1435 ThreadState::stopThreads(stackState); |
1436 m_state->enterGC(); | 1436 m_state->enterGC(); |
1437 } | 1437 } |
1438 | 1438 |
1439 ~GCScope() | 1439 ~GCScope() |
1440 { | 1440 { |
1441 m_state->leaveGC(); | 1441 m_state->leaveGC(); |
1442 if (!m_state->isInGC()) | 1442 if (!m_state->isInGC()) |
1443 ThreadState::resumeThreads(); | 1443 ThreadState::resumeThreads(); |
1444 } | 1444 } |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1696 doNothingTrace, | 1696 doNothingTrace, |
1697 0, | 1697 0, |
1698 false | 1698 false |
1699 }; | 1699 }; |
1700 | 1700 |
1701 #ifdef ENABLE_PERF_STATS | 1701 #ifdef ENABLE_PERF_STATS |
1702 bool Heap::s_isCollectingStats = false; | 1702 bool Heap::s_isCollectingStats = false; |
1703 #endif | 1703 #endif |
1704 | 1704 |
1705 } // namespace WebCore | 1705 } // namespace WebCore |
OLD | NEW |