Mercurial > hg > truffle
comparison mx/mx_graal.py @ 17012:ad10671d1bbd
mx: move get_arch() to mxtool
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Tue, 02 Sep 2014 14:45:51 +0200 |
parents | e9ff3e7055e5 |
children | 6a30738791f7 |
comparison
equal
deleted
inserted
replaced
17011:ccd8c2ef112e | 17012:ad10671d1bbd |
---|---|
197 infos['revision'] = hgcfg.tip('.') + ('+' if hgcfg.isDirty('.') else '') | 197 infos['revision'] = hgcfg.tip('.') + ('+' if hgcfg.isDirty('.') else '') |
198 # TODO: infos['repository'] | 198 # TODO: infos['repository'] |
199 | 199 |
200 infos['jdkversion'] = str(mx.java().version) | 200 infos['jdkversion'] = str(mx.java().version) |
201 | 201 |
202 infos['architecture'] = _arch() | 202 infos['architecture'] = mx.get_arch() |
203 infos['platform'] = mx.get_os() | 203 infos['platform'] = mx.get_os() |
204 | 204 |
205 if mx.get_os != 'windows': | 205 if mx.get_os != 'windows': |
206 pass | 206 pass |
207 # infos['ccompiler'] | 207 # infos['ccompiler'] |
344 def launcher(bm, harnessArgs, extraVmOpts): | 344 def launcher(bm, harnessArgs, extraVmOpts): |
345 return sanitycheck.getScalaDacapo(bm, harnessArgs).test(_get_vm(), extraVmOpts=extraVmOpts) | 345 return sanitycheck.getScalaDacapo(bm, harnessArgs).test(_get_vm(), extraVmOpts=extraVmOpts) |
346 | 346 |
347 _run_benchmark(args, sanitycheck.dacapoScalaSanityWarmup.keys(), launcher) | 347 _run_benchmark(args, sanitycheck.dacapoScalaSanityWarmup.keys(), launcher) |
348 | 348 |
349 def _arch(): | |
350 machine = platform.uname()[4] | |
351 if machine in ['amd64', 'AMD64', 'x86_64', 'i86pc']: | |
352 return 'amd64' | |
353 if machine in ['sun4v', 'sun4u']: | |
354 return 'sparcv9' | |
355 if machine == 'i386' and mx.get_os() == 'darwin': | |
356 try: | |
357 # Support for Snow Leopard and earlier version of MacOSX | |
358 if subprocess.check_output(['sysctl', '-n', 'hw.cpu64bit_capable']).strip() == '1': | |
359 return 'amd64' | |
360 except OSError: | |
361 # sysctl is not available | |
362 pass | |
363 mx.abort('unknown or unsupported architecture: os=' + mx.get_os() + ', machine=' + machine) | |
364 | |
365 def _vmLibDirInJdk(jdk): | 349 def _vmLibDirInJdk(jdk): |
366 """ | 350 """ |
367 Get the directory within a JDK where the server and client | 351 Get the directory within a JDK where the server and client |
368 subdirectories are located. | 352 subdirectories are located. |
369 """ | 353 """ |
370 if platform.system() == 'Darwin': | 354 if platform.system() == 'Darwin': |
371 return join(jdk, 'jre', 'lib') | 355 return join(jdk, 'jre', 'lib') |
372 if platform.system() == 'Windows': | 356 if platform.system() == 'Windows': |
373 return join(jdk, 'jre', 'bin') | 357 return join(jdk, 'jre', 'bin') |
374 return join(jdk, 'jre', 'lib', _arch()) | 358 return join(jdk, 'jre', 'lib', mx.get_arch()) |
375 | 359 |
376 def _vmCfgInJdk(jdk): | 360 def _vmCfgInJdk(jdk): |
377 """ | 361 """ |
378 Get the jvm.cfg file. | 362 Get the jvm.cfg file. |
379 """ | 363 """ |
380 if platform.system() == 'Windows': | 364 if platform.system() == 'Windows': |
381 return join(jdk, 'jre', 'lib', _arch(), 'jvm.cfg') | 365 return join(jdk, 'jre', 'lib', mx.get_arch(), 'jvm.cfg') |
382 return join(_vmLibDirInJdk(jdk), 'jvm.cfg') | 366 return join(_vmLibDirInJdk(jdk), 'jvm.cfg') |
383 | 367 |
384 def _jdksDir(): | 368 def _jdksDir(): |
385 return os.path.abspath(join(_installed_jdks if _installed_jdks else _graal_home, 'jdk' + str(mx.java().version))) | 369 return os.path.abspath(join(_installed_jdks if _installed_jdks else _graal_home, 'jdk' + str(mx.java().version))) |
386 | 370 |
1950 This is needed to support HotSpot's assembly dumping features. | 1934 This is needed to support HotSpot's assembly dumping features. |
1951 By default it downloads the Intel syntax version, use the 'att' argument to install AT&T syntax.""" | 1935 By default it downloads the Intel syntax version, use the 'att' argument to install AT&T syntax.""" |
1952 flavor = 'intel' | 1936 flavor = 'intel' |
1953 if 'att' in args: | 1937 if 'att' in args: |
1954 flavor = 'att' | 1938 flavor = 'att' |
1955 lib = mx.add_lib_suffix('hsdis-' + _arch()) | 1939 lib = mx.add_lib_suffix('hsdis-' + mx.get_arch()) |
1956 path = join(_graal_home, 'lib', lib) | 1940 path = join(_graal_home, 'lib', lib) |
1957 | 1941 |
1958 sha1s = { | 1942 sha1s = { |
1959 'att/hsdis-amd64.dll' : 'bcbd535a9568b5075ab41e96205e26a2bac64f72', | 1943 'att/hsdis-amd64.dll' : 'bcbd535a9568b5075ab41e96205e26a2bac64f72', |
1960 'att/hsdis-amd64.so' : '58919ba085d4ef7a513f25bae75e7e54ee73c049', | 1944 'att/hsdis-amd64.so' : '58919ba085d4ef7a513f25bae75e7e54ee73c049', |