Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
some Watchpoints' ::fireInternal method will call operations that mig…
…ht GC where the GC will cause the watchpoint itself to destruct https://bugs.webkit.org/show_bug.cgi?id=159198 <rdar://problem/26302360> Reviewed by Filip Pizlo. Source/JavaScriptCore: Firing a watchpoint may cause a GC to happen. This GC could destroy various Watchpoints themselves while they're in the process of firing. It's not safe for most Watchpoints to be destructed while they're in the middle of firing. This GC could also destroy the WatchpointSet itself, and it's not in a safe state to be destroyed. WatchpointSet::fireAllWatchpoints now defers gc for a while. This prevents a GC from destructing any Watchpoints while they're in the process of firing. This bug was being hit by the stress GC bots because we would destruct a particular Watchpoint while it was firing, and then we would access its field after it had already been destroyed. This was causing all kinds of weird symptoms. Also, this was easier to catch when running with guard malloc because the first access after destruction would lead to a crash. * bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp: (JSC::AdaptiveInferredPropertyValueWatchpointBase::fire): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/VariableWriteFireDetail.cpp: (JSC::VariableWriteFireDetail::dump): (JSC::VariableWriteFireDetail::touch): * bytecode/VariableWriteFireDetail.h: * bytecode/Watchpoint.cpp: (JSC::WatchpointSet::add): (JSC::WatchpointSet::fireAllSlow): (JSC::WatchpointSet::fireAllWatchpoints): (JSC::InlineWatchpointSet::add): (JSC::InlineWatchpointSet::fireAll): (JSC::InlineWatchpointSet::inflateSlow): * bytecode/Watchpoint.h: (JSC::WatchpointSet::startWatching): (JSC::WatchpointSet::fireAll): (JSC::WatchpointSet::touch): (JSC::WatchpointSet::invalidate): (JSC::WatchpointSet::isBeingWatched): (JSC::WatchpointSet::offsetOfState): (JSC::WatchpointSet::addressOfSetIsNotEmpty): (JSC::InlineWatchpointSet::startWatching): (JSC::InlineWatchpointSet::fireAll): (JSC::InlineWatchpointSet::invalidate): (JSC::InlineWatchpointSet::touch): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::BytecodeGenerator): * dfg/DFGOperations.cpp: * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): * jit/JITOperations.cpp: * jsc.cpp: (WTF::Masquerader::create): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * runtime/ArrayBufferNeuteringWatchpoint.cpp: (JSC::ArrayBufferNeuteringWatchpoint::fireAll): * runtime/FunctionRareData.cpp: (JSC::FunctionRareData::clear): * runtime/InferredType.cpp: (JSC::InferredType::willStoreValueSlow): (JSC::InferredType::makeTopSlow): (JSC::InferredType::set): (JSC::InferredType::removeStructure): (JSC::InferredType::InferredStructureWatchpoint::fireInternal): * runtime/InferredValue.cpp: (JSC::InferredValue::notifyWriteSlow): (JSC::InferredValue::ValueCleanup::finalizeUnconditionally): * runtime/InferredValue.h: (JSC::InferredValue::notifyWrite): (JSC::InferredValue::invalidate): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::haveABadTime): * runtime/JSSymbolTableObject.h: (JSC::symbolTablePutTouchWatchpointSet): (JSC::symbolTablePutInvalidateWatchpointSet): * runtime/Structure.cpp: (JSC::Structure::didCachePropertyReplacement): (JSC::Structure::startWatchingInternalProperties): (JSC::DeferredStructureTransitionWatchpointFire::~DeferredStructureTransitionWatchpointFire): (JSC::DeferredStructureTransitionWatchpointFire::add): (JSC::Structure::didTransitionFromThisStructure): (JSC::Structure::prototypeForLookup): * runtime/StructureInlines.h: (JSC::Structure::didReplaceProperty): (JSC::Structure::propertyReplacementWatchpointSet): * runtime/SymbolTable.h: (JSC::SymbolTableEntry::isDontEnum): (JSC::SymbolTableEntry::disableWatching): * runtime/VM.cpp: (JSC::VM::addImpureProperty): (JSC::enableProfilerWithRespectToCount): Source/WebCore: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow): * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): * bindings/scripts/test/JS/JSTestEventTarget.h: (WebCore::JSTestEventTarget::create): Canonical link: https://commits.webkit.org/177335@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
185 additions
and 67 deletions.
- +96 −0 Source/JavaScriptCore/ChangeLog
- +0 −4 Source/JavaScriptCore/bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp
- +1 −1 Source/JavaScriptCore/bytecode/CodeBlock.cpp
- +2 −2 Source/JavaScriptCore/bytecode/VariableWriteFireDetail.cpp
- +1 −1 Source/JavaScriptCore/bytecode/VariableWriteFireDetail.h
- +16 −7 Source/JavaScriptCore/bytecode/Watchpoint.cpp
- +25 −24 Source/JavaScriptCore/bytecode/Watchpoint.h
- +1 −1 Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
- +1 −1 Source/JavaScriptCore/dfg/DFGOperations.cpp
- +1 −0 Source/JavaScriptCore/heap/CopyBarrier.h
- +1 −1 Source/JavaScriptCore/interpreter/Interpreter.cpp
- +1 −1 Source/JavaScriptCore/jit/JITOperations.cpp
- +1 −1 Source/JavaScriptCore/jsc.cpp
- +1 −1 Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
- +1 −1 Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.cpp
- +1 −1 Source/JavaScriptCore/runtime/FunctionRareData.cpp
- +3 −3 Source/JavaScriptCore/runtime/InferredType.cpp
- +2 −2 Source/JavaScriptCore/runtime/InferredValue.cpp
- +2 −2 Source/JavaScriptCore/runtime/InferredValue.h
- +1 −1 Source/JavaScriptCore/runtime/JSGlobalObject.cpp
- +2 −2 Source/JavaScriptCore/runtime/JSSymbolTableObject.h
- +3 −3 Source/JavaScriptCore/runtime/Structure.cpp
- +1 −1 Source/JavaScriptCore/runtime/StructureInlines.h
- +2 −2 Source/JavaScriptCore/runtime/SymbolTable.h
- +1 −1 Source/JavaScriptCore/runtime/VM.cpp
- +15 −0 Source/WebCore/ChangeLog
- +1 −1 Source/WebCore/bindings/js/JSDOMWindowBase.cpp
- +1 −1 Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
- +1 −1 Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -27,6 +27,7 @@ | ||
#define CopyBarrier_h | ||
|
||
#include "Heap.h" | ||
#include "VM.h" | ||
|
||
namespace JSC { | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.