summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp')
-rw-r--r--Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp43
1 files changed, 14 insertions, 29 deletions
diff --git a/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp b/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp
index d2bdd6a5a..5cfb3d1e8 100644
--- a/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp
+++ b/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,7 +29,6 @@
#if ENABLE(JIT)
#include "CodeBlock.h"
-#include "JSCInlines.h"
#include "StructureStubInfo.h"
namespace JSC {
@@ -37,56 +36,42 @@ namespace JSC {
StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint() { }
StructureStubClearingWatchpoint* StructureStubClearingWatchpoint::push(
- const ObjectPropertyCondition& key,
WatchpointsOnStructureStubInfo& holder,
- std::unique_ptr<StructureStubClearingWatchpoint>& head)
+ OwnPtr<StructureStubClearingWatchpoint>& head)
{
- head = std::make_unique<StructureStubClearingWatchpoint>(key, holder, WTFMove(head));
+ head = adoptPtr(new StructureStubClearingWatchpoint(holder, head.release()));
return head.get();
}
-void StructureStubClearingWatchpoint::fireInternal(const FireDetail&)
+void StructureStubClearingWatchpoint::fireInternal()
{
- if (!m_key || !m_key.isWatchable(PropertyCondition::EnsureWatchability)) {
- // This will implicitly cause my own demise: stub reset removes all watchpoints.
- // That works, because deleting a watchpoint removes it from the set's list, and
- // the set's list traversal for firing is robust against the set changing.
- ConcurrentJITLocker locker(m_holder.codeBlock()->m_lock);
- m_holder.stubInfo()->reset(m_holder.codeBlock());
- return;
- }
-
- if (m_key.kind() == PropertyCondition::Presence) {
- // If this was a presence condition, let's watch the property for replacements. This is profitable
- // for the DFG, which will want the replacement set to be valid in order to do constant folding.
- VM& vm = *Heap::heap(m_key.object())->vm();
- m_key.object()->structure()->startWatchingPropertyForReplacements(vm, m_key.offset());
- }
-
- m_key.object()->structure()->addTransitionWatchpoint(this);
+ // This will implicitly cause my own demise: stub reset removes all watchpoints.
+ // That works, because deleting a watchpoint removes it from the set's list, and
+ // the set's list traversal for firing is robust against the set changing.
+ m_holder.codeBlock()->resetStub(*m_holder.stubInfo());
}
WatchpointsOnStructureStubInfo::~WatchpointsOnStructureStubInfo()
{
}
-StructureStubClearingWatchpoint* WatchpointsOnStructureStubInfo::addWatchpoint(const ObjectPropertyCondition& key)
+StructureStubClearingWatchpoint* WatchpointsOnStructureStubInfo::addWatchpoint()
{
- return StructureStubClearingWatchpoint::push(key, *this, m_head);
+ return StructureStubClearingWatchpoint::push(*this, m_head);
}
StructureStubClearingWatchpoint* WatchpointsOnStructureStubInfo::ensureReferenceAndAddWatchpoint(
- std::unique_ptr<WatchpointsOnStructureStubInfo>& holderRef, CodeBlock* codeBlock,
- StructureStubInfo* stubInfo, const ObjectPropertyCondition& key)
+ RefPtr<WatchpointsOnStructureStubInfo>& holderRef, CodeBlock* codeBlock,
+ StructureStubInfo* stubInfo)
{
if (!holderRef)
- holderRef = std::make_unique<WatchpointsOnStructureStubInfo>(codeBlock, stubInfo);
+ holderRef = adoptRef(new WatchpointsOnStructureStubInfo(codeBlock, stubInfo));
else {
ASSERT(holderRef->m_codeBlock == codeBlock);
ASSERT(holderRef->m_stubInfo == stubInfo);
}
- return holderRef->addWatchpoint(key);
+ return holderRef->addWatchpoint();
}
} // namespace JSC