changeset 9803:8e33b4ebfef1

add isGraalEnabled(vm) function in commands.py
author Gilles Duboscq <duboscq@ssw.jku.at>
date Thu, 23 May 2013 13:14:08 +0200
parents 9dcd6f8a843b
children 79d65c694a3b b49fdcee6cb0
files mx/commands.py mx/sanitycheck.py
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mx/commands.py	Thu May 23 12:07:34 2013 +0200
+++ b/mx/commands.py	Thu May 23 13:14:08 2013 +0200
@@ -825,7 +825,7 @@
     def harness(projectscp, vmArgs):
         if not exists(javaClass) or getmtime(javaClass) < getmtime(javaSource):
             subprocess.check_call([mx.java().javac, '-cp', projectscp, '-d', mxdir, javaSource])
-        if _vm == 'original' or _vm.endswith('nograal'):
+        if not isGraalEnabled(_vm):
             prefixArgs = ['-esa', '-ea']
         else:
             prefixArgs = ['-XX:-BootstrapGraal', '-esa', '-ea']
@@ -1333,6 +1333,9 @@
         mx.abort('jacocoreport takes only one argument : an output directory')
     mx.run_java(['-jar', jacocoreport.get_path(True), '-in', 'jacoco.exec', '-g', join(_graal_home, 'graal'), out])
 
+def isGraalEnabled(vm):
+    return vm != 'original' and not vm.endswith('nograal')
+
 def site(args):
     """create a website containing javadoc and the project dependency graph"""
 
--- a/mx/sanitycheck.py	Thu May 23 12:07:34 2013 +0200
+++ b/mx/sanitycheck.py	Thu May 23 13:14:08 2013 +0200
@@ -235,15 +235,15 @@
 
     
     args = ['-XX:+CompileTheWorld', '-Xbootclasspath/p:' + rtjar]
-    if not vm.endswith('-nograal'):
+    if commands.isGraalEnabled(vm):
         args += ['-XX:+BootstrapGraal', '-G:-Debug']
     if mode >= CTWMode.NoInline:
-        if vm.endswith('-nograal'):
+        if not commands.isGraalEnabled(vm):
             args.append('-XX:-Inline')
         else:
             args.append('-G:-Inline')
     if mode >= CTWMode.NoComplex:
-        if not vm.endswith('-nograal'):
+        if commands.isGraalEnabled(vm):
             args += ['-G:-OptLoopTransform', '-G:-OptTailDuplication', '-G:-FullUnroll', '-G:-MemoryAwareScheduling', '-G:-PartialEscapeAnalysis']
         
     return Test("CompileTheWorld", args, successREs=[time], scoreMatchers=[scoreMatcher], benchmarkCompilationRate=False)