comparison mx/mx_graal.py @ 21584:9bb04af58490

support DEFAULT_VM=graal in mx/env
author Doug Simon <doug.simon@oracle.com>
date Fri, 29 May 2015 11:35:20 +0200
parents a004616f72e5
children 40d794ac4352
comparison
equal deleted inserted replaced
21583:16eff885df66 21584:9bb04af58490
51 'server' : 'Normal compilation is performed with a tiered system (C1 + C2), Truffle compilation is performed with Graal. Use this for optimal Truffle performance.', 51 'server' : 'Normal compilation is performed with a tiered system (C1 + C2), Truffle compilation is performed with Graal. Use this for optimal Truffle performance.',
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' : 'Alias for jvmci', 56 'graal' : None, # alias for jvmci
57 } 57 }
58 58
59 """ The VM that will be run by the 'vm' command and built by default by the 'build' command. 59 """ 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. 60 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. """ 61 It can also be temporarily set by using of a VM context manager object in a 'with' statement. """
116 """ 116 """
117 global _vm 117 global _vm
118 if _vm: 118 if _vm:
119 return _vm 119 return _vm
120 vm = mx.get_env('DEFAULT_VM') 120 vm = mx.get_env('DEFAULT_VM')
121 envPath = join(_graal_home, 'mx', 'env')
122 if vm == 'graal':
123 if exists(envPath):
124 with open(envPath) as fp:
125 if 'DEFAULT_VM=graal' in fp.read():
126 mx.log('Please update the DEFAULT_VM entry in ' + envPath + ' to use "jvmti" instead of "graal" as the value')
127 vm = 'jvmci'
121 if vm is None: 128 if vm is None:
122 if not mx.is_interactive(): 129 if not mx.is_interactive():
123 mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable') 130 mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable')
124 envPath = join(_graal_home, 'mx', 'env')
125 mx.log('Please select the VM to be executed from the following: ') 131 mx.log('Please select the VM to be executed from the following: ')
126 items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None] 132 items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None]
127 descriptions = [_vmChoices[k] for k in _vmChoices.keys() if _vmChoices[k] is not None] 133 descriptions = [_vmChoices[k] for k in _vmChoices.keys() if _vmChoices[k] is not None]
128 vm = mx.select_items(items, descriptions, allowMultiple=False) 134 vm = mx.select_items(items, descriptions, allowMultiple=False)
129 if mx.ask_yes_no('Persist this choice by adding "DEFAULT_VM=' + vm + '" to ' + envPath, 'y'): 135 if mx.ask_yes_no('Persist this choice by adding "DEFAULT_VM=' + vm + '" to ' + envPath, 'y'):