Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/WebKit/Source/platform/heap/HeapPage.cpp

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 ASSERT(pageFromObject(reinterpret_cast<Address>(header)) == findPageFromAddr ess(reinterpret_cast<Address>(header))); 685 ASSERT(pageFromObject(reinterpret_cast<Address>(header)) == findPageFromAddr ess(reinterpret_cast<Address>(header)));
686 m_promptlyFreedSize += shrinkSize; 686 m_promptlyFreedSize += shrinkSize;
687 header->setSize(allocationSize); 687 header->setSize(allocationSize);
688 SET_MEMORY_INACCESSIBLE(shrinkAddress + sizeof(HeapObjectHeader), shrinkSize - sizeof(HeapObjectHeader)); 688 SET_MEMORY_INACCESSIBLE(shrinkAddress + sizeof(HeapObjectHeader), shrinkSize - sizeof(HeapObjectHeader));
689 return false; 689 return false;
690 } 690 }
691 691
692 Address NormalPageArena::lazySweepPages(size_t allocationSize, size_t gcInfoInde x) 692 Address NormalPageArena::lazySweepPages(size_t allocationSize, size_t gcInfoInde x)
693 { 693 {
694 ASSERT(!hasCurrentAllocationArea()); 694 ASSERT(!hasCurrentAllocationArea());
695 TemporaryChange<bool> isLazySweeping(m_isLazySweeping, true); 695 TemporaryChange<bool> isLazySweeping(&m_isLazySweeping, true);
696 Address result = nullptr; 696 Address result = nullptr;
697 while (m_firstUnsweptPage) { 697 while (m_firstUnsweptPage) {
698 BasePage* page = m_firstUnsweptPage; 698 BasePage* page = m_firstUnsweptPage;
699 if (page->isEmpty()) { 699 if (page->isEmpty()) {
700 page->unlink(&m_firstUnsweptPage); 700 page->unlink(&m_firstUnsweptPage);
701 page->removeFromHeap(); 701 page->removeFromHeap();
702 } else { 702 } else {
703 // Sweep a page and move the page from m_firstUnsweptPages to 703 // Sweep a page and move the page from m_firstUnsweptPages to
704 // m_firstPages. 704 // m_firstPages.
705 page->sweep(); 705 page->sweep();
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 1616
1617 m_hasEntries = true; 1617 m_hasEntries = true;
1618 size_t index = hash(address); 1618 size_t index = hash(address);
1619 ASSERT(!(index & 1)); 1619 ASSERT(!(index & 1));
1620 Address cachePage = roundToBlinkPageStart(address); 1620 Address cachePage = roundToBlinkPageStart(address);
1621 m_entries[index + 1] = m_entries[index]; 1621 m_entries[index + 1] = m_entries[index];
1622 m_entries[index] = cachePage; 1622 m_entries[index] = cachePage;
1623 } 1623 }
1624 1624
1625 } // namespace blink 1625 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698