diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
commit | 41386e9cb918eed93b3f13648cbef387e371e451 (patch) | |
tree | a97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp | |
parent | e15dd966d523731101f70ccf768bba12435a0208 (diff) | |
download | WebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz |
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp')
-rw-r--r-- | Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp b/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp index 59c088b54..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,46 +36,33 @@ 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, WTF::move(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. - m_holder.codeBlock()->resetStub(*m_holder.stubInfo()); - 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( RefPtr<WatchpointsOnStructureStubInfo>& holderRef, CodeBlock* codeBlock, - StructureStubInfo* stubInfo, const ObjectPropertyCondition& key) + StructureStubInfo* stubInfo) { if (!holderRef) holderRef = adoptRef(new WatchpointsOnStructureStubInfo(codeBlock, stubInfo)); @@ -85,7 +71,7 @@ StructureStubClearingWatchpoint* WatchpointsOnStructureStubInfo::ensureReference ASSERT(holderRef->m_stubInfo == stubInfo); } - return holderRef->addWatchpoint(key); + return holderRef->addWatchpoint(); } } // namespace JSC |