[JSC] Add "jump if (not) undefined or null" bytecode ops
https://bugs.webkit.org/show_bug.cgi?id=200480
Reviewed by Saam Barati.
JSTests:
- stress/destructuring-assignment-require-object-coercible.js:
- stress/nullish-coalescing.js:
Source/JavaScriptCore:
This patch introduces fused jumps for op_is_undefined_or_null, which ignores "masquerade as undefined" behavior.
This lets us fix a edge-case bug in RequireObjectCoercible (where ({ length } = document.all)
was a TypeError)
and moreover provides a very useful optimization for the new ?. and ?? operators, which have semantics centered
around op_jundefined_or_null and op_jnundefined_or_null, respectively.
- bytecode/BytecodeList.rb:
- bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
(JSC::isBranch):
- bytecode/PreciseJumpTargetsInlines.h:
- bytecompiler/BytecodeGenerator.cpp:
(JSC::Label::setLocation):
(JSC::BytecodeGenerator::emitJumpIfTrue):
(JSC::BytecodeGenerator::emitJumpIfFalse):
(JSC::BytecodeGenerator::emitRequireObjectCoercible):
- dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::capabilityLevel):
(JSC::JIT::privateCompileMainPass):
- jit/JIT.h:
- jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_jundefined_or_null): Added.
(JSC::JIT::emit_op_jnundefined_or_null): Added.
(JSC::JIT::emit_op_jundefined_or_null): Added.
(JSC::JIT::emit_op_jnundefined_or_null): Added.
- llint/LowLevelInterpreter32_64.asm:
- llint/LowLevelInterpreter64.asm: