Changeset 95684 in webkit


Ignore:
Timestamp:
Sep 21, 2011 4:49:24 PM (13 years ago)
Author:
barraclough@apple.com
Message:

DFG JIT should be able to compile op_throw
https://bugs.webkit.org/show_bug.cgi?id=68571

Patch by Filip Pizlo <fpizlo@apple.com> on 2011-09-21
Reviewed by Geoffrey Garen.

This compiles op_throw in the simplest way possible: it's an OSR
point back to the old JIT. This is a good step towards increasing
coverage, particularly on Kraken, but it's neutral because the
same functions that do throw also use some other unsupported
opcodes.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGCapabilities.h:

(JSC::DFG::canCompileOpcode):

  • dfg/DFGNode.h:
  • dfg/DFGPropagator.cpp:

(JSC::DFG::Propagator::propagateNodePredictions):

  • dfg/DFGSpeculativeJIT.cpp:

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

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r95683 r95684  
    120120        (WTF::BitVector::resizeOutOfLine):
    121121        (WTF::BitVector::bits):
     122
     1232011-09-21  Gavin Barraclough  <barraclough@apple.com>
     124
     125        Add X86 GPRInfo for DFG JIT.
     126        https://bugs.webkit.org/show_bug.cgi?id=68586
     127
     128        Reviewed by Geoff Garen.
     129
     130        * dfg/DFGGPRInfo.h:
     131        (JSC::DFG::GPRInfo::toRegister):
     132        (JSC::DFG::GPRInfo::toIndex):
     133        (JSC::DFG::GPRInfo::debugName):
    122134
    1231352011-09-21  Gavin Barraclough  <barraclough@apple.com>
  • trunk/Source/JavaScriptCore/dfg/DFGGPRInfo.h

    r94996 r95684  
    3737#define InvalidGPRReg ((GPRReg)-1)
    3838
     39#if CPU(X86)
     40
     41class GPRInfo {
     42public:
     43    typedef GPRReg RegisterType;
     44    static const unsigned numberOfRegisters = 4;
     45
     46    // These registers match the baseline JIT.
     47    static const GPRReg cachedResultRegister = X86Registers::eax;
     48    static const GPRReg timeoutCheckRegister = X86Registers::esi;
     49    static const GPRReg callFrameRegister = X86Registers::edi;
     50    // Temporary registers.
     51    static const GPRReg regT0 = X86Registers::eax;
     52    static const GPRReg regT1 = X86Registers::edx;
     53    static const GPRReg regT2 = X86Registers::ecx;
     54    static const GPRReg regT3 = X86Registers::ebx;
     55    // These constants provide the names for the general purpose argument & return value registers.
     56    static const GPRReg argumentGPR0 = X86Registers::ecx; // regT2
     57    static const GPRReg argumentGPR1 = X86Registers::edx; // regT1
     58    static const GPRReg returnValueGPR = X86Registers::eax; // regT0
     59    static const GPRReg returnValueGPR2 = X86Registers::edx; // regT1
     60
     61    static GPRReg toRegister(unsigned index)
     62    {
     63        ASSERT(index < numberOfRegisters);
     64        static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, };
     65        return registerForIndex[index];
     66    }
     67
     68    static unsigned toIndex(GPRReg reg)
     69    {
     70        ASSERT(reg != InvalidGPRReg);
     71        ASSERT(reg < 8);
     72        static const unsigned indexForRegister[8] = { 0, 2, 1, 3, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex };
     73        unsigned result = indexForRegister[reg];
     74        ASSERT(result != InvalidIndex);
     75        return result;
     76    }
     77
     78#ifndef NDEBUG
     79    static const char* debugName(GPRReg reg)
     80    {
     81        ASSERT(reg != InvalidGPRReg);
     82        ASSERT(reg < 8);
     83        static const char* nameForRegister[8] = {
     84            "rax", "rcx", "rdx", "rbx",
     85            "rsp", "rbp", "rsi", "rdi",
     86        };
     87        return nameForRegister[reg];
     88    }
     89#endif
     90private:
     91
     92    static const unsigned InvalidIndex = 0xffffffff;
     93};
     94
     95#endif
     96
     97#if CPU(X86_64)
     98
    3999class GPRInfo {
    40100public:
     
    42102    static const unsigned numberOfRegisters = 9;
    43103
    44     // These registers match the old JIT.
     104    // These registers match the baseline JIT.
    45105    static const GPRReg cachedResultRegister = X86Registers::eax;
    46106    static const GPRReg timeoutCheckRegister = X86Registers::r12;
     
    102162};
    103163
     164#endif
     165
    104166typedef RegisterBank<GPRInfo>::iterator gpr_iterator;
    105167
Note: See TracChangeset for help on using the changeset viewer.