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

Unified Diff: Source/platform/heap/Handle.cpp

Issue 553483004: Revert of [oilpan]: optimize the way we allocate persistent handles in wrappers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: merge conflicts Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Handle.cpp
diff --git a/Source/platform/heap/Handle.cpp b/Source/platform/heap/Handle.cpp
deleted file mode 100644
index e2da7b2893b9f5e6ffc96909ff78fbf0d9d4612e..0000000000000000000000000000000000000000
--- a/Source/platform/heap/Handle.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "platform/heap/Handle.h"
-
-namespace blink {
-
-bool WrapperPersistentRegion::removeIfNotLast(WrapperPersistentRegion** headPtr)
-{
- ASSERT(!m_count);
- // We are the last region in the list if both the region's m_prev and
- // m_next are 0.
- if (!m_prev && !m_next)
- return false;
- if (m_prev) {
- m_prev->m_next = m_next;
- } else {
- ASSERT(*headPtr == this);
- *headPtr = m_next;
- }
- if (m_next)
- m_next->m_prev = m_prev;
- m_prev = 0;
- m_next = 0;
- return true;
-}
-
-void WrapperPersistentRegion::insertHead(WrapperPersistentRegion** headPtr, WrapperPersistentRegion* newHead)
-{
- ASSERT(headPtr);
- WrapperPersistentRegion* oldHead = *headPtr;
- if (oldHead) {
- ASSERT(!oldHead->m_prev);
- oldHead->m_prev = newHead;
- }
- newHead->m_prev = 0;
- newHead->m_next = oldHead;
- *headPtr = newHead;
-}
-
-WrapperPersistentRegion* WrapperPersistentRegion::removeHead(WrapperPersistentRegion** headPtr)
-{
- // We only call this if there is at least one element in the list.
- ASSERT(headPtr && *headPtr);
- WrapperPersistentRegion* oldHead = *headPtr;
- ASSERT(!oldHead->m_prev);
- *headPtr = oldHead->m_next;
- oldHead->m_next = 0;
- ASSERT(!(*headPtr) || (*headPtr)->m_prev == oldHead);
- if (*headPtr)
- (*headPtr)->m_prev = 0;
- return oldHead;
-}
-
-void* WrapperPersistentRegion::outOfLineAllocate(ThreadState* state, WrapperPersistentRegion* head)
-{
- void* persistent = 0;
- // The caller has already tried allocating in the passed-in region, start
- // from the next.
- for (WrapperPersistentRegion* current = head->m_next; current; current = current->m_next) {
- persistent = current->allocate();
- if (persistent)
- return persistent;
- }
- ASSERT(!persistent);
- WrapperPersistentRegion* newRegion = state->takeWrapperPersistentRegion();
- persistent = newRegion->allocate();
- ASSERT(persistent);
- return persistent;
-}
-
-}
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698