Take care of some ARM64 test failures
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 May 2014 01:53:56 +0000 (01:53 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 May 2014 01:53:56 +0000 (01:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133090

Reviewed by Geoffrey Garen.

PerformanceTests/SunSpider:

* profiler-test.yaml: Skip these on not-x86.

Source/JavaScriptCore:

Constant blinding on ARM64 cannot use the scratch register.

* assembler/MacroAssembler.h:
(JSC::MacroAssembler::convertInt32ToDouble):
(JSC::MacroAssembler::branchPtr):
(JSC::MacroAssembler::storePtr):
(JSC::MacroAssembler::store64):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::scratchRegisterForBlinding):

Tools:

* Scripts/run-jsc-stress-tests: Make it easier to conditionally skip things.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169092 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/SunSpider/ChangeLog
PerformanceTests/SunSpider/profiler-test.yaml
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/MacroAssembler.h
Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
Tools/ChangeLog
Tools/Scripts/run-jsc-stress-tests

index aa6a7d3..96fadee 100644 (file)
@@ -1,3 +1,12 @@
+2014-05-19  Filip Pizlo  <fpizlo@apple.com>
+
+        Take care of some ARM64 test failures
+        https://bugs.webkit.org/show_bug.cgi?id=133090
+
+        Reviewed by Geoffrey Garen.
+
+        * profiler-test.yaml: Skip these on not-x86.
+
 2014-03-14  Maciej Stachowiak  <mjs@apple.com>
 
         Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers
index 350753f..b5d269d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2013 Apple Inc. All rights reserved.
+# Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -25,4 +25,9 @@
 # with the runProfiler command.
 
 - path: tests/sunspider-1.0
-  cmd: runProfiler
+  cmd: |
+      if $architecture =~ /x86/
+          runProfiler
+      else
+          skip
+      end
index baafe4f..823d36c 100644 (file)
@@ -1,3 +1,20 @@
+2014-05-19  Filip Pizlo  <fpizlo@apple.com>
+
+        Take care of some ARM64 test failures
+        https://bugs.webkit.org/show_bug.cgi?id=133090
+
+        Reviewed by Geoffrey Garen.
+        
+        Constant blinding on ARM64 cannot use the scratch register.
+
+        * assembler/MacroAssembler.h:
+        (JSC::MacroAssembler::convertInt32ToDouble):
+        (JSC::MacroAssembler::branchPtr):
+        (JSC::MacroAssembler::storePtr):
+        (JSC::MacroAssembler::store64):
+        * assembler/MacroAssemblerARM64.h:
+        (JSC::MacroAssemblerARM64::scratchRegisterForBlinding):
+
 2014-05-19  Tanay C  <tanay.c@samsung.com>
 
         Removing some check-webkit-style warnings from ./dfg
index 8de7dbe..02d8cb0 100644 (file)
@@ -1140,7 +1140,7 @@ public:
 
     void convertInt32ToDouble(Imm32 imm, FPRegisterID dest)
     {
-        if (shouldBlind(imm)) {
+        if (shouldBlind(imm) && haveScratchRegisterForBlinding()) {
             RegisterID scratchRegister = scratchRegisterForBlinding();
             loadXorBlindedConstant(xorBlindConstant(imm), scratchRegister);
             convertInt32ToDouble(scratchRegister, dest);
@@ -1176,7 +1176,7 @@ public:
 
     Jump branchPtr(RelationalCondition cond, RegisterID left, ImmPtr right)
     {
-        if (shouldBlind(right)) {
+        if (shouldBlind(right) && haveScratchRegisterForBlinding()) {
             RegisterID scratchRegister = scratchRegisterForBlinding();
             loadRotationBlindedConstant(rotationBlindConstant(right), scratchRegister);
             return branchPtr(cond, left, scratchRegister);
@@ -1186,7 +1186,7 @@ public:
     
     void storePtr(ImmPtr imm, Address dest)
     {
-        if (shouldBlind(imm)) {
+        if (shouldBlind(imm) && haveScratchRegisterForBlinding()) {
             RegisterID scratchRegister = scratchRegisterForBlinding();
             loadRotationBlindedConstant(rotationBlindConstant(imm), scratchRegister);
             storePtr(scratchRegister, dest);
@@ -1196,7 +1196,7 @@ public:
 
     void store64(Imm64 imm, Address dest)
     {
-        if (shouldBlind(imm)) {
+        if (shouldBlind(imm) && haveScratchRegisterForBlinding()) {
             RegisterID scratchRegister = scratchRegisterForBlinding();
             loadRotationBlindedConstant(rotationBlindConstant(imm), scratchRegister);
             store64(scratchRegister, dest);
index 64147b3..45125c9 100644 (file)
@@ -2408,7 +2408,12 @@ public:
         return ARM64Assembler::maxJumpReplacementSize();
     }
 
-    RegisterID scratchRegisterForBlinding() { return getCachedDataTempRegisterIDAndInvalidate(); }
+    RegisterID scratchRegisterForBlinding()
+    {
+        // We *do not* have a scratch register for blinding.
+        RELEASE_ASSERT_NOT_REACHED();
+        return getCachedDataTempRegisterIDAndInvalidate();
+    }
 
     static bool canJumpReplacePatchableBranchPtrWithPatch() { return false; }
     static bool canJumpReplacePatchableBranch32WithPatch() { return false; }
index 71767c5..abe4c04 100644 (file)
@@ -1,3 +1,12 @@
+2014-05-19  Filip Pizlo  <fpizlo@apple.com>
+
+        Take care of some ARM64 test failures
+        https://bugs.webkit.org/show_bug.cgi?id=133090
+
+        Reviewed by Geoffrey Garen.
+
+        * Scripts/run-jsc-stress-tests: Make it easier to conditionally skip things.
+
 2014-05-19  David Kilzer  <ddkilzer@apple.com>
 
         [iOS] REGRESSION (r168910): webkitdirs.pm: Be more forgiving when parsing --sdk, --device and --sim
index eb22f6d..2286d99 100755 (executable)
@@ -176,6 +176,40 @@ unless $jscPath
     exit 1
 end
 
+# Try to determine architecture. Return nil on failure.
+def machOArchitectureCode
+    otoolLines = `otool -aSfh #{Shellwords.shellescape($jscPath.to_s)}`.split("\n")
+    otoolLines.each_with_index {
+        | value, index |
+        if value =~ /magic/ and value =~ /cputype/
+            return otoolLines[index + 1].split[1].to_i
+        end
+    }
+    $stderr.puts "Warning: unable to determine architecture."
+    nil
+end
+
+def determineArchitecture
+    code = machOArchitectureCode
+    return nil unless code
+    is64BitFlag = 0x01000000
+    case code
+    when 7
+        "x86"
+    when 7 | is64BitFlag
+        "x86-64"
+    when 12
+        "arm"
+    when 12 | is64BitFlag
+        "arm64"
+    else
+        $stderr.puts "Warning: unable to determine architecture from code: #{code}"
+        nil
+    end
+end
+
+$architecture = determineArchitecture
+
 $numFailures = 0
 
 EAGER_OPTIONS = ["--thresholdForJITAfterWarmUp=10", "--thresholdForJITSoon=10", "--thresholdForOptimizeAfterWarmUp=20", "--thresholdForOptimizeAfterLongWarmUp=20", "--thresholdForOptimizeSoon=20", "--thresholdForFTLOptimizeAfterWarmUp=20", "--thresholdForFTLOptimizeSoon=20"]
@@ -478,6 +512,7 @@ def baseOutputName(kind)
 end
 
 def addRunCommand(kind, command, outputHandler, errorHandler)
+    $didAddRunCommand = true
     plan = Plan.new($benchmarkDirectory, command, baseOutputName(kind), outputHandler, errorHandler)
     if $numProcessors > 1 and $runCommandOptions[:isSlow]
         $runlist.unshift plan
@@ -490,7 +525,8 @@ end
 # $benchmark), in which case those run commands have already been executed. Otherwise
 # returns false, in which case you're supposed to add your own run commands.
 def parseRunCommands
-    didRun = false
+    oldDidAddRunCommand = $didAddRunCommand
+    $didAddRunCommand = false
 
     Dir.chdir($outputDir) {
         File.open($benchmarkDirectory + $benchmark) {
@@ -506,12 +542,13 @@ def parseRunCommands
                 end
                 next unless doesMatch
                 eval $~.post_match
-                didRun = true
             }
         }
     }
 
-    didRun
+    result = $didAddRunCommand
+    $didAddRunCommand = result or oldDidAddRunCommand
+    result
 end
 
 def slow!
@@ -797,6 +834,7 @@ def defaultRunMozillaTest(mode, *extraFiles)
 end
 
 def skip
+    $didAddRunCommand = true
     puts "Skipping #{$collectionName}/#{$benchmark}"
 end