Changeset 267535 in webkit
- Timestamp:
- Sep 24, 2020, 9:16:59 AM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
offlineasm/ast.rb (modified) (1 diff)
-
offlineasm/mips.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r267522 r267535 1 2020-09-24 Angelos Oikonomopoulos <angelos@igalia.com> 2 3 [MIPS] Broken build after r267371 4 https://bugs.webkit.org/show_bug.cgi?id=216893 5 6 Reviewed by Adrian Perez de Castro. 7 8 This addresses two issues. 9 10 First, the fix in https://bugs.webkit.org/show_bug.cgi?id=216772 was not 11 getting exercised, because the LabelReference offset was always zero. 12 13 The reason the offset was zero is that LabelReference.mapChildren would discard 14 the offset when generating a new LabelReference to wrap the Label returned by 15 the code block it yielded to. 16 17 The reason this was only an issue on MIPS is because only MIPS was using the 18 result of calls to LabelReference.mapChildren (in its lowering phase, 19 assignRegistersToTemporaries -> replaceTemporariesWithRegisters -> 20 mapChildren). Other archs, e.g. X86_64 only call mapChildren in earlier phases 21 (specifically, subsequent to a call to isASTErroneous), in which the new 22 LabelReferences returned by mapChildren are later discarded. Even though ARM 23 32/64 contains indirect calls to mapChildren, those are made after the 24 arm{,64}LowerLabelReferences transformation which doesn't leave any 25 LabelReference nodes around for .mapChildren to be called on. 26 27 So this is not an issue for architectures other than MIPS because 28 (a) AddImmediates.fold correctly constructs a LabelReference with an offset by 29 calling LabelReference.plusOffset and 30 (b) they don't call (and therefore don't use the result of) 31 LabelReference.mapChildren in their lowering code. 32 33 Second, the code we generate needs to look up the /label/ in the GOT, not the 34 computed address. After the lookup, we simply need to add the offset. 35 36 * offlineasm/ast.rb: 37 * offlineasm/mips.rb: 38 1 39 2020-09-24 Ross Kirsling <ross.kirsling@sony.com> 2 40 -
trunk/Source/JavaScriptCore/offlineasm/ast.rb
r260310 r267535 1164 1164 1165 1165 def mapChildren 1166 LabelReference.new(codeOrigin, (yield @label)) 1166 result = LabelReference.new(codeOrigin, (yield @label)) 1167 result.offset = @offset 1168 result 1167 1169 end 1168 1170 -
trunk/Source/JavaScriptCore/offlineasm/mips.rb
r267395 r267535 1051 1051 if operands[0].is_a? LabelReference 1052 1052 labelRef = operands[0] 1053 $asm.puts "lw #{operands[1].mipsOperand}, %got(#{labelRef.asmLabel})($gp)" 1053 1054 if labelRef.offset > 0 1054 $asm.puts "li #{operands[1].mipsOperand}, #{labelRef.asmLabel}"1055 1055 $asm.puts "addu #{operands[1].mipsOperand}, #{operands[1].mipsOperand}, #{labelRef.offset}" 1056 $asm.puts "lw #{operands[1].mipsOperand}, %got(#{operands[1].mipsOperand})($gp)"1057 else1058 $asm.puts "lw #{operands[1].mipsOperand}, %got(#{labelRef.asmLabel})($gp)"1059 1056 end 1060 1057 else
Note:
See TracChangeset
for help on using the changeset viewer.