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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 static const int deadlineCheckInterval = 10; | 332 static const int deadlineCheckInterval = 10; |
333 | 333 |
334 RELEASE_ASSERT(threadState()->isSweepingInProgress()); | 334 RELEASE_ASSERT(threadState()->isSweepingInProgress()); |
335 ASSERT(threadState()->sweepForbidden()); | 335 ASSERT(threadState()->sweepForbidden()); |
336 ASSERT(!threadState()->isMainThread() || ScriptForbiddenScope::isScriptForbi
dden()); | 336 ASSERT(!threadState()->isMainThread() || ScriptForbiddenScope::isScriptForbi
dden()); |
337 | 337 |
338 int pageCount = 1; | 338 int pageCount = 1; |
339 while (m_firstUnsweptPage) { | 339 while (m_firstUnsweptPage) { |
340 sweepUnsweptPage(); | 340 sweepUnsweptPage(); |
341 if (pageCount % deadlineCheckInterval == 0) { | 341 if (pageCount % deadlineCheckInterval == 0) { |
342 if (deadlineSeconds <= Platform::current()->monotonicallyIncreasingT
imeSeconds()) { | 342 if (deadlineSeconds <= monotonicallyIncreasingTime()) { |
343 // Deadline has come. | 343 // Deadline has come. |
344 Heap::reportMemoryUsageForTracing(); | 344 Heap::reportMemoryUsageForTracing(); |
345 return !m_firstUnsweptPage; | 345 return !m_firstUnsweptPage; |
346 } | 346 } |
347 } | 347 } |
348 pageCount++; | 348 pageCount++; |
349 } | 349 } |
350 Heap::reportMemoryUsageForTracing(); | 350 Heap::reportMemoryUsageForTracing(); |
351 return true; | 351 return true; |
352 } | 352 } |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1573 | 1573 |
1574 m_hasEntries = true; | 1574 m_hasEntries = true; |
1575 size_t index = hash(address); | 1575 size_t index = hash(address); |
1576 ASSERT(!(index & 1)); | 1576 ASSERT(!(index & 1)); |
1577 Address cachePage = roundToBlinkPageStart(address); | 1577 Address cachePage = roundToBlinkPageStart(address); |
1578 m_entries[index + 1] = m_entries[index]; | 1578 m_entries[index + 1] = m_entries[index]; |
1579 m_entries[index] = cachePage; | 1579 m_entries[index] = cachePage; |
1580 } | 1580 } |
1581 | 1581 |
1582 } // namespace blink | 1582 } // namespace blink |
OLD | NEW |