WebKit Bugzilla
Attachment 339497 Details for
Bug 185281
: OSR entry pruning of Program Bytecodes doesn't take into account try/catch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated Patch
185281-2.patch (text/plain), 4.01 KB, created by
Michael Saboff
on 2018-05-03 17:48:46 PDT
(
hide
)
Description:
Updated Patch
Filename:
MIME Type:
Creator:
Michael Saboff
Created:
2018-05-03 17:48:46 PDT
Size:
4.01 KB
patch
obsolete
>Index: JSTests/ChangeLog >=================================================================== >--- JSTests/ChangeLog (revision 231336) >+++ JSTests/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2018-05-03 Michael Saboff <msaboff@apple.com> >+ >+ OSR entry pruning of Program Bytecodes doesn't take into account try/catch >+ https://bugs.webkit.org/show_bug.cgi?id=185281 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ New regression test. >+ >+ * stress/baseline-osrentry-catch-is-reachable.js: Added. >+ (i.j.catch): >+ > 2018-05-03 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed, rolling out r231197. >Index: JSTests/stress/baseline-osrentry-catch-is-reachable.js >=================================================================== >--- JSTests/stress/baseline-osrentry-catch-is-reachable.js (nonexistent) >+++ JSTests/stress/baseline-osrentry-catch-is-reachable.js (working copy) >@@ -0,0 +1,17 @@ >+// Regression test for bug 185281. This should terminate without throwing. >+ >+// These values are added to increase bytecode count. >+let foo = {}; >+foo.x = null; >+foo.y = null; >+let z = null; >+let z2 = {}; >+ >+for (var i = 0; i <= 10; i++) { >+ for (var j = 0; j <= 100; j++) { >+ try { >+ xxx; >+ for (;;) {} >+ } catch (e) {} >+ } >+} >Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 231317) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2018-05-03 Michael Saboff <msaboff@apple.com> >+ >+ OSR entry pruning of Program Bytecodes doesn't take into account try/catch >+ https://bugs.webkit.org/show_bug.cgi?id=185281 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When we compute bytecode block reachability, we need to take into account blocks >+ containing try/catch. >+ >+ * jit/JIT.cpp: >+ (JSC::JIT::privateCompileMainPass): >+ > 2018-05-03 Michael Saboff <msaboff@apple.com> > > WebContent crash loading page on seas.upenn.edu @ JavaScriptCore: vmEntryToJavaScript >Index: Source/JavaScriptCore/jit/JIT.cpp >=================================================================== >--- Source/JavaScriptCore/jit/JIT.cpp (revision 231316) >+++ Source/JavaScriptCore/jit/JIT.cpp (working copy) >@@ -30,6 +30,7 @@ > #include "JIT.h" > > #include "BytecodeGraph.h" >+#include "BytecodeLivenessAnalysis.h" > #include "CodeBlock.h" > #include "CodeBlockWithJITType.h" > #include "DFGCapabilities.h" >@@ -199,6 +200,7 @@ void JIT::privateCompileMainPass() > VM& vm = *m_codeBlock->vm(); > unsigned startBytecodeOffset = 0; > if (m_loopOSREntryBytecodeOffset && (m_codeBlock->inherits<ProgramCodeBlock>(vm) || m_codeBlock->inherits<ModuleProgramCodeBlock>(vm))) { >+ > // We can only do this optimization because we execute ProgramCodeBlock's exactly once. > // This optimization would be invalid otherwise. When the LLInt determines it wants to > // do OSR entry into the baseline JIT in a loop, it will pass in the bytecode offset it >@@ -219,9 +221,19 @@ void JIT::privateCompileMainPass() > GraphNodeWorklist<BytecodeBasicBlock*> worklist; > startBytecodeOffset = UINT_MAX; > worklist.push(block); >+ > while (BytecodeBasicBlock* block = worklist.pop()) { > startBytecodeOffset = std::min(startBytecodeOffset, block->leaderOffset()); > worklist.pushAll(block->successors()); >+ for (unsigned bytecodeOffset = block->leaderOffset(); bytecodeOffset < block->leaderOffset() + block->totalLength();) { >+ OpcodeID opcodeID = Interpreter::getOpcodeID(instructionsBegin[bytecodeOffset].u.opcode); >+ if (auto* handler = m_codeBlock->handlerForBytecodeOffset(bytecodeOffset)) >+ worklist.push(graph.findBasicBlockWithLeaderOffset(handler->target)); >+ >+ unsigned opcodeLength = opcodeLengths[opcodeID]; >+ bytecodeOffset += opcodeLength; >+ } >+ > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
saam
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185281
:
339494
| 339497