Changeset 206759 in webkit
- Timestamp:
- Oct 3, 2016 4:24:56 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r206653 r206759 1033 1033 if (MSVC) 1034 1034 set(LLIntOutput LowLevelInterpreterWin.asm) 1035 set(OFFLINE_ASM_ARGS --assembler=MASM) 1035 1036 else () 1036 1037 set(LLIntOutput LLIntAssembly.h) … … 1041 1042 MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb 1042 1043 DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm 1043 COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput} 1044 COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput} ${OFFLINE_ASM_ARGS} 1044 1045 COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput} 1045 1046 WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} -
trunk/Source/JavaScriptCore/ChangeLog
r206756 r206759 1 2016-10-03 Christopher Reid <Christopher.Reid@am.sony.com> 2 3 Offline asm should not output masm assembly when using a x86_64 asm backend 4 https://bugs.webkit.org/show_bug.cgi?id=162705 5 6 When cross compiling on windows to Clang, masm was being generated simply because 7 the os was windows. This change adds a command line parameter --assembler=MASM 8 to set the output assembly to masm. 9 The functions isGCC and isCompilingToWindows were removed as they are no longer called. 10 11 Reviewed by Mark Lam. 12 13 * CMakeLists.txt: 14 * offlineasm/asm.rb: 15 * offlineasm/x86.rb: 16 1 17 2016-10-03 JF Bastien <jfbastien@apple.com> 2 18 -
trunk/Source/JavaScriptCore/offlineasm/asm.rb
r200666 r206759 30 30 require "digest/sha1" 31 31 require "offsets" 32 require 'optparse' 32 33 require "parser" 33 34 require "self_hash" … … 302 303 outputFlnm = ARGV.shift 303 304 305 $options = {} 306 OptionParser.new do |opts| 307 opts.banner = "Usage: asm.rb asmFile offsetsFile outputFileName [--assembler=<ASM>]" 308 # This option is currently only used to specify the masm assembler 309 opts.on("--assembler=[ASM]", "Specify an assembler to use.") do |assembler| 310 $options[:assembler] = assembler 311 end 312 end.parse! 313 304 314 begin 305 315 configurationList = offsetsAndConfigurationIndex(offsetsFile) … … 320 330 $commentPrefix + " offlineasm input hash: " + parseHash(asmFile) + 321 331 " " + Digest::SHA1.hexdigest(configurationList.map{|v| (v[0] + [v[1]]).join(' ')}.join(' ')) + 322 " " + selfHash 332 " " + selfHash + 333 " " + Digest::SHA1.hexdigest($options.has_key?(:assembler) ? $options[:assembler] : "") 323 334 324 335 if FileTest.exist? outputFlnm -
trunk/Source/JavaScriptCore/offlineasm/x86.rb
r206555 r206759 126 126 end 127 127 128 def isCompilingOnWindows129 ENV['OS'] == 'Windows_NT'130 end131 132 def isGCC133 !isCompilingOnWindows134 end135 136 128 def isMSVC 137 isCompilingOnWindows129 $options.has_key?(:assembler) && $options[:assembler] == "MASM" 138 130 end 139 131 140 132 def isIntelSyntax 141 isCompilingOnWindows133 $options.has_key?(:assembler) && $options[:assembler] == "MASM" 142 134 end 143 135 … … 521 513 522 514 class Instruction 523 @@floatingPointCompareImplicitOperand = isIntelSyntax ? "st(0), " : ""524 515 525 516 def x86Operands(*kinds) … … 575 566 end 576 567 end 568 569 def getImplicitOperandString 570 isIntelSyntax ? "st(0), " : "" 571 end 577 572 578 573 def handleX86OpWithNumOperands(opcode, kind, numOperands) … … 809 804 810 805 def handleX87Compare(mode) 806 floatingPointCompareImplicitOperand = getImplicitOperandString 811 807 case mode 812 808 when :normal 813 809 if (operands[0].x87DefaultStackPosition == 0) 814 $asm.puts "fucomi #{ @@floatingPointCompareImplicitOperand}#{operands[1].x87Operand(0)}"810 $asm.puts "fucomi #{floatingPointCompareImplicitOperand}#{operands[1].x87Operand(0)}" 815 811 else 816 812 $asm.puts "fld #{operands[0].x87Operand(0)}" 817 $asm.puts "fucomip #{ @@floatingPointCompareImplicitOperand}#{operands[1].x87Operand(1)}"813 $asm.puts "fucomip #{floatingPointCompareImplicitOperand}#{operands[1].x87Operand(1)}" 818 814 end 819 815 when :reverse 820 816 if (operands[1].x87DefaultStackPosition == 0) 821 $asm.puts "fucomi #{ @@floatingPointCompareImplicitOperand}#{operands[0].x87Operand(0)}"817 $asm.puts "fucomi #{floatingPointCompareImplicitOperand}#{operands[0].x87Operand(0)}" 822 818 else 823 819 $asm.puts "fld #{operands[1].x87Operand(0)}" 824 $asm.puts "fucomip #{ @@floatingPointCompareImplicitOperand}#{operands[0].x87Operand(1)}"820 $asm.puts "fucomip #{floatingPointCompareImplicitOperand}#{operands[0].x87Operand(1)}" 825 821 end 826 822 else … … 1117 1113 when "bcd2i" 1118 1114 if useX87 1115 floatingPointCompareImplicitOperand = getImplicitOperandString 1119 1116 sp = RegisterID.new(nil, "sp") 1120 1117 if (operands[0].x87DefaultStackPosition == 0) … … 1128 1125 $asm.puts "je #{operands[2].asmLabel}" 1129 1126 $asm.puts "fild#{x86Suffix(:int)} #{getSizeString(:int)}#{offsetRegister(-4, sp.x86Operand(:ptr))}" 1130 $asm.puts "fucomip #{ @@floatingPointCompareImplicitOperand}#{operands[0].x87Operand(1)}"1127 $asm.puts "fucomip #{floatingPointCompareImplicitOperand}#{operands[0].x87Operand(1)}" 1131 1128 $asm.puts "jp #{operands[2].asmLabel}" 1132 1129 $asm.puts "jne #{operands[2].asmLabel}"
Note: See TracChangeset
for help on using the changeset viewer.