Mercurial > hg > graal-compiler
diff mx/mx_graal.py @ 18218:8588db09f5e9
mx jol: let user select from found classes, skip duplicates
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Wed, 29 Oct 2014 19:54:50 +0100 |
parents | c88ab4f1f04a |
children | bfa20550f0a8 |
line wrap: on
line diff
--- a/mx/mx_graal.py Fri Oct 31 00:27:14 2014 +0100 +++ b/mx/mx_graal.py Wed Oct 29 19:54:50 2014 +0100 @@ -2098,9 +2098,12 @@ """Java Object Layout""" joljar = mx.library('JOL_INTERNALS').get_path(resolve=True) candidates = mx.findclass(args, logToConsole=False, matcher=lambda s, classname: s == classname or classname.endswith('.' + s) or classname.endswith('$' + s)) - if len(candidates) > 10: - print "Found %d candidates. Please be more precise." % (len(candidates)) - return + + if len(candidates) > 0: + candidates = mx.select_items(list(mx.OrderedDict.fromkeys(candidates))) + else: + # mx.findclass can be mistaken, don't give up yet + candidates = args vm(['-javaagent:' + joljar, '-cp', os.pathsep.join([mx.classpath(), joljar]), "org.openjdk.jol.MainObjectInternals"] + candidates)