Changeset 194786 in webkit


Ignore:
Timestamp:
Jan 8, 2016, 1:42:23 PM (10 years ago)
Author:
fpizlo@apple.com
Message:

FTL B3 compile() doesn't clear exception handlers before we add FTL-specific ones
https://bugs.webkit.org/show_bug.cgi?id=152922

Reviewed by Saam Barati.

FTL B3 was generating a handler table that first contained the old baseline handlers keyed
by baseline's bytecode indices and then the FTL handlers keyed by FTL callsite index. That's
wrong, since the FTL code block should not contain any baseline handlers. The fix is to
clear the handlers before generation, sort of like FTL LLVM does.

Also added some stuff to make it easier to inspect the handler table.

This reduces the numbe rof failures from 25 to 13.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::dumpExceptionHandlers):
(JSC::CodeBlock::beginDumpProfiling):

  • bytecode/CodeBlock.h:
  • ftl/FTLB3Compile.cpp:

(JSC::FTL::compile):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r194777 r194786  
     12016-01-08  Filip Pizlo  <fpizlo@apple.com>
     2
     3        FTL B3 compile() doesn't clear exception handlers before we add FTL-specific ones
     4        https://bugs.webkit.org/show_bug.cgi?id=152922
     5
     6        Reviewed by Saam Barati.
     7
     8        FTL B3 was generating a handler table that first contained the old baseline handlers keyed
     9        by baseline's bytecode indices and then the FTL handlers keyed by FTL callsite index. That's
     10        wrong, since the FTL code block should not contain any baseline handlers. The fix is to
     11        clear the handlers before generation, sort of like FTL LLVM does.
     12
     13        Also added some stuff to make it easier to inspect the handler table.
     14
     15        This reduces the numbe rof failures from 25 to 13.
     16
     17        * bytecode/CodeBlock.cpp:
     18        (JSC::CodeBlock::dumpBytecode):
     19        (JSC::CodeBlock::dumpExceptionHandlers):
     20        (JSC::CodeBlock::beginDumpProfiling):
     21        * bytecode/CodeBlock.h:
     22        * ftl/FTLB3Compile.cpp:
     23        (JSC::FTL::compile):
     24
    1252016-01-08  Filip Pizlo  <fpizlo@apple.com>
    226
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r194613 r194786  
    640640    }
    641641
    642     if (m_rareData && !m_rareData->m_exceptionHandlers.isEmpty()) {
    643         out.printf("\nException Handlers:\n");
    644         unsigned i = 0;
    645         do {
    646             HandlerInfo& handler = m_rareData->m_exceptionHandlers[i];
    647             out.printf("\t %d: { start: [%4d] end: [%4d] target: [%4d] } %s\n",
    648                 i + 1, handler.start, handler.end, handler.target, handler.typeName());
    649             ++i;
    650         } while (i < m_rareData->m_exceptionHandlers.size());
    651     }
     642    dumpExceptionHandlers(out);
    652643   
    653644    if (m_rareData && !m_rareData->m_switchJumpTables.isEmpty()) {
     
    694685
    695686    out.printf("\n");
     687}
     688
     689void CodeBlock::dumpExceptionHandlers(PrintStream& out)
     690{
     691    if (m_rareData && !m_rareData->m_exceptionHandlers.isEmpty()) {
     692        out.printf("\nException Handlers:\n");
     693        unsigned i = 0;
     694        do {
     695            HandlerInfo& handler = m_rareData->m_exceptionHandlers[i];
     696            out.printf("\t %d: { start: [%4d] end: [%4d] target: [%4d] } %s\n",
     697                i + 1, handler.start, handler.end, handler.target, handler.typeName());
     698            ++i;
     699        } while (i < m_rareData->m_exceptionHandlers.size());
     700    }
    696701}
    697702
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r194613 r194786  
    193193        PrintStream&, unsigned bytecodeOffset,
    194194        const StubInfoMap& = StubInfoMap(), const CallLinkInfoMap& = CallLinkInfoMap());
     195    void dumpExceptionHandlers(PrintStream&);
    195196    void printStructures(PrintStream&, const Instruction*);
    196197    void printStructure(PrintStream&, const char* name, const Instruction*, int operand);
  • trunk/Source/JavaScriptCore/ftl/FTLB3Compile.cpp

    r194716 r194786  
    110110    }
    111111
     112    // We will add exception handlers while generating.
     113    codeBlock->clearExceptionHandlers();
     114
    112115    CCallHelpers jit(&vm, codeBlock);
    113116    B3::generate(*state.proc, jit);
Note: See TracChangeset for help on using the changeset viewer.