changeset 9157:a38d748d4130

Add support for the 'optimized' build in mx Add some CompileTheWorld benchmarks
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 16 Apr 2013 14:31:00 +0200
parents 57f85e39c75f
children 9d74a0d7b231
files mx/commands.py mx/sanitycheck.py
diffstat 2 files changed, 36 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mx/commands.py	Tue Apr 16 15:27:22 2013 +0200
+++ b/mx/commands.py	Tue Apr 16 14:31:00 2013 +0200
@@ -46,7 +46,7 @@
 _vm = _vmChoices[0]
 
 """ The VM builds that will be run by the 'vm' command - default is first in list """
-_vmbuildChoices = ['product', 'fastdebug', 'debug']
+_vmbuildChoices = ['product', 'fastdebug', 'debug', 'optimized']
 
 """ The VM build that will be run by the 'vm' command.
     This can be set via the global '--product', '--fastdebug' and '--debug' options. """
@@ -1167,6 +1167,13 @@
         
     if ('specjbb2013' in args): # or 'all' in args //currently not in default set
         benchmarks += [sanitycheck.getSPECjbb2013()]
+        
+    if ('ctw-full' in args):
+        benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.Full))
+    if ('ctw-noinline' in args):
+        benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.NoInline))
+    if ('ctw-nocomplex' in args):
+        benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.NoComplex))
 
     for test in benchmarks:
         for (groupName, res) in test.bench(vm, opts=vmArgs).items():
--- a/mx/sanitycheck.py	Tue Apr 16 15:27:22 2013 +0200
+++ b/mx/sanitycheck.py	Tue Apr 16 14:31:00 2013 +0200
@@ -220,6 +220,34 @@
     tests.append(Test("Bootstrap-bigHeap", ['-version'], successREs=[time], scoreMatchers=[scoreMatcherBig], vmOpts=['-Xms2g'], ignoredVMs=['client', 'server'], benchmarkCompilationRate=False))
     return tests
 
+class CTWMode:
+    Full, NoInline, NoComplex = range(3)
+
+def getCTW(vm,mode):
+    time = re.compile(r"CompileTheWorld : Done \([0-9]+ classes, [0-9]+ methods, (?P<time>[0-9]+) ms\)")
+    scoreMatcher = ValuesMatcher(time, {'group' : 'CompileTheWorld', 'name' : 'CompileTime', 'score' : '<time>'})
+    
+    jre = os.environ.get('JAVA_HOME')
+    if exists(join(jre, 'jre')):
+        jre = join(jre, 'jre')
+    rtjar = join(jre, 'lib', 'rt.jar')
+
+    
+    args = ['-XX:+CompileTheWorld', '-Xbootclasspath/p:' + rtjar]
+    if not vm.endswith('-nograal'):
+        args.append('-G:-Debug')
+    if mode >= CTWMode.NoInline:
+        if vm.endswith('-nograal'):
+            args.append('-XX:-Inline')
+        else:
+            args.append('-G:-Inline')
+    if mode >= CTWMode.NoComplex:
+        if not vm.endswith('-nograal'):
+            args += ['-G:-OptLoopTransform', '-G:-OptTailDuplication', '-G:-FullUnroll', '-G:-MemoryAwareScheduling']
+        
+    return Test("CompileTheWorld", args, successREs=[time], scoreMatchers=[scoreMatcher], benchmarkCompilationRate=False)
+    
+
 class Tee:
     def __init__(self):
         self.output = StringIO.StringIO()