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):
* bytecode/CodeBlock.cpp:
(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):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_assert):
* jit/JITOpcodes32_64.cpp:
(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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@192155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed