[webkit-changes] [WebKit/WebKit] d36c97: [JSC] Fix instanceof by introducing hasInstanceOrP...
Yijia Huang
noreply at github.com
Thu Oct 10 19:05:33 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d36c972c6b9472b5f4e8fa9292abf8b0a2e72532
https://github.com/WebKit/WebKit/commit/d36c972c6b9472b5f4e8fa9292abf8b0a2e72532
Author: Yijia Huang <yijia_huang at apple.com>
Date: 2024-10-10 (Thu, 10 Oct 2024)
Changed paths:
A JSTests/stress/instanceof-dst-value-alias.js
M Source/JavaScriptCore/bytecode/BytecodeList.rb
M Source/JavaScriptCore/bytecode/BytecodeUseDef.cpp
M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
M Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
M Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
M Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
M Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
Log Message:
-----------
[JSC] Fix instanceof by introducing hasInstanceOrPrototype
https://bugs.webkit.org/show_bug.cgi?id=281234
rdar://137694028
Reviewed by Yusuke Suzuki.
The fused `instanceof` bytecode was introduced at [1].
dst = value instanceof constructor
Previously, we store the temporary hasInstance and prototype values
to the `dst`. That is wrong since the `dst` may be alias of
`value`. So, storing those temporary values to `dst` may clobber `value`.
This patch fixes this issue by introducing `hasInstanceValueProfile` for
the temporary value storage.
[1] https://commits.webkit.org/284176@main
* JSTests/stress/instanceof-dst-value-alias.js: Added.
(FileLocation):
(test):
* Source/JavaScriptCore/bytecode/BytecodeList.rb:
* Source/JavaScriptCore/bytecode/BytecodeUseDef.cpp:
(JSC::computeUsesForBytecodeIndexImpl):
(JSC::computeDefsForBytecodeIndexImpl):
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitInstanceof):
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:
* Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:
(JSC::InstanceOfNode::emitBytecode):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::handleOpInstanceofCheckpoint):
* Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:
* Source/JavaScriptCore/runtime/CommonSlowPaths.cpp:
(JSC::JSC_DEFINE_COMMON_SLOW_PATH):
Canonical link: https://commits.webkit.org/285003@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list