Ignore:
Timestamp:
Dec 19, 2011, 7:16:21 PM (13 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=74903
Exceptions not thrown correctly from DFG JIT on 32bit

Reviewed by Oliver Hunt.

Arguments for lookupExceptionHandler are not setup correctly.
In the case of ARMv7 we rely on lr being preserved over a call,
this in invalid. On x86 we don't should be poking the arguments onto the stack!

Source/JavaScriptCore:

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::bytecodeOffsetForCallAtIndex):

  • dfg/DFGAssemblyHelpers.h:

(JSC::DFG::AssemblyHelpers::restoreReturnAddressBeforeReturn):

  • dfg/DFGGPRInfo.h:
  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compileBody):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::addExceptionCheck):
(JSC::DFG::JITCompiler::addFastExceptionCheck):

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:

LayoutTests:

  • fast/js/dfg-exception-expected.txt: Added.
  • fast/js/dfg-exception.html: Added.
  • fast/js/script-tests/dfg-exception.js: Added.

(doesntDFGCompile):
(test):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGGPRInfo.h

    r99895 r103294  
    274274    static const GPRReg returnValueGPR = X86Registers::eax; // regT0
    275275    static const GPRReg returnValueGPR2 = X86Registers::edx; // regT1
     276    static const GPRReg nonPreservedNonReturnGPR = X86Registers::ecx;
    276277
    277278    static GPRReg toRegister(unsigned index)
     
    344345    static const GPRReg returnValueGPR = X86Registers::eax; // regT0
    345346    static const GPRReg returnValueGPR2 = X86Registers::edx; // regT1
     347    static const GPRReg nonPreservedNonReturnGPR = X86Registers::esi;
    346348
    347349    static GPRReg toRegister(unsigned index)
     
    416418    static const GPRReg returnValueGPR = ARMRegisters::r0; // regT0
    417419    static const GPRReg returnValueGPR2 = ARMRegisters::r1; // regT1
     420    static const GPRReg nonPreservedNonReturnGPR = ARMRegisters::r2;
    418421
    419422    static GPRReg toRegister(unsigned index)
Note: See TracChangeset for help on using the changeset viewer.