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):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@194786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index 0232567..5905e91 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -639,16 +639,7 @@
} while (i < count);
}
- if (m_rareData && !m_rareData->m_exceptionHandlers.isEmpty()) {
- out.printf("\nException Handlers:\n");
- unsigned i = 0;
- do {
- HandlerInfo& handler = m_rareData->m_exceptionHandlers[i];
- out.printf("\t %d: { start: [%4d] end: [%4d] target: [%4d] } %s\n",
- i + 1, handler.start, handler.end, handler.target, handler.typeName());
- ++i;
- } while (i < m_rareData->m_exceptionHandlers.size());
- }
+ dumpExceptionHandlers(out);
if (m_rareData && !m_rareData->m_switchJumpTables.isEmpty()) {
out.printf("Switch Jump Tables:\n");
@@ -695,6 +686,20 @@
out.printf("\n");
}
+void CodeBlock::dumpExceptionHandlers(PrintStream& out)
+{
+ if (m_rareData && !m_rareData->m_exceptionHandlers.isEmpty()) {
+ out.printf("\nException Handlers:\n");
+ unsigned i = 0;
+ do {
+ HandlerInfo& handler = m_rareData->m_exceptionHandlers[i];
+ out.printf("\t %d: { start: [%4d] end: [%4d] target: [%4d] } %s\n",
+ i + 1, handler.start, handler.end, handler.target, handler.typeName());
+ ++i;
+ } while (i < m_rareData->m_exceptionHandlers.size());
+ }
+}
+
void CodeBlock::beginDumpProfiling(PrintStream& out, bool& hasPrintedProfiling)
{
if (hasPrintedProfiling) {