comparison mx/mx_graal.py @ 21640:11f68b116a07

mx: added support for server-nograal and client-nograal aliases
author Doug Simon <doug.simon@oracle.com>
date Mon, 01 Jun 2015 18:04:12 +0200
parents e65bf81961be
children 57912478d94d
comparison
equal deleted inserted replaced
21639:e65bf81961be 21640:11f68b116a07
52 'client' : None, # normal compilation with client compiler, explicit compilation (e.g., by Truffle) with Graal 52 'client' : None, # normal compilation with client compiler, explicit compilation (e.g., by Truffle) with Graal
53 'server-nojvmci' : None, # all compilation with tiered system (i.e., client + server), JVMCI omitted 53 'server-nojvmci' : None, # all compilation with tiered system (i.e., client + server), JVMCI omitted
54 'client-nojvmci' : None, # all compilation with client compiler, JVMCI omitted 54 'client-nojvmci' : None, # all compilation with client compiler, JVMCI omitted
55 'original' : None, # default VM copied from bootstrap JDK 55 'original' : None, # default VM copied from bootstrap JDK
56 'graal' : None, # alias for jvmci 56 'graal' : None, # alias for jvmci
57 'server-nograal' : None, # alias for server-nojvmci
58 'client-nograal' : None, # alias for client-nojvmci
57 } 59 }
58 60
59 """ The VM that will be run by the 'vm' command and built by default by the 'build' command. 61 """ The VM that will be run by the 'vm' command and built by default by the 'build' command.
60 This can be set via the global '--vm' option or the DEFAULT_VM environment variable. 62 This can be set via the global '--vm' option or the DEFAULT_VM environment variable.
61 It can also be temporarily set by using of a VM context manager object in a 'with' statement. """ 63 It can also be temporarily set by using of a VM context manager object in a 'with' statement. """
119 global _vm 121 global _vm
120 if _vm: 122 if _vm:
121 return _vm 123 return _vm
122 vm = mx.get_env('DEFAULT_VM') 124 vm = mx.get_env('DEFAULT_VM')
123 envPath = join(_graal_home, 'mx', 'env') 125 envPath = join(_graal_home, 'mx', 'env')
124 if vm == 'graal': 126 if vm and 'graal' in vm:
125 if exists(envPath): 127 if exists(envPath):
126 with open(envPath) as fp: 128 with open(envPath) as fp:
127 if 'DEFAULT_VM=graal' in fp.read(): 129 if ('DEFAULT_VM=' + vm) in fp.read():
128 mx.log('Please update the DEFAULT_VM entry in ' + envPath + ' to use "jvmci" instead of "graal" as the value') 130 mx.log('Please update the DEFAULT_VM value in ' + envPath + ' to replace "graal" with "jvmci"')
129 vm = 'jvmci' 131 vm = vm.replace('graal', 'jvmci')
130 if vm is None: 132 if vm is None:
131 if not mx.is_interactive(): 133 if not mx.is_interactive():
132 mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable') 134 mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable')
133 mx.log('Please select the VM to be executed from the following: ') 135 mx.log('Please select the VM to be executed from the following: ')
134 items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None] 136 items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None]
2660 2662
2661 if _vmSourcesAvailable: 2663 if _vmSourcesAvailable:
2662 if hasattr(opts, 'vm') and opts.vm is not None: 2664 if hasattr(opts, 'vm') and opts.vm is not None:
2663 global _vm 2665 global _vm
2664 _vm = opts.vm 2666 _vm = opts.vm
2665 if _vm == 'graal': 2667 _vm = _vm.replace('graal', 'jvmci')
2666 _vm = 'jvmci'
2667 if hasattr(opts, 'vmbuild') and opts.vmbuild is not None: 2668 if hasattr(opts, 'vmbuild') and opts.vmbuild is not None:
2668 global _vmbuild 2669 global _vmbuild
2669 _vmbuild = opts.vmbuild 2670 _vmbuild = opts.vmbuild
2670 global _make_eclipse_launch 2671 global _make_eclipse_launch
2671 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) 2672 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False)