JS Built-ins functions should be able to assert
https://bugs.webkit.org/show_bug.cgi?id=150333
Reviewed by Yusuke Suzuki.
Source/JavaScriptCore:
Introduced @assert to enable asserting in JS built-ins.
Adding a new bytecode 'assert' to implement it.
In debug builds, @assert generates 'assert' bytecodes.
In release builds, no byte code is produced for @assert.
In case assert is false, the JS built-in and the line number are dumped.
- bytecode/BytecodeList.json:
- bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
(JSC::CodeBlock::dumpBytecode):
- bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitAssert):
- bytecompiler/BytecodeGenerator.h:
- bytecompiler/NodesCodegen.cpp: Generating op_assert bytecode for @assert for Debug builds.
(JSC::BytecodeIntrinsicNode::emit_intrinsic_assert):
(JSC::JIT::privateCompileMainPass):
- jit/JIT.h:
- jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_assert):
(JSC::JIT::emit_op_create_assert):
- llint/LowLevelInterpreter.asm:
- runtime/CommonIdentifiers.h: Adding @assert identifier as intrinsic.
- runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
- runtime/CommonSlowPaths.h:
Source/WebCore:
- Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamReader): Activating an @assert.