Ignore:
Timestamp:
May 13, 2014, 8:57:18 PM (11 years ago)
Author:
[email protected]
Message:

JIT breakpoints should be more informative
https://bugs.webkit.org/show_bug.cgi?id=132882

Reviewed by Oliver Hunt.

Introduce the notion of an AbortReason, which is a nice enumeration of coded assertion
failure names. This means that all you need to figure out why the JIT SIGTRAP'd is to look
at that platform's abort reason register (r11 on X86-64 for example).

  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/AbortReason.h: Added.
  • assembler/AbstractMacroAssembler.h:
  • assembler/MacroAssemblerARM64.h:

(JSC::MacroAssemblerARM64::abortWithReason):

  • assembler/MacroAssemblerARMv7.h:

(JSC::MacroAssemblerARMv7::abortWithReason):

  • assembler/MacroAssemblerX86.h:

(JSC::MacroAssemblerX86::abortWithReason):

  • assembler/MacroAssemblerX86_64.h:

(JSC::MacroAssemblerX86_64::abortWithReason):

  • dfg/DFGSlowPathGenerator.h:

(JSC::DFG::SlowPathGenerator::generate):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::bail):
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
(JSC::DFG::SpeculativeJIT::compileMakeRope):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::emitAllocateBasicStorage):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGThunks.cpp:

(JSC::DFG::osrEntryThunkGenerator):

  • jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::jitAssertIsInt32):
(JSC::AssemblyHelpers::jitAssertIsJSInt32):
(JSC::AssemblyHelpers::jitAssertIsJSNumber):
(JSC::AssemblyHelpers::jitAssertIsJSDouble):
(JSC::AssemblyHelpers::jitAssertIsCell):
(JSC::AssemblyHelpers::jitAssertTagsInPlace):
(JSC::AssemblyHelpers::jitAssertHasValidCallFrame):
(JSC::AssemblyHelpers::jitAssertIsNull):
(JSC::AssemblyHelpers::jitAssertArgumentCountSane):
(JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::checkStackPointerAlignment):
(JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo): Deleted.

  • jit/JIT.h:
  • jit/JITArithmetic.cpp:

(JSC::JIT::emitSlow_op_div):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emitSlow_op_loop_hint):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTINativeCall):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::compileGetDirectOffset):
(JSC::JIT::addStructureTransitionCheck): Deleted.
(JSC::JIT::testPrototype): Deleted.

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::compileGetDirectOffset):

  • jit/RegisterPreservationWrapperGenerator.cpp:

(JSC::generateRegisterRestoration):

  • jit/Repatch.cpp:

(JSC::addStructureTransitionCheck):
(JSC::linkClosureCall):

  • jit/ThunkGenerators.cpp:

(JSC::emitPointerValidation):
(JSC::nativeForGenerator):

  • yarr/YarrJIT.cpp:

(JSC::Yarr::YarrGenerator::generate):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp

    r158208 r168776  
    16401640                ASSERT(term->quantityCount == 1);
    16411641
    1642 #ifndef NDEBUG
    16431642                // Runtime ASSERT to make sure that the nested alternative handled the
    16441643                // "no input consumed" check.
    1645                 if (term->quantityType != QuantifierFixedCount && !term->parentheses.disjunction->m_minimumSize) {
     1644                if (!ASSERT_DISABLED && term->quantityType != QuantifierFixedCount && !term->parentheses.disjunction->m_minimumSize) {
    16461645                    Jump pastBreakpoint;
    16471646                    pastBreakpoint = branch32(NotEqual, index, Address(stackPointerRegister, term->frameLocation * sizeof(void*)));
    1648                     breakpoint();
     1647                    abortWithReason(YARRNoInputConsumed);
    16491648                    pastBreakpoint.link(this);
    16501649                }
    1651 #endif
    16521650
    16531651                // If the parenthese are capturing, store the ending index value to the
     
    16961694            case OpParenthesesSubpatternTerminalEnd: {
    16971695                YarrOp& beginOp = m_ops[op.m_previousOp];
    1698 #ifndef NDEBUG
    1699                 PatternTerm* term = op.m_term;
    1700 
    1701                 // Runtime ASSERT to make sure that the nested alternative handled the
    1702                 // "no input consumed" check.
    1703                 Jump pastBreakpoint;
    1704                 pastBreakpoint = branch32(NotEqual, index, Address(stackPointerRegister, term->frameLocation * sizeof(void*)));
    1705                 breakpoint();
    1706                 pastBreakpoint.link(this);
    1707 #endif
     1696                if (!ASSERT_DISABLED) {
     1697                    PatternTerm* term = op.m_term;
     1698                   
     1699                    // Runtime ASSERT to make sure that the nested alternative handled the
     1700                    // "no input consumed" check.
     1701                    Jump pastBreakpoint;
     1702                    pastBreakpoint = branch32(NotEqual, index, Address(stackPointerRegister, term->frameLocation * sizeof(void*)));
     1703                    abortWithReason(YARRNoInputConsumed);
     1704                    pastBreakpoint.link(this);
     1705                }
    17081706
    17091707                // We know that the match is non-zero, we can accept it  and
Note: See TracChangeset for help on using the changeset viewer.