Changeset 172429 in webkit for trunk/Source/JavaScriptCore/offlineasm
- Timestamp:
- Aug 11, 2014, 8:20:04 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore/offlineasm
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/offlineasm/arm.rb
r167566 r172429 467 467 $asm.puts "push { #{op.armOperand} }" 468 468 } 469 when "popCalleeSaves"470 if isARMv7471 $asm.puts "pop {r4-r6, r8-r11}"472 else473 $asm.puts "pop {r4-r10}"474 end475 when "pushCalleeSaves"476 if isARMv7477 $asm.puts "push {r4-r6, r8-r11}"478 else479 $asm.puts "push {r4-r10}"480 end481 469 when "move" 482 470 if operands[0].immediate? -
trunk/Source/JavaScriptCore/offlineasm/arm64.rb
r167094 r172429 587 587 $asm.puts "stp #{ops[0].arm64Operand(:ptr)}, #{ops[1].arm64Operand(:ptr)}, [sp, #-16]!" 588 588 } 589 when "popLRAndFP"590 $asm.puts "ldp x29, x30, [sp], #16"591 when "pushLRAndFP"592 $asm.puts "stp x29, x30, [sp, #-16]!"593 when "popCalleeSaves"594 $asm.puts "ldp x28, x27, [sp], #16"595 $asm.puts "ldp x26, x25, [sp], #16"596 $asm.puts "ldp x24, x23, [sp], #16"597 $asm.puts "ldp x22, x21, [sp], #16"598 $asm.puts "ldp x20, x19, [sp], #16"599 when "pushCalleeSaves"600 $asm.puts "stp x20, x19, [sp, #-16]!"601 $asm.puts "stp x22, x21, [sp, #-16]!"602 $asm.puts "stp x24, x23, [sp, #-16]!"603 $asm.puts "stp x26, x25, [sp, #-16]!"604 $asm.puts "stp x28, x27, [sp, #-16]!"605 589 when "move" 606 590 if operands[0].immediate? -
trunk/Source/JavaScriptCore/offlineasm/ast.rb
r167094 r172429 581 581 end 582 582 583 class StringLiteral < NoChildren 584 attr_reader :value 585 586 def initialize(codeOrigin, value) 587 super(codeOrigin) 588 @value = value[1..-2] 589 raise "Bad string literal #{value.inspect} at #{codeOriginString}" unless value.is_a? String 590 end 591 592 def dump 593 "#{value}" 594 end 595 596 def ==(other) 597 other.is_a? StringLiteral and other.value == @value 598 end 599 600 def address? 601 false 602 end 603 604 def label? 605 false 606 end 607 608 def immediate? 609 false 610 end 611 612 def immediateOperand? 613 false 614 end 615 616 def register? 617 false 618 end 619 end 620 583 621 class RegisterID < NoChildren 584 622 attr_reader :name … … 890 928 when "globalAnnotation" 891 929 $asm.putGlobalAnnotation 930 when "emit" 931 $asm.puts "#{operands[0].dump}" 892 932 else 893 933 raise "Unhandled opcode #{opcode} at #{codeOriginString}" -
trunk/Source/JavaScriptCore/offlineasm/cloop.rb
r167094 r172429 1105 1105 } 1106 1106 1107 when "pushCalleeSaves"1108 when "popCalleeSaves"1109 1110 1107 1111 1108 # A convenience and compact call to crash because we don't want to use -
trunk/Source/JavaScriptCore/offlineasm/instructions.rb
r167566 r172429 31 31 MACRO_INSTRUCTIONS = 32 32 [ 33 "emit", 33 34 "addi", 34 35 "andi", … … 249 250 "leai", 250 251 "leap", 251 "pushCalleeSaves",252 "popCalleeSaves",253 252 "memfence" 254 253 ] … … 268 267 ARM64_INSTRUCTIONS = 269 268 [ 270 "pcrtoaddr", # Address from PC relative offset - adr instruction 271 "popLRAndFP", # ARM64 requires registers to be pushed and popped in pairs, 272 "pushLRAndFP" # therefore we do LR (link register) and FP (frame pointer) together. 269 "pcrtoaddr" # Address from PC relative offset - adr instruction 273 270 ] 274 271 -
trunk/Source/JavaScriptCore/offlineasm/mips.rb
r161377 r172429 851 851 $asm.puts "sw #{op.mipsOperand}, 0($sp)" 852 852 } 853 when "popCalleeSaves"854 $asm.puts "lw $16, 0($sp)"855 $asm.puts "lw $17, 4($sp)"856 $asm.puts "lw $18, 8($sp)"857 $asm.puts "lw $19, 12($sp)"858 $asm.puts "lw $20, 16($sp)"859 $asm.puts "addiu $sp, $sp, 20"860 when "pushCalleeSaves"861 $asm.puts "addiu $sp, $sp, -20"862 $asm.puts "sw $20, 16($sp)"863 $asm.puts "sw $19, 12($sp)"864 $asm.puts "sw $18, 8($sp)"865 $asm.puts "sw $17, 4($sp)"866 $asm.puts "sw $16, 0($sp)"867 853 when "move", "sxi2p", "zxi2p" 868 854 if operands[0].is_a? Immediate -
trunk/Source/JavaScriptCore/offlineasm/parser.rb
r167094 r172429 166 166 when /\A[:,\(\)\[\]=\+\-~\|&^*]/ 167 167 result << Token.new(CodeOrigin.new(fileName, lineNumber), $&) 168 when /\A".*"/ 169 result << Token.new(CodeOrigin.new(fileName, lineNumber), $&) 168 170 else 169 171 raise "Lexer error at #{CodeOrigin.new(fileName, lineNumber).to_s}, unexpected sequence #{str[0..20].inspect}" … … 211 213 def isInteger(token) 212 214 token =~ /\A[0-9]/ 215 end 216 217 def isString(token) 218 token =~ /\A".*"/ 213 219 end 214 220 … … 398 404 @idx += 1 399 405 result 406 elsif isString @tokens[@idx] 407 result = StringLiteral.new(@tokens[@idx].codeOrigin, @tokens[@idx].string) 408 @idx += 1 409 result 400 410 elsif isIdentifier @tokens[@idx] 401 411 codeOrigin, names = parseColonColon … … 439 449 440 450 def couldBeExpression 441 @tokens[@idx] == "-" or @tokens[@idx] == "~" or @tokens[@idx] == "sizeof" or isInteger(@tokens[@idx]) or is Variable(@tokens[@idx]) or @tokens[@idx] == "("451 @tokens[@idx] == "-" or @tokens[@idx] == "~" or @tokens[@idx] == "sizeof" or isInteger(@tokens[@idx]) or isString(@tokens[@idx]) or isVariable(@tokens[@idx]) or @tokens[@idx] == "(" 442 452 end 443 453 -
trunk/Source/JavaScriptCore/offlineasm/sh4.rb
r167269 r172429 1092 1092 $asm.puts "mov.l #{sh4Operands(operands)}, @-r15" 1093 1093 end 1094 when "popCalleeSaves"1095 $asm.puts "mov.l @r15+, r8"1096 $asm.puts "mov.l @r15+, r9"1097 $asm.puts "mov.l @r15+, r10"1098 $asm.puts "mov.l @r15+, r11"1099 $asm.puts "mov.l @r15+, r13"1100 when "pushCalleeSaves"1101 $asm.puts "mov.l r13, @-r15"1102 $asm.puts "mov.l r11, @-r15"1103 $asm.puts "mov.l r10, @-r15"1104 $asm.puts "mov.l r9, @-r15"1105 $asm.puts "mov.l r8, @-r15"1106 1094 when "break" 1107 1095 # This special opcode always generates an illegal instruction exception. -
trunk/Source/JavaScriptCore/offlineasm/transform.rb
r167094 r172429 424 424 end 425 425 426 class StringLiteral 427 def validate 428 end 429 end 430 426 431 class RegisterID 427 432 def validate -
trunk/Source/JavaScriptCore/offlineasm/x86.rb
r170428 r172429 1147 1147 $asm.puts "push #{op.x86Operand(:ptr)}" 1148 1148 } 1149 when "popCalleeSaves"1150 if isX641151 if isMSVC1152 $asm.puts "pop " + register("rsi")1153 $asm.puts "pop " + register("rdi")1154 end1155 $asm.puts "pop " + register("rbx")1156 $asm.puts "pop " + register("r15")1157 $asm.puts "pop " + register("r14")1158 $asm.puts "pop " + register("r13")1159 $asm.puts "pop " + register("r12")1160 else1161 $asm.puts "pop " + register("ebx")1162 $asm.puts "pop " + register("edi")1163 $asm.puts "pop " + register("esi")1164 end1165 when "pushCalleeSaves"1166 if isX641167 $asm.puts "push " + register("r12")1168 $asm.puts "push " + register("r13")1169 $asm.puts "push " + register("r14")1170 $asm.puts "push " + register("r15")1171 $asm.puts "push " + register("rbx")1172 if isMSVC1173 $asm.puts "push " + register("rdi")1174 $asm.puts "push " + register("rsi")1175 end1176 else1177 $asm.puts "push " + register("esi")1178 $asm.puts "push " + register("edi")1179 $asm.puts "push " + register("ebx")1180 end1181 1149 when "move" 1182 1150 handleMove
Note:
See TracChangeset
for help on using the changeset viewer.