Changeset 167127 in webkit
- Timestamp:
- Apr 11, 2014 8:55:29 AM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r167112 r167127 1 2014-04-11 Julien Brianceau <jbriance@cisco.com> 2 3 Fix LLInt for sh4 architecture (broken since C stack merge). 4 https://bugs.webkit.org/show_bug.cgi?id=131532 5 6 Reviewed by Mark Lam. 7 8 This patch fixes build and also implements sh4 parts for initPCRelative and 9 setEntryAddress macros introduced in http://trac.webkit.org/changeset/167094. 10 11 * llint/LowLevelInterpreter.asm: 12 * llint/LowLevelInterpreter32_64.asm: 13 * offlineasm/instructions.rb: 14 * offlineasm/sh4.rb: 15 1 16 2014-04-10 Michael Saboff <msaboff@apple.com> 2 17 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r167094 r167127 229 229 230 230 macro checkStackPointerAlignment(tempReg, location) 231 if ARM64 or C_LOOP 231 if ARM64 or C_LOOP or SH4 232 232 # ARM64 will check for us! 233 233 # C_LOOP does not need the alignment, and can use a little perf 234 234 # improvement from avoiding useless work. 235 # SH4 does not need specific alignment (4 bytes). 235 236 else 236 237 if ARM or ARMv7 or ARMv7_TRADITIONAL … … 301 302 elsif ARM64 302 303 pushLRAndFP 303 elsif C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS 304 elsif C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS or SH4 304 305 push lr 305 306 push cfr … … 313 314 elsif ARM64 314 315 popLRAndFP 315 elsif C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS 316 elsif C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS or SH4 316 317 pop cfr 317 318 pop lr … … 327 328 elsif ARM64 328 329 pushLRAndFP 329 elsif C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS 330 elsif C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS or SH4 330 331 push lr 331 332 push cfr … … 382 383 elsif ARM64 383 384 popLRAndFP 384 elsif C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS 385 elsif C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS or SH4 385 386 pop cfr 386 387 pop lr … … 717 718 crash() # Need to replace with any initialization steps needed to step up PC relative address calculation 718 719 elsif SH4 719 crash() # Need to replace with any initialization steps needed to step up PC relative address calculation 720 mova _relativePCBase, t0 721 move t0, pcBase 722 alignformova 723 _relativePCBase: 720 724 end 721 725 end … … 742 746 crash() # Need to replace with code to turn label into and absolute address and save at index 743 747 elsif SH4 744 crash() # Need to replace with code to turn label into and absolute address and save at index 748 move label, t2 749 subp _relativePCBase, t2 750 addp t1, t2 751 move index, t3 752 storep t2, [a0, t3, 4] 753 flushcp # Force constant pool flush to avoid "pcrel too far" link error. 745 754 end 746 755 end -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r167031 r167127 193 193 elsif SH4 194 194 const entry = a0 195 const vm TopCallFrame= a1195 const vm = a1 196 196 const protoCallFrame = a2 197 const topOfStack = a3198 197 199 198 const previousCFR = t3 200 199 const previousPC = lr 201 200 const temp1 = t3 # Same as previousCFR 202 const temp2 = a3 # Same as topOfStack201 const temp2 = a3 203 202 const temp3 = t8 204 203 const temp4 = t9 -
trunk/Source/JavaScriptCore/offlineasm/instructions.rb
r167094 r167127 293 293 SH4_INSTRUCTIONS = 294 294 [ 295 "flushcp", 296 "alignformova", 297 "mova", 295 298 "shllx", 296 299 "shlrx", -
trunk/Source/JavaScriptCore/offlineasm/sh4.rb
r160315 r167127 151 151 end 152 152 153 class LabelReference 154 def sh4Operand 155 value 156 end 157 end 158 153 159 class ConstPool < Node 154 160 attr_reader :size … … 457 463 operands.each { 458 464 | operand | 459 if operand.is_a? LabelReference 465 if operand.is_a? LabelReference and node.opcode != "mova" 460 466 tmp = Tmp.new(operand.codeOrigin, :gpr) 461 467 newList << Instruction.new(operand.codeOrigin, "move", [operand, tmp]) … … 550 556 if node.is_a? Instruction 551 557 case node.opcode 552 when "jmp", "ret" 553 newList << node 558 when "jmp", "ret", "flushcp" 559 if node.opcode == "flushcp" 560 outlabel = LocalLabel.unique("flushcp") 561 newList << Instruction.new(codeOrigin, "jmp", [LocalLabelReference.new(codeOrigin, outlabel)]) 562 else 563 newList << node 564 end 554 565 if not currentPool16.empty? 555 566 newList << ConstPool.new(codeOrigin, currentPool16, 16) … … 559 570 newList << ConstPool.new(codeOrigin, currentPool32, 32) 560 571 currentPool32 = [] 572 end 573 if node.opcode == "flushcp" 574 newList << outlabel 561 575 end 562 576 when "move" … … 844 858 when "subi", "subp" 845 859 if operands.size == 3 846 if operands[1].sh4Operand == operands[2].sh4Operand 860 if operands[1].is_a? Immediate 861 $asm.puts "mov #{sh4Operands([Immediate.new(codeOrigin, -1 * operands[1].value), operands[2]])}" 862 $asm.puts "add #{sh4Operands([operands[0], operands[2]])}" 863 elsif operands[1].sh4Operand == operands[2].sh4Operand 847 864 $asm.puts "neg #{sh4Operands([operands[2], operands[2]])}" 848 865 $asm.puts "add #{sh4Operands([operands[0], operands[2]])}" … … 878 895 $asm.puts "shl#{opcode[3, 1]}#{operands[0].value} #{operands[1].sh4Operand}" 879 896 end 897 when "shalx", "sharx" 898 raise "Unhandled parameters for opcode #{opcode}" unless operands[0].is_a? Immediate and operands[0].value == 1 899 $asm.puts "sha#{opcode[3, 1]} #{operands[1].sh4Operand}" 880 900 when "shld", "shad" 881 901 $asm.puts "#{opcode} #{sh4Operands(operands)}" … … 1009 1029 when "loadi", "loadis", "loadp", "storei", "storep" 1010 1030 $asm.puts "mov.l #{sh4Operands(operands)}" 1031 when "alignformova" 1032 $asm.puts ".balign 4" 1033 when "mova" 1034 $asm.puts "mova #{sh4Operands(operands)}" 1011 1035 when "move" 1012 1036 if operands[0].is_a? ConstPoolEntry … … 1046 1070 when "memfence" 1047 1071 $asm.puts "synco" 1072 when "pop" 1073 if operands[0].sh4Operand == "pr" 1074 $asm.puts "lds.l @r15+, #{sh4Operands(operands)}" 1075 else 1076 $asm.puts "mov.l @r15+, #{sh4Operands(operands)}" 1077 end 1078 when "push" 1079 if operands[0].sh4Operand == "pr" 1080 $asm.puts "sts.l #{sh4Operands(operands)}, @-r15" 1081 else 1082 $asm.puts "mov.l #{sh4Operands(operands)}, @-r15" 1083 end 1048 1084 when "popCalleeSaves" 1049 1085 $asm.puts "mov.l @r15+, r8" … … 1052 1088 $asm.puts "mov.l @r15+, r11" 1053 1089 $asm.puts "mov.l @r15+, r13" 1054 $asm.puts "lds.l @r15+, pr"1055 $asm.puts "mov.l @r15+, r14"1056 1090 when "pushCalleeSaves" 1057 $asm.puts "mov.l r14, @-r15"1058 $asm.puts "sts.l pr, @-r15"1059 1091 $asm.puts "mov.l r13, @-r15" 1060 1092 $asm.puts "mov.l r11, @-r15"
Note: See TracChangeset
for help on using the changeset viewer.