#include "ParserArena.h"
#include "Nodes.h"
-#include <wtf/PassOwnPtr.h>
+#include "JSCInlines.h"
namespace JSC {
deallocateObjects();
}
-bool ParserArena::contains(ParserArenaRefCounted* object) const
-{
- return m_refCountedObjects.find(object) != notFound;
-}
-
-ParserArenaRefCounted* ParserArena::last() const
-{
- return m_refCountedObjects.last().get();
-}
-
-void ParserArena::removeLast()
-{
- m_refCountedObjects.removeLast();
-}
-
-void ParserArena::reset()
-{
- // Since this code path is used only when parsing fails, it's not bothering to reuse
- // any of the memory the arena allocated. We could improve that later if we want to
- // efficiently reuse the same arena.
-
- deallocateObjects();
-
- m_freeableMemory = 0;
- m_freeablePoolEnd = 0;
- if (m_identifierArena)
- m_identifierArena->clear();
- m_freeablePools.clear();
- m_deletableObjects.clear();
- m_refCountedObjects.clear();
-}
-
void ParserArena::allocateFreeablePool()
{
if (m_freeablePoolEnd)
ASSERT(freeablePool() == pool);
}
-bool ParserArena::isEmpty() const
-{
- return !m_freeablePoolEnd
- && (!m_identifierArena || m_identifierArena->isEmpty())
- && m_freeablePools.isEmpty()
- && m_deletableObjects.isEmpty()
- && m_refCountedObjects.isEmpty();
-}
-
-void ParserArena::derefWithArena(PassRefPtr<ParserArenaRefCounted> object)
-{
- m_refCountedObjects.append(object);
-}
-
}