Changeset 243966 in webkit
- Timestamp:
- Apr 7, 2019 12:25:59 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r243959 r243966 1 2019-04-07 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] CallLinkInfo should clear Callee or CodeBlock even if it is unlinked by jettison 4 https://bugs.webkit.org/show_bug.cgi?id=196683 5 6 Reviewed by Saam Barati. 7 8 * stress/clear-callee-or-codeblock-in-calllinkinfo-even-cleared-by-jettison.js: Added. 9 (foo): 10 1 11 2019-04-05 Yusuke Suzuki <ysuzuki@apple.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r243959 r243966 1 2019-04-07 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] CallLinkInfo should clear Callee or CodeBlock even if it is unlinked by jettison 4 https://bugs.webkit.org/show_bug.cgi?id=196683 5 6 Reviewed by Saam Barati. 7 8 In r243626, we stop repatching CallLinkInfo when the CallLinkInfo is held by jettisoned CodeBlock. 9 But we still need to clear the Callee or CodeBlock since they are now dead. Otherwise, CodeBlock's 10 visitWeak eventually accesses this dead cells and crashes because the owner CodeBlock of CallLinkInfo 11 can be still live. 12 13 We also move all repatching operations from CallLinkInfo.cpp to Repatch.cpp for consistency because the 14 other repatching operations in CallLinkInfo are implemented in Repatch.cpp side. 15 16 * bytecode/CallLinkInfo.cpp: 17 (JSC::CallLinkInfo::setCallee): 18 (JSC::CallLinkInfo::clearCallee): 19 * jit/Repatch.cpp: 20 (JSC::linkFor): 21 (JSC::revertCall): 22 1 23 2019-04-05 Yusuke Suzuki <ysuzuki@apple.com> 2 24 -
trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp
r243626 r243966 32 32 #include "FunctionCodeBlock.h" 33 33 #include "JSCInlines.h" 34 #include "MacroAssembler.h"35 34 #include "Opcode.h" 36 35 #include "Repatch.h" … … 126 125 { 127 126 RELEASE_ASSERT(!isDirect()); 128 MacroAssembler::repatchPointer(hotPathBegin(), callee);129 127 m_calleeOrCodeBlock.set(vm, owner, callee); 130 128 } … … 133 131 { 134 132 RELEASE_ASSERT(!isDirect()); 135 MacroAssembler::repatchPointer(hotPathBegin(), nullptr);136 133 m_calleeOrCodeBlock.clear(); 137 134 } -
trunk/Source/JavaScriptCore/jit/Repatch.cpp
r243886 r243966 845 845 ASSERT(!callLinkInfo.isLinked()); 846 846 callLinkInfo.setCallee(vm, owner, callee); 847 MacroAssembler::repatchPointer(callLinkInfo.hotPathBegin(), callee); 847 848 callLinkInfo.setLastSeenCallee(vm, owner, callee); 848 849 if (shouldDumpDisassemblyFor(callerCodeBlock)) … … 896 897 static void revertCall(VM* vm, CallLinkInfo& callLinkInfo, MacroAssemblerCodeRef<JITStubRoutinePtrTag> codeRef) 897 898 { 898 if ( !callLinkInfo.clearedByJettison()) {899 if (callLinkInfo.isDirect()) {900 callLinkInfo.clearCodeBlock();899 if (callLinkInfo.isDirect()) { 900 callLinkInfo.clearCodeBlock(); 901 if (!callLinkInfo.clearedByJettison()) { 901 902 if (callLinkInfo.callType() == CallLinkInfo::DirectTailCall) 902 903 MacroAssembler::repatchJump(callLinkInfo.patchableJump(), callLinkInfo.slowPathStart()); 903 904 else 904 905 MacroAssembler::repatchNearCall(callLinkInfo.hotPathOther(), callLinkInfo.slowPathStart()); 905 } else { 906 } 907 } else { 908 if (!callLinkInfo.clearedByJettison()) { 906 909 MacroAssembler::revertJumpReplacementToBranchPtrWithPatch( 907 910 MacroAssembler::startOfBranchPtrWithPatchOnRegister(callLinkInfo.hotPathBegin()), 908 911 static_cast<MacroAssembler::RegisterID>(callLinkInfo.calleeGPR()), 0); 909 912 linkSlowFor(vm, callLinkInfo, codeRef); 910 callLinkInfo.clearCallee(); 911 } 913 MacroAssembler::repatchPointer(callLinkInfo.hotPathBegin(), nullptr); 914 } 915 callLinkInfo.clearCallee(); 912 916 } 913 917 callLinkInfo.clearSeen();
Note: See TracChangeset
for help on using the changeset viewer.