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/JITOpcodes.cpp

    r192125 r192155  
    518518    load64(Address(regT0, Exception::valueOffset()), regT0);
    519519    emitPutVirtualRegister(currentInstruction[2].u.operand);
     520}
     521
     522void JIT::emit_op_assert(Instruction* currentInstruction)
     523{
     524    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_assert);
     525    slowPathCall.call();
    520526}
    521527
Note: See TracChangeset for help on using the changeset viewer.