Ignore:
Timestamp:
Dec 28, 2017, 11:52:24 PM (7 years ago)
Author:
[email protected]
Message:

Remove op_assert and make @assert in builtins a function call so we have DFG/FTL coverage for builtins that use @assert in debug builds
https://bugs.webkit.org/show_bug.cgi?id=181176

Reviewed by Yusuke Suzuki.

Previously, op_assert was only implemented in the LLInt and baseline JIT. This
meant that any builtin that used @assert was not tiering up to the DFG/FTL
in debug builds. This patch changes @assert to just call a host function when
!ASSERT_DISABLED. It's a no-op when ASSERT_DISABLED. Now, builtins that use @assert
will tier up to the DFG/FTL on debug builds.

  • builtins/BuiltinNames.h:
  • bytecode/BytecodeDumper.cpp:

(JSC::BytecodeDumper<Block>::dumpBytecode):

  • bytecode/BytecodeIntrinsicRegistry.h:
  • bytecode/BytecodeList.json:
  • bytecode/BytecodeUseDef.h:

(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitAssert): Deleted.

  • bytecompiler/BytecodeGenerator.h:
  • bytecompiler/NodesCodegen.cpp:

(JSC::FunctionCallResolveNode::emitBytecode):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_assert): Deleted.

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):

  • llint/LowLevelInterpreter.asm:
  • runtime/CommonSlowPaths.cpp:
  • runtime/CommonSlowPaths.h:
  • runtime/JSGlobalObject.cpp:

(JSC::assertCall):
(JSC::JSGlobalObject::init):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r226209 r226310  
    871871RegisterID* FunctionCallResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
    872872{
     873    if (UNLIKELY(m_ident == generator.vm()->propertyNames->builtinNames().assertPrivateName())) {
     874        if (ASSERT_DISABLED)
     875            return generator.moveToDestinationIfNeeded(dst, generator.emitLoad(nullptr, jsUndefined()));
     876    }
     877
    873878    ExpectedFunction expectedFunction = generator.expectedFunctionForIdentifier(m_ident);
    874879
     
    932937
    933938    return generator.emitUnaryNoDstOp(op_argument_count, generator.finalDestination(dst));
    934 }
    935 
    936 RegisterID* BytecodeIntrinsicNode::emit_intrinsic_assert(BytecodeGenerator& generator, RegisterID* dst)
    937 {
    938 #ifndef NDEBUG
    939     ArgumentListNode* node = m_args->m_listNode;
    940     RefPtr<RegisterID> condition = generator.emitNode(node);
    941     generator.emitAssert(condition.get(), node->firstLine());
    942     return dst;
    943 #else
    944     UNUSED_PARAM(generator);
    945     return dst;
    946 #endif
    947939}
    948940
Note: See TracChangeset for help on using the changeset viewer.