Ignore:
Timestamp:
Jun 18, 2010, 1:14:23 PM (15 years ago)
Author:
[email protected]
Message:

2010-06-17 Oliver Hunt <[email protected]>

Reviewed by Sam Weinig.

Don't throw away exception information for functions that use exceptions
https://bugs.webkit.org/show_bug.cgi?id=40786

Simple patch to stop JSC from throwing away the exception information
of a function that uses "exceptiony" features like try and throw. This
is a speed up for catching expressions but it's difficult to quantify as
the old cost of reparsing is amortised over all exceptions caught in the
effected function.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::generate): (JSC::BytecodeGenerator::emitCatch):
  • bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::emitThrow):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r60762 r61430  
    157157
    158158#if !ENABLE(OPCODE_SAMPLING)
    159     if (!m_regeneratingForExceptionInfo && (m_codeType == FunctionCode || m_codeType == EvalCode))
     159    if (!m_regeneratingForExceptionInfo && !m_usesExceptions && (m_codeType == FunctionCode || m_codeType == EvalCode))
    160160        m_codeBlock->clearExceptionInfo();
    161161#endif
     
    220220    , m_lastOpcodeID(op_end)
    221221    , m_emitNodeDepth(0)
     222    , m_usesExceptions(false)
    222223    , m_regeneratingForExceptionInfo(false)
    223224    , m_codeBlockBeingRegeneratedFrom(0)
     
    305306    , m_lastOpcodeID(op_end)
    306307    , m_emitNodeDepth(0)
     308    , m_usesExceptions(false)
    307309    , m_regeneratingForExceptionInfo(false)
    308310    , m_codeBlockBeingRegeneratedFrom(0)
     
    406408    , m_lastOpcodeID(op_end)
    407409    , m_emitNodeDepth(0)
     410    , m_usesExceptions(false)
    408411    , m_regeneratingForExceptionInfo(false)
    409412    , m_codeBlockBeingRegeneratedFrom(0)
     
    18431846RegisterID* BytecodeGenerator::emitCatch(RegisterID* targetRegister, Label* start, Label* end)
    18441847{
     1848    m_usesExceptions = true;
    18451849#if ENABLE(JIT)
    18461850    HandlerInfo info = { start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth, CodeLocationLabel() };
Note: See TracChangeset for help on using the changeset viewer.