Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
18217:0b5aff6214b9 | 18218:8588db09f5e9 |
---|---|
2096 | 2096 |
2097 def jol(args): | 2097 def jol(args): |
2098 """Java Object Layout""" | 2098 """Java Object Layout""" |
2099 joljar = mx.library('JOL_INTERNALS').get_path(resolve=True) | 2099 joljar = mx.library('JOL_INTERNALS').get_path(resolve=True) |
2100 candidates = mx.findclass(args, logToConsole=False, matcher=lambda s, classname: s == classname or classname.endswith('.' + s) or classname.endswith('$' + s)) | 2100 candidates = mx.findclass(args, logToConsole=False, matcher=lambda s, classname: s == classname or classname.endswith('.' + s) or classname.endswith('$' + s)) |
2101 if len(candidates) > 10: | 2101 |
2102 print "Found %d candidates. Please be more precise." % (len(candidates)) | 2102 if len(candidates) > 0: |
2103 return | 2103 candidates = mx.select_items(list(mx.OrderedDict.fromkeys(candidates))) |
2104 else: | |
2105 # mx.findclass can be mistaken, don't give up yet | |
2106 candidates = args | |
2104 | 2107 |
2105 vm(['-javaagent:' + joljar, '-cp', os.pathsep.join([mx.classpath(), joljar]), "org.openjdk.jol.MainObjectInternals"] + candidates) | 2108 vm(['-javaagent:' + joljar, '-cp', os.pathsep.join([mx.classpath(), joljar]), "org.openjdk.jol.MainObjectInternals"] + candidates) |
2106 | 2109 |
2107 def site(args): | 2110 def site(args): |
2108 """create a website containing javadoc and the project dependency graph""" | 2111 """create a website containing javadoc and the project dependency graph""" |