Changeset 233893 in webkit
- Timestamp:
- Jul 17, 2018 1:20:21 PM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r233862 r233893 1 2018-07-17 Mark Lam <mark.lam@apple.com> 2 3 CodeBlock::baselineVersion() should account for executables with purged codeBlocks. 4 https://bugs.webkit.org/show_bug.cgi?id=187736 5 <rdar://problem/42114371> 6 7 Reviewed by Michael Saboff. 8 9 CodeBlock::baselineVersion() currently checks for a null replacement but does not 10 account for the fact that that the replacement can also be null due to the 11 executable having being purged of its codeBlocks due to a memory event (see 12 ExecutableBase::clearCode()). This patch adds code to account for this. 13 14 * bytecode/CodeBlock.cpp: 15 (JSC::CodeBlock::baselineVersion): 16 1 17 2018-07-16 Yusuke Suzuki <utatane.tea@gmail.com> 2 18 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r233772 r233893 1638 1638 { 1639 1639 #if ENABLE(JIT) 1640 if (JITCode::isBaselineCode(jitType())) 1640 JITCode::JITType selfJITType = jitType(); 1641 if (JITCode::isBaselineCode(selfJITType)) 1641 1642 return this; 1642 1643 CodeBlock* result = replacement(); 1643 1644 if (!result) { 1644 // This can happen if we're creating the original CodeBlock for an executable. 1645 // Assume that we're the baseline CodeBlock. 1646 RELEASE_ASSERT(jitType() == JITCode::None); 1647 return this; 1645 if (JITCode::isOptimizingJIT(selfJITType)) { 1646 // The replacement can be null if we've had a memory clean up and the executable 1647 // has been purged of its codeBlocks (see ExecutableBase::clearCode()). Regardless, 1648 // the current codeBlock is still live on the stack, and as an optimizing JIT 1649 // codeBlock, it will keep its baselineAlternative() alive for us to fetch below. 1650 result = this; 1651 } else { 1652 // This can happen if we're creating the original CodeBlock for an executable. 1653 // Assume that we're the baseline CodeBlock. 1654 RELEASE_ASSERT(selfJITType == JITCode::None); 1655 return this; 1656 } 1648 1657 } 1649 1658 result = result->baselineAlternative(); 1659 ASSERT(result); 1650 1660 return result; 1651 1661 #else
Note: See TracChangeset
for help on using the changeset viewer.