changeset 4485:c82b74db2ccd

Merge
author Andreas Woess <andreas.woess@jku.at>
date Tue, 07 Feb 2012 21:17:08 +0100
parents 14a00ee82980 (current diff) 58ecb156a3e8 (diff)
children e5cfd7eeede3
files
diffstat 6 files changed, 153 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Tue Feb 07 21:15:58 2012 +0100
+++ b/.hgignore	Tue Feb 07 21:17:08 2012 +0100
@@ -36,6 +36,7 @@
 /nbproject/private/
 ^graal/hotspot/java$
 ^scratch/
+^test-output/
 scratch/
 bin/
 ^local/
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/DegeneratedLoopsTest.java	Tue Feb 07 21:15:58 2012 +0100
+++ b/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/DegeneratedLoopsTest.java	Tue Feb 07 21:17:08 2012 +0100
@@ -52,9 +52,6 @@
     }
 
     private static class UnresolvedException extends RuntimeException {
-        /**
-         *
-         */
         private static final long serialVersionUID = 5215434338750728440L;
 
         static {
--- a/mx/commands.py	Tue Feb 07 21:15:58 2012 +0100
+++ b/mx/commands.py	Tue Feb 07 21:17:08 2012 +0100
@@ -218,6 +218,57 @@
     
     if len(failed) != 0:
         mx.abort('DaCapo failures: ' + str(failed))
+    
+
+def scaladacapo(args):
+    """run one or all Scala DaCapo benchmarks
+    
+    Scala DaCapo options are distinguished from VM options by a '@' prefix.
+    For example, '@--iterations @5' will pass '--iterations 5' to the
+    DaCapo harness."""
+
+    numTests = {}
+    
+    if len(args) > 0:
+        level = getattr(sanitycheck.SanityCheckLevel, args[0], None)
+        if level is not None:
+            del args[0]
+            for (bench, ns) in sanitycheck.dacapoScalaSanityWarmup.items():
+                if ns[level] > 0:
+                    numTests[bench] = ns[level]
+        else:
+            while len(args) != 0 and args[0][0] not in ['-', '@']:
+                n = 1
+                if args[0].isdigit():
+                    n = int(args[0])
+                    assert len(args) > 1 and args[1][0] not in ['-', '@'] and not args[1].isdigit()
+                    bm = args[1]
+                    del args[0]
+                else:
+                    bm = args[0]
+                
+                del args[0]
+                if bm not in sanitycheck.dacapoScalaSanityWarmup.keys():
+                    mx.abort('unknown benchmark: ' + bm + '\nselect one of: ' + str(sanitycheck.dacapoScalaSanityWarmup.keys()))
+                numTests[bm] = n
+    
+    if len(numTests) is 0:    
+        for bench in sanitycheck.dacapoScalaSanityWarmup.keys():
+            numTests[bench] = 1
+    
+    # Extract DaCapo options
+    dacapoArgs = [(arg[1:]) for arg in args if arg.startswith('@')]
+    
+    # The remainder are VM options 
+    vmOpts = [arg for arg in args if not arg.startswith('@')]
+    
+    failed = []
+    for (test, n) in numTests.items():
+        if not sanitycheck.getScalaDacapo(test, n, dacapoArgs).test('graal', opts=vmOpts):
+            failed.append(test)
+    
+    if len(failed) != 0:
+        mx.abort('Scala DaCapo failures: ' + str(failed))
  
 def _jdk(build='product', create=False):
     """
@@ -498,7 +549,7 @@
         build(['--no-native'])
         tasks.append(t.stop())
     
-        for vmbuild in ['product', 'fastdebug']:
+        for vmbuild in ['fastdebug', 'product']:
             global _vmbuild
             _vmbuild = vmbuild
             
@@ -571,6 +622,15 @@
             if dacapo not in sanitycheck.dacapoSanityWarmup.keys():
                 mx.abort('Unknown dacapo : ' + dacapo)
             benchmarks += [sanitycheck.getDacapo(dacapo, sanitycheck.dacapoSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark])]
+    
+    if ('scaladacapo' in args or 'all' in args):
+        benchmarks += sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Benchmark)
+    else:
+        dacapos = [a[7:] for a in args if a.startswith('scaladacapo:')]
+        for dacapo in dacapos:
+            if dacapo not in sanitycheck.dacapoScalaSanityWarmup.keys():
+                mx.abort('Unknown dacapo : ' + dacapo)
+            benchmarks += [sanitycheck.getScalaDacapo(dacapo, sanitycheck.dacapoScalaSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark])]
         
     #Bootstrap
     if ('bootstrap' in args or 'all' in args):
@@ -597,14 +657,29 @@
     vmArgs = [a for a in args if a[0] != '@']
     sanitycheck.getSPECjvm2008(benchArgs).bench('graal', opts=vmArgs)
     
+def hsdis(args):
+    """Installs the hsdis library
+
+    This is needed to support HotSpot's assembly dumping features.
+    By default it installs the Intel syntax version, use the 'att' argument to install AT&T syntax."""
+    flavor = 'intel'
+    if 'att' in args:
+        flavor = 'att'
+    build = _vmbuild if _vmSourcesAvailable else 'product'
+    lib = mx.lib_suffix('hsdis-amd64')
+    path = join(_jdk(build), 'jre', 'lib', 'amd64', lib)
+    mx.download(path, ['http://lafo.ssw.uni-linz.ac.at/hsdis/' + flavor + "/" + lib])
+    
 def mx_init():
     _vmbuild = 'product'
     commands = {
         'build': [build, '[-options]'],
         'clean': [clean, ''],
         'copyrightcheck': [copyrightcheck, ''],
+        'hsdis': [hsdis, '[att]'],
         'dacapo': [dacapo, '[[n] benchmark] [VM options|@DaCapo options]'],
-        'specjvm2008': [specjvm2008, ''],
+        'scaladacapo': [scaladacapo, '[[n] benchmark] [VM options|@Scala DaCapo options]'],
+        'specjvm2008': [specjvm2008, '[VM options|@specjvm2008 options]'],
         'example': [example, '[-v] example names...'],
         'gate' : [gate, ''],
         'bench' : [bench, '[-vm vm] [-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'],
--- a/mx/projects	Tue Feb 07 21:15:58 2012 +0100
+++ b/mx/projects	Tue Feb 07 21:17:08 2012 +0100
@@ -41,6 +41,9 @@
 library@DACAPO@path=lib/dacapo-9.12-bach.jar
 library@DACAPO@urls=http://dfn.dl.sourceforge.net/project/dacapobench/9.12-bach/dacapo-9.12-bach.jar
 
+library@DACAPO_SCALA@path=lib/dacapo-scala-0.1.0.jar
+library@DACAPO_SCALA@urls=http://repo.scalabench.org/snapshots/org/scalabench/benchmarks/scala-benchmark-suite/0.1.0-SNAPSHOT/scala-benchmark-suite-0.1.0-20110908.085753-2.jar
+
 # graal.hotspot
 project@com.oracle.max.graal.hotspot@subDir=graal
 project@com.oracle.max.graal.hotspot@sourceDirs=src
--- a/mx/sanitycheck.py	Tue Feb 07 21:15:58 2012 +0100
+++ b/mx/sanitycheck.py	Tue Feb 07 21:17:08 2012 +0100
@@ -39,13 +39,28 @@
     'luindex':    [0, 0,  5, 10, 10],
     'lusearch':   [0, 4,  5,  5,  8],
     'pmd':        [0, 0,  5, 10, 13],
-    'sunflow':    [0, 0,  5, 10, 15],
+    'sunflow':    [0, 2,  5, 10, 15],
     'tomcat':     [0, 0,  5, 10, 15],
     'tradebeans': [0, 0,  5, 10, 13],
     'tradesoap':  [2, 4,  5, 10, 15],
     'xalan':      [0, 0,  5, 10, 18],
 }
 
+dacapoScalaSanityWarmup = {
+    'actors':     [0, 0, 2,  8, 10],
+    'apparat':    [0, 0, 1,  2,  3],
+    'factorie':   [0, 0, 2,  5,  5],
+    'kiama':      [0, 0, 3, 13, 15],
+    'scalac':     [0, 0, 5, 15, 20],
+    'scaladoc':   [0, 0, 5, 15, 15],
+    'scalap':     [0, 0, 5, 15, 20],
+    'scalariform':[0, 0, 6, 15, 20],
+    'scalatest':  [0, 0, 2, 10, 12],
+    'scalaxb':    [0, 0, 5, 15, 25],
+    'specs':      [0, 0, 3, 13, 18],
+    'tmt':        [0, 0, 3, 10, 12]
+}
+
 dacapoGateBuildLevels = {
     'avrora':     ['product', 'fastdebug', 'debug'],
     'batik':      ['product', 'fastdebug', 'debug'],
@@ -63,6 +78,21 @@
     'xalan':      ['product', 'fastdebug', 'debug'],
 }
 
+dacapoScalaGateBuildLevels = {
+    'actors':     ['product', 'fastdebug', 'debug'],
+    'apparat':    ['product', 'fastdebug', 'debug'],
+    'factorie':   ['product', 'fastdebug', 'debug'],
+    'kiama':      ['product', 'fastdebug', 'debug'],
+    'scalac':     ['product', 'fastdebug', 'debug'],
+    'scaladoc':   ['product', 'fastdebug', 'debug'],
+    'scalap':     ['product', 'fastdebug', 'debug'],
+    'scalariform':['product', 'fastdebug', 'debug'],
+    'scalatest':  ['product', 'fastdebug', 'debug'],
+    'scalaxb':    ['product', 'fastdebug', 'debug'],
+    'specs':      ['product', 'fastdebug', 'debug'],
+    'tmt':        ['product', 'fastdebug', 'debug'],
+}
+
 class SanityCheckLevel:
     Fast, Gate, Normal, Extensive, Benchmark = range(5)
     
@@ -118,6 +148,36 @@
     
     return Test("DaCapo-" + name, "DaCapo", ['-jar', dacapo, name, '-n', str(n), ] + dacapoArgs, [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms2g', '-XX:MaxPermSize=256m'])
 
+def getScalaDacapos(level=SanityCheckLevel.Normal, gateBuildLevel=None, dacapoArgs=[]):
+    checks = []
+    
+    for (bench, ns) in dacapoScalaSanityWarmup.items():
+        if ns[level] > 0:
+            if gateBuildLevel is None or gateBuildLevel in dacapoScalaGateBuildLevels[bench]:
+                checks.append(getScalaDacapo(bench, ns[level], dacapoArgs))
+    
+    return checks
+
+def getScalaDacapo(name, n, dacapoArgs=[]):
+    dacapo = mx.get_env('DACAPO_SCALA_CP')
+    if dacapo is None:
+        l = mx.library('DACAPO_SCALA', False)
+        if l is not None:
+            dacapo = l.get_path(True)
+        else:
+            mx.abort('Scala DaCapo 0.1.0 jar file must be specified with DACAPO_SCALA_CP environment variable or as DACAPO_SCALA library')
+    
+    if not isfile(dacapo) or not dacapo.endswith('.jar'):
+        mx.abort('Specified Scala DaCapo jar file does not exist or is not a jar file: ' + dacapo)
+    
+    dacapoSuccess = re.compile(r"^===== DaCapo 0\.1\.0(-SNAPSHOT)? ([a-zA-Z0-9_]+) PASSED in ([0-9]+) msec =====$")
+    dacapoFail = re.compile(r"^===== DaCapo 0\.1\.0(-SNAPSHOT)? ([a-zA-Z0-9_]+) FAILED (warmup|) =====$")
+    dacapoTime = re.compile(r"===== DaCapo 0\.1\.0(-SNAPSHOT)? (?P<benchmark>[a-zA-Z0-9_]+) PASSED in (?P<time>[0-9]+) msec =====")
+    
+    dacapoMatcher = Matcher(dacapoTime, {'const:name' : 'benchmark', 'const:score' : 'time'})
+    
+    return Test("Scala-DaCapo-" + name, "Scala-DaCapo", ['-jar', dacapo, name, '-n', str(n), ] + dacapoArgs, [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms2g', '-XX:MaxPermSize=256m'])
+
 def getBootstraps():
     time = re.compile(r"Bootstrapping Graal\.+ in (?P<time>[0-9]+) ms")
     scoreMatcher = Matcher(time, {'const:name' : 'const:BootstrapTime', 'const:score' : 'time'})
--- a/mxtool/mx.py	Tue Feb 07 21:15:58 2012 +0100
+++ b/mxtool/mx.py	Tue Feb 07 21:17:08 2012 +0100
@@ -648,6 +648,17 @@
         return name + '.exe'
     return name
 
+def lib_suffix(name):
+    """
+    Gets the platform specific suffix for a library
+    """
+    os = get_os();
+    if os == 'windows':
+        return name + '.dll'
+    if os == 'linux':
+        return name + '.so'
+    return name
+
 """
 A JavaConfig object encapsulates info on how Java commands are run.
 """