Changeset 280701 in webkit
- Timestamp:
- Aug 5, 2021, 11:30:29 AM (5 years ago)
- Location:
- branches/safari-612.1.27.0-branch/Source/JavaScriptCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
b3/B3LowerToAir.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612.1.27.0-branch/Source/JavaScriptCore/ChangeLog
r280579 r280701 1 2021-08-05 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r280659. rdar://problem/81569033 4 5 [ARM64] Fix Zoom black screen during video meeting on Safari 6 https://bugs.webkit.org/show_bug.cgi?id=228776 7 8 Reviewed by Saam Barati. 9 10 The problem (rdar://81434487) reports that Zoom turns to a black screen during the video 11 meeting on Safari. The reproduction of this problem is verified and bisected to the previous patch 12 (https://bugs.webkit.org/show_bug.cgi?id=228057). Previously, we introduce a pattern 13 matching for instruction EON-with-shift on ARM64, where the pattern is d = n ^ ((m ShiftType amount) ^ -1). 14 15 x = m ShiftType amount 16 y = x ^ -1 17 z = n ^ y 18 19 We check canBeInternal() on x but not on y based on the computing cost analysis in that patch, 20 which is totally wrong. If the pattern matching is triggered, then the compiler would not emit 21 the corresponding Air of x after lowering, leading to data corruption or system crash since y 22 depends on x. 23 24 In the real world example (Zoom video meeting), we find the B3 IR: 25 26 ... 27 Int32 b@528 = SShr(b@526, $31(b@527), Wasm: {opcode: I32ShrS, location: 0x26b}) 28 Int32 b@529 = BitXor(b@528, $-1(b@144), Wasm: {opcode: I32Xor, location: 0x26e}) 29 ... 30 Int32 b@551 = BitXor(b@446, b@529, Wasm: {opcode: I32Xor, location: 0x28e}) 31 ... 32 33 After Lowering to Air: 34 35 ... 36 Not32 %fp, %x2, b@529 37 ... 38 XorNotRightShift32 %tmp199, %tmp211, $31, %tmp209, b@551 39 ... 40 41 Since the implementation of the previous patch does commitInternal() on b@528, the operand of 42 b@529 turns to a frame pointer. To resolve this problem, we should either check canBeInternal() 43 on both b@528 and b@529 or not at all. 44 45 * b3/B3LowerToAir.cpp: 46 47 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280659 268f45cc-cd09-0410-ab3c-d52691b4dbfc 48 49 2021-08-04 Yijia Huang <yijia_huang@apple.com> 50 51 [ARM64] Fix Zoom black screen during video meeting on Safari 52 https://bugs.webkit.org/show_bug.cgi?id=228776 53 54 Reviewed by Saam Barati. 55 56 The problem (rdar://81434487) reports that Zoom turns to a black screen during the video 57 meeting on Safari. The reproduction of this problem is verified and bisected to the previous patch 58 (https://bugs.webkit.org/show_bug.cgi?id=228057). Previously, we introduce a pattern 59 matching for instruction EON-with-shift on ARM64, where the pattern is d = n ^ ((m ShiftType amount) ^ -1). 60 61 x = m ShiftType amount 62 y = x ^ -1 63 z = n ^ y 64 65 We check canBeInternal() on x but not on y based on the computing cost analysis in that patch, 66 which is totally wrong. If the pattern matching is triggered, then the compiler would not emit 67 the corresponding Air of x after lowering, leading to data corruption or system crash since y 68 depends on x. 69 70 In the real world example (Zoom video meeting), we find the B3 IR: 71 72 ... 73 Int32 b@528 = SShr(b@526, $31(b@527), Wasm: {opcode: I32ShrS, location: 0x26b}) 74 Int32 b@529 = BitXor(b@528, $-1(b@144), Wasm: {opcode: I32Xor, location: 0x26e}) 75 ... 76 Int32 b@551 = BitXor(b@446, b@529, Wasm: {opcode: I32Xor, location: 0x28e}) 77 ... 78 79 80 After Lowering to Air: 81 82 ... 83 Not32 %fp, %x2, b@529 84 ... 85 XorNotRightShift32 %tmp199, %tmp211, $31, %tmp209, b@551 86 ... 87 88 Since the implementation of the previous patch does commitInternal() on b@528, the operand of 89 b@529 turns to a frame pointer. To resolve this problem, we should either check canBeInternal() 90 on both b@528 and b@529 or not at all. 91 92 * b3/B3LowerToAir.cpp: 93 1 94 2021-08-02 Yijia Huang <yijia_huang@apple.com> 2 95 -
branches/safari-612.1.27.0-branch/Source/JavaScriptCore/b3/B3LowerToAir.cpp
r280579 r280701 3209 3209 XorNotRightShift32, XorNotRightShift64, 3210 3210 XorNotUnsignedRightShift32, XorNotUnsignedRightShift64); 3211 if (!isValidForm(opcode, Arg::Tmp, Arg::Tmp, Arg::Imm, Arg::Tmp) )3211 if (!isValidForm(opcode, Arg::Tmp, Arg::Tmp, Arg::Imm, Arg::Tmp) || !canBeInternal(right)) 3212 3212 return false; 3213 3213 Value* mValue = shiftValue->child(0); … … 3221 3221 3222 3222 append(opcode, tmp(nValue), tmp(mValue), imm(amountValue), tmp(m_value)); 3223 commitInternal(right); 3223 3224 commitInternal(shiftValue); 3224 3225 return true;
Note:
See TracChangeset
for help on using the changeset viewer.