Changeset 214969 in webkit
- Timestamp:
- Apr 5, 2017 2:00:17 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r214950 r214969 1 2017-04-05 Guilherme Iscaro <iscaro@profusion.mobi> 2 3 Do not use BLX for immediates (ARM-32) 4 5 https://bugs.webkit.org/show_bug.cgi?id=170351 6 7 Reviewed by Mark Lam. 8 9 Currently the offline asm generator for 32-bit ARM code translates the 10 'call' meta-instruction (which may be found in LowLevelInterpreter.asm 11 and friends) to the ARM's BLX instrunction. The BLX instruction may be 12 used for labels (immediates) and registers and one side effect of BLX 13 is that it may switch the processor's instruction set. 14 A 'BLX register' instruction will change/remain the processor state to 15 ARM if the register_bit[0] is set to 0 or change/remain to Thumb if 16 register_bit[0] is set to 1. However, a 'BLX label' instruction will 17 always switch the processor state. It switches ARM to thumb and vice-versa. 18 This behaviour is unwanted, since the C++ code and the offlineasm generated code 19 are both compiled using the same instruction set, thus a instruction 20 set change will likely produce a crash. In order to fix the problem the 21 BL instruction can be used for labels. It will branch just like BLX, 22 but it won't change the instruction set. It's important to note that 23 Darwin is not affected by this problem, thus to minimize the impact of 24 this change the BL instruction will only be used on non-darwin targets. 25 26 BLX reference: http://infocenter.arm.com/help/topic/com.arm.doc.dui0489i/CIHBJCDC.html?resultof=%22%62%6c%78%22%20 27 28 * offlineasm/arm.rb: 29 1 30 2017-04-05 Keith Miller <keith_miller@apple.com> 2 31 -
trunk/Source/JavaScriptCore/offlineasm/arm.rb
r196541 r214969 95 95 ARM_EXTRA_FPRS = [SpecialRegister.new("d7")] 96 96 ARM_SCRATCH_FPR = SpecialRegister.new("d6") 97 OS_DARWIN = ((RUBY_PLATFORM =~ /darwin/i) != nil) 97 98 98 99 def armMoveImmediate(value, register) … … 569 570 when "call" 570 571 if operands[0].label? 571 $asm.puts "blx #{operands[0].asmLabel}" 572 if OS_DARWIN 573 $asm.puts "blx #{operands[0].asmLabel}" 574 else 575 $asm.puts "bl #{operands[0].asmLabel}" 576 end 572 577 else 573 578 $asm.puts "blx #{operands[0].armOperand}"
Note: See TracChangeset
for help on using the changeset viewer.