Ignore:
Timestamp:
Nov 9, 2015, 6:15:21 AM (10 years ago)
Author:
[email protected]
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r191897 r192155  
    213213        DEFINE_OP(op_create_out_of_band_arguments)
    214214        DEFINE_OP(op_check_tdz)
     215        DEFINE_OP(op_assert)
    215216        DEFINE_OP(op_debug)
    216217        DEFINE_OP(op_del_by_id)
Note: See TracChangeset for help on using the changeset viewer.