Changeset 95683 in webkit


Ignore:
Timestamp:
Sep 21, 2011 4:46:09 PM (13 years ago)
Author:
fpizlo@apple.com
Message:

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

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:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r95681 r95683  
     12011-09-21  Filip Pizlo  <fpizlo@apple.com>
     2
     3        DFG JIT should be able to compile op_throw
     4        https://bugs.webkit.org/show_bug.cgi?id=68571
     5
     6        Reviewed by Geoffrey Garen.
     7       
     8        This compiles op_throw in the simplest way possible: it's an OSR
     9        point back to the old JIT. This is a good step towards increasing
     10        coverage, particularly on Kraken, but it's neutral because the
     11        same functions that do throw also use some other unsupported
     12        opcodes.
     13
     14        * dfg/DFGByteCodeParser.cpp:
     15        (JSC::DFG::ByteCodeParser::parseBlock):
     16        * dfg/DFGCapabilities.h:
     17        (JSC::DFG::canCompileOpcode):
     18        * dfg/DFGNode.h:
     19        * dfg/DFGPropagator.cpp:
     20        (JSC::DFG::Propagator::propagateNodePredictions):
     21        * dfg/DFGSpeculativeJIT.cpp:
     22        (JSC::DFG::SpeculativeJIT::compile):
     23
    1242011-09-21  Filip Pizlo  <fpizlo@apple.com>
    225
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r95681 r95683  
    13151315            LAST_OPCODE(op_end);
    13161316           
     1317        case op_throw:
     1318            addToGraph(Throw, get(currentInstruction[1].u.operand));
     1319            LAST_OPCODE(op_throw);
     1320           
     1321        case op_throw_reference_error:
     1322            addToGraph(ThrowReferenceError);
     1323            LAST_OPCODE(op_throw_reference_error);
     1324           
    13171325        case op_call: {
    13181326            NodeIndex callTarget = get(currentInstruction[1].u.operand);
  • trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h

    r95672 r95683  
    115115    case op_resolve:
    116116    case op_resolve_base:
     117    case op_throw:
     118    case op_throw_reference_error:
    117119        return true;
    118120    default:
  • trunk/Source/JavaScriptCore/dfg/DFGNode.h

    r95672 r95683  
    298298    macro(Jump, NodeMustGenerate | NodeIsTerminal | NodeIsJump) \
    299299    macro(Branch, NodeMustGenerate | NodeIsTerminal | NodeIsBranch) \
    300     macro(Return, NodeMustGenerate | NodeIsTerminal)
     300    macro(Return, NodeMustGenerate | NodeIsTerminal) \
     301    macro(Throw, NodeMustGenerate | NodeIsTerminal) \
     302    macro(ThrowReferenceError, NodeMustGenerate | NodeIsTerminal)
    301303
    302304// This enum generates a monotonically increasing id for all Node types,
  • trunk/Source/JavaScriptCore/dfg/DFGPropagator.cpp

    r95672 r95683  
    553553        case CheckHasInstance:
    554554        case Phi:
     555        case Throw:
     556        case ThrowReferenceError:
    555557            break;
    556558           
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r95681 r95683  
    15251525        break;
    15261526    }
     1527       
     1528    case Throw:
     1529    case ThrowReferenceError: {
     1530        // We expect that throw statements are rare and are intended to exit the code block
     1531        // anyway, so we just OSR back to the old JIT for now.
     1532        terminateSpeculativeExecution();
     1533        break;
     1534    }
    15271535
    15281536    case ConvertThis: {
Note: See TracChangeset for help on using the changeset viewer.