summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/heap/HandleSet.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/heap/HandleSet.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/heap/HandleSet.cpp')
-rw-r--r--Source/JavaScriptCore/heap/HandleSet.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/Source/JavaScriptCore/heap/HandleSet.cpp b/Source/JavaScriptCore/heap/HandleSet.cpp
index fdb554448..9d7d5c631 100644
--- a/Source/JavaScriptCore/heap/HandleSet.cpp
+++ b/Source/JavaScriptCore/heap/HandleSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,16 +28,14 @@
#include "HandleBlock.h"
#include "HandleBlockInlines.h"
-#include "HeapRootVisitor.h"
#include "JSObject.h"
-#include "Operations.h"
+#include "JSCInlines.h"
#include <wtf/DataLog.h>
namespace JSC {
HandleSet::HandleSet(VM* vm)
: m_vm(vm)
- , m_nextToFinalize(0)
{
grow();
}
@@ -45,12 +43,12 @@ HandleSet::HandleSet(VM* vm)
HandleSet::~HandleSet()
{
while (!m_blockList.isEmpty())
- m_vm->heap.blockAllocator().deallocate(HandleBlock::destroy(m_blockList.removeHead()));
+ HandleBlock::destroy(m_blockList.removeHead());
}
void HandleSet::grow()
{
- HandleBlock* newBlock = HandleBlock::create(m_vm->heap.blockAllocator().allocate<HandleBlock>(), this);
+ HandleBlock* newBlock = HandleBlock::create(this);
m_blockList.append(newBlock);
for (int i = newBlock->nodeCapacity() - 1; i >= 0; --i) {
@@ -60,23 +58,19 @@ void HandleSet::grow()
}
}
-void HandleSet::visitStrongHandles(HeapRootVisitor& heapRootVisitor)
+void HandleSet::visitStrongHandles(SlotVisitor& visitor)
{
Node* end = m_strongList.end();
for (Node* node = m_strongList.begin(); node != end; node = node->next()) {
#if ENABLE(GC_VALIDATION)
RELEASE_ASSERT(isLiveNode(node));
#endif
- heapRootVisitor.visit(node->slot());
+ visitor.appendUnbarriered(*node->slot());
}
}
void HandleSet::writeBarrier(HandleSlot slot, const JSValue& value)
{
- // Forbid assignment to handles during the finalization phase, since it would violate many GC invariants.
- // File a bug with stack trace if you hit this.
- RELEASE_ASSERT(!m_nextToFinalize);
-
if (!value == !*slot && slot->isCell() == value.isCell())
return;