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/jit/AssemblyHelpers.h

    r167394 r168776  
    6363#if !defined(NDEBUG) && !CPU(ARM64)
    6464        Jump stackPointerAligned = branchTestPtr(Zero, stackPointerRegister, TrustedImm32(0xf));
    65         breakpoint();
     65        abortWithReason(AHStackPointerMisaligned);
    6666        stackPointerAligned.link(this);
    6767#endif
     
    630630    }
    631631
    632     static void emitStoreStructureWithTypeInfo(AssemblyHelpers& jit, TrustedImmPtr structure, RegisterID dest)
    633     {
    634         const Structure* structurePtr = static_cast<const Structure*>(structure.m_value);
    635 #if USE(JSVALUE64)
    636         jit.store64(TrustedImm64(structurePtr->idBlob()), MacroAssembler::Address(dest, JSCell::structureIDOffset()));
    637 #ifndef NDEBUG
    638         Jump correctStructure = jit.branch32(Equal, MacroAssembler::Address(dest, JSCell::structureIDOffset()), TrustedImm32(structurePtr->id()));
    639         jit.breakpoint();
    640         correctStructure.link(&jit);
    641 
    642         Jump correctIndexingType = jit.branch8(Equal, MacroAssembler::Address(dest, JSCell::indexingTypeOffset()), TrustedImm32(structurePtr->indexingType()));
    643         jit.breakpoint();
    644         correctIndexingType.link(&jit);
    645 
    646         Jump correctType = jit.branch8(Equal, MacroAssembler::Address(dest, JSCell::typeInfoTypeOffset()), TrustedImm32(structurePtr->typeInfo().type()));
    647         jit.breakpoint();
    648         correctType.link(&jit);
    649 
    650         Jump correctFlags = jit.branch8(Equal, MacroAssembler::Address(dest, JSCell::typeInfoFlagsOffset()), TrustedImm32(structurePtr->typeInfo().inlineTypeFlags()));
    651         jit.breakpoint();
    652         correctFlags.link(&jit);
    653 #endif
    654 #else
    655         // Do a 32-bit wide store to initialize the cell's fields.
    656         jit.store32(TrustedImm32(structurePtr->objectInitializationBlob()), MacroAssembler::Address(dest, JSCell::indexingTypeOffset()));
    657         jit.storePtr(structure, MacroAssembler::Address(dest, JSCell::structureIDOffset()));
    658 #endif
    659     }
     632    static void emitStoreStructureWithTypeInfo(AssemblyHelpers& jit, TrustedImmPtr structure, RegisterID dest);
    660633
    661634    Jump checkMarkByte(GPRReg cell)
Note: See TracChangeset for help on using the changeset viewer.