comparison mx/commands.py @ 5024:7ccdae96e98a

Allow JaCoCon to append to the execution file use StructuredGraph.reduceTrivialMerge in DCE phase instead of manual version
author Gilles Duboscq <duboscq@ssw.jku.at>
date Mon, 05 Mar 2012 14:35:26 +0100
parents c142a64141a8
children e2de9649f0a9
comparison
equal deleted inserted replaced
5023:db072eec897e 5024:7ccdae96e98a
44 44
45 """ The VM build that will be run by the 'vm' command: product(default), fastdebug or debug. 45 """ The VM build that will be run by the 'vm' command: product(default), fastdebug or debug.
46 This can be set via the global '--fastdebug' and '--debug' options. """ 46 This can be set via the global '--fastdebug' and '--debug' options. """
47 _vmbuild = 'product' 47 _vmbuild = 'product'
48 48
49 _jacoco = False 49 _jacoco = 'off'
50 50
51 _jacocoExcludes = ['com.oracle.max.graal.hotspot.snippets.ArrayCopySnippets', 51 _jacocoExcludes = ['com.oracle.max.graal.hotspot.snippets.ArrayCopySnippets',
52 'com.oracle.max.graal.snippets.DoubleSnippets', 52 'com.oracle.max.graal.snippets.DoubleSnippets',
53 'com.oracle.max.graal.snippets.FloatSnippets', 53 'com.oracle.max.graal.snippets.FloatSnippets',
54 'com.oracle.max.graal.snippets.MathSnippetsX86', 54 'com.oracle.max.graal.snippets.MathSnippetsX86',
55 'com.oracle.max.graal.snippets.NodeClassSnippets', 55 'com.oracle.max.graal.snippets.NodeClassSnippets',
56 'com.oracle.max.graal.hotspot.snippets.SystemSnippets', 56 'com.oracle.max.graal.hotspot.snippets.SystemSnippets',
57 'com.oracle.max.graal.hotspot.snippets.UnsafeSnippets'] 57 'com.oracle.max.graal.hotspot.snippets.UnsafeSnippets',
58 'com.oracle.max.graal.compiler.tests.*']
58 59
59 _copyrightTemplate = """/* 60 _copyrightTemplate = """/*
60 * Copyright (c) {0}, Oracle and/or its affiliates. All rights reserved. 61 * Copyright (c) {0}, Oracle and/or its affiliates. All rights reserved.
61 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 62 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
62 * 63 *
483 484
484 build = vmbuild if vmbuild is not None else _vmbuild if _vmSourcesAvailable else 'product' 485 build = vmbuild if vmbuild is not None else _vmbuild if _vmSourcesAvailable else 'product'
485 mx.expand_project_in_args(args) 486 mx.expand_project_in_args(args)
486 if mx.java().debug: 487 if mx.java().debug:
487 args = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000'] + args 488 args = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000'] + args
488 if _jacoco: 489 if _jacoco == 'on' or _jacoco == 'append':
489 jacocoagent = mx.library("JACOCOAGENT", True) 490 jacocoagent = mx.library("JACOCOAGENT", True)
490 agentOptions = { 491 agentOptions = {
491 'append' : 'false', 492 'append' : 'true' if _jacoco == 'append' else 'false',
492 'bootclasspath' : 'true', 493 'bootclasspath' : 'true',
493 'includes' : 'com.oracle.max.*', 494 'includes' : 'com.oracle.max.*',
494 'excludes' : ':'.join(_jacocoExcludes) 495 'excludes' : ':'.join(_jacocoExcludes)
495 } 496 }
496 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args 497 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args
862 'jtt' : [jtt, '[filters...]'], 863 'jtt' : [jtt, '[filters...]'],
863 'jacocoreport' : [jacocoreport, '[output directory]'], 864 'jacocoreport' : [jacocoreport, '[output directory]'],
864 'vm': [vm, '[-options] class [args...]'] 865 'vm': [vm, '[-options] class [args...]']
865 } 866 }
866 867
867 mx.add_argument('--jacoco', action='store_true', dest='jacoco', help='instruments com.oracle.max.* classes using JaCoCo') 868 mx.add_argument('--jacoco', help='instruments com.oracle.max.* classes using JaCoCo', default='off', choices=['off', 'on', 'append'])
868 869
869 if (_vmSourcesAvailable): 870 if (_vmSourcesAvailable):
870 mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=['graal', 'server', 'client'], help='the VM to build/run (default: graal)') 871 mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=['graal', 'server', 'client'], help='the VM to build/run (default: graal)')
871 mx.add_argument('--product', action='store_const', dest='vmbuild', const='product', help='select the product build of the VM') 872 mx.add_argument('--product', action='store_const', dest='vmbuild', const='product', help='select the product build of the VM')
872 mx.add_argument('--debug', action='store_const', dest='vmbuild', const='debug', help='select the debug build of the VM') 873 mx.add_argument('--debug', action='store_const', dest='vmbuild', const='debug', help='select the debug build of the VM')
893 global _vm 894 global _vm
894 _vm = opts.vm 895 _vm = opts.vm
895 if hasattr(opts, 'vmbuild') and opts.vmbuild is not None: 896 if hasattr(opts, 'vmbuild') and opts.vmbuild is not None:
896 global _vmbuild 897 global _vmbuild
897 _vmbuild = opts.vmbuild 898 _vmbuild = opts.vmbuild
898 if opts.jacoco: 899 global _jacoco
899 global _jacoco 900 _jacoco = opts.jacoco
900 _jacoco = True