| 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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 // If we are not in a sweeping phase, there is nothing to do here. | 697 // If we are not in a sweeping phase, there is nothing to do here. |
| 698 if (!isSweepingInProgress()) | 698 if (!isSweepingInProgress()) |
| 699 return; | 699 return; |
| 700 | 700 |
| 701 // This check is here to prevent performIdleLazySweep() from being called | 701 // This check is here to prevent performIdleLazySweep() from being called |
| 702 // recursively. I'm not sure if it can happen but it would be safer to have | 702 // recursively. I'm not sure if it can happen but it would be safer to have |
| 703 // the check just in case. | 703 // the check just in case. |
| 704 if (sweepForbidden()) | 704 if (sweepForbidden()) |
| 705 return; | 705 return; |
| 706 | 706 |
| 707 TRACE_EVENT1("blink_gc", "ThreadState::performIdleLazySweep", "idleDeltaInSe
conds", deadlineSeconds - Platform::current()->monotonicallyIncreasingTime()); |
| 708 |
| 707 bool sweepCompleted = true; | 709 bool sweepCompleted = true; |
| 708 SweepForbiddenScope scope(this); | 710 SweepForbiddenScope scope(this); |
| 709 { | 711 { |
| 710 if (isMainThread()) | 712 if (isMainThread()) |
| 711 ScriptForbiddenScope::enter(); | 713 ScriptForbiddenScope::enter(); |
| 712 | 714 |
| 713 for (int i = 0; i < NumberOfHeaps; i++) { | 715 for (int i = 0; i < NumberOfHeaps; i++) { |
| 714 // lazySweepWithDeadline() won't check the deadline until it sweeps | 716 // lazySweepWithDeadline() won't check the deadline until it sweeps |
| 715 // 10 pages. So we give a small slack for safety. | 717 // 10 pages. So we give a small slack for safety. |
| 716 double slack = 0.001; | 718 double slack = 0.001; |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1473 json->beginArray(it->key.ascii().data()); | 1475 json->beginArray(it->key.ascii().data()); |
| 1474 for (size_t age = 0; age <= maxHeapObjectAge; ++age) | 1476 for (size_t age = 0; age <= maxHeapObjectAge; ++age) |
| 1475 json->pushInteger(it->value.ages[age]); | 1477 json->pushInteger(it->value.ages[age]); |
| 1476 json->endArray(); | 1478 json->endArray(); |
| 1477 } | 1479 } |
| 1478 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); | 1480 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); |
| 1479 } | 1481 } |
| 1480 #endif | 1482 #endif |
| 1481 | 1483 |
| 1482 } // namespace blink | 1484 } // namespace blink |
| OLD | NEW |