diff options
author | Kristian Monsen <kristianm@google.com> | 2010-07-29 15:18:00 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-07-29 15:18:00 +0100 |
commit | 50ef84f5fad2def87d3fbc737bec4a32711fdef4 (patch) | |
tree | 72049481a445e51e78cc81ec1d114de2e87c6d1f /tools | |
parent | 3bec4d28b1f388dbc06a9c4276e1a03e86c52b04 (diff) | |
download | v8-50ef84f5fad2def87d3fbc737bec4a32711fdef4.tar.gz |
Update V8 to r5136 as required by WebKit r64264
Change-Id: I55b86fa101d9d53e889e2e3811fdf75f463ac3c6
Diffstat (limited to 'tools')
-rwxr-xr-x[-rw-r--r--] | tools/gc-nvp-trace-processor.py | 49 | ||||
-rw-r--r-- | tools/gyp/v8.gyp | 10 | ||||
-rwxr-xr-x | tools/js2c.py | 4 |
3 files changed, 49 insertions, 14 deletions
diff --git a/tools/gc-nvp-trace-processor.py b/tools/gc-nvp-trace-processor.py index 3721b018..44aa0a25 100644..100755 --- a/tools/gc-nvp-trace-processor.py +++ b/tools/gc-nvp-trace-processor.py @@ -47,8 +47,12 @@ def flatten(l): def split_nvp(s): t = {} - for m in re.finditer(r"(\w+)=(-?\d+)", s): - t[m.group(1)] = int(m.group(2)) + for (name, value) in re.findall(r"(\w+)=([-\w]+)", s): + try: + t[name] = int(value) + except ValueError: + t[name] = value + return t def parse_gc_trace(input): @@ -211,6 +215,9 @@ def plot_all(plots, trace, prefix): def reclaimed_bytes(row): return row['total_size_before'] - row['total_size_after'] +def other_scope(r): + return r['pause'] - r['mark'] - r['sweep'] - r['compact'] - r['flushcode'] + plots = [ [ Set('style fill solid 0.5 noborder'), @@ -219,9 +226,8 @@ plots = [ Plot(Item('Marking', 'mark', lc = 'purple'), Item('Sweep', 'sweep', lc = 'blue'), Item('Compaction', 'compact', lc = 'red'), - Item('Other', - lambda r: r['pause'] - r['mark'] - r['sweep'] - r['compact'], - lc = 'grey')) + Item('Flush Code', 'flushcode', lc = 'yellow'), + Item('Other', other_scope, lc = 'grey')) ], [ Set('style histogram rowstacked'), @@ -256,19 +262,48 @@ plots = [ ], ] +def calc_total(trace, field): + return reduce(lambda t,r: t + r[field], trace, 0) + +def calc_max(trace, field): + return reduce(lambda t,r: max(t, r[field]), trace, 0) + def process_trace(filename): trace = parse_gc_trace(filename) - total_gc = reduce(lambda t,r: t + r['pause'], trace, 0) - max_gc = reduce(lambda t,r: max(t, r['pause']), trace, 0) + total_gc = calc_total(trace, 'pause') + max_gc = calc_max(trace, 'pause') avg_gc = total_gc / len(trace) + total_sweep = calc_total(trace, 'sweep') + max_sweep = calc_max(trace, 'sweep') + + total_mark = calc_total(trace, 'mark') + max_mark = calc_max(trace, 'mark') + + scavenges = filter(lambda r: r['gc'] == 's', trace) + total_scavenge = calc_total(scavenges, 'pause') + max_scavenge = calc_max(scavenges, 'pause') + avg_scavenge = total_scavenge / len(scavenges) + charts = plot_all(plots, trace, filename) with open(filename + '.html', 'w') as out: out.write('<html><body>') + out.write('<table><tr><td>') out.write('Total in GC: <b>%d</b><br/>' % total_gc) out.write('Max in GC: <b>%d</b><br/>' % max_gc) out.write('Avg in GC: <b>%d</b><br/>' % avg_gc) + out.write('</td><td>') + out.write('Total in Scavenge: <b>%d</b><br/>' % total_scavenge) + out.write('Max in Scavenge: <b>%d</b><br/>' % max_scavenge) + out.write('Avg in Scavenge: <b>%d</b><br/>' % avg_scavenge) + out.write('</td><td>') + out.write('Total in Sweep: <b>%d</b><br/>' % total_sweep) + out.write('Max in Sweep: <b>%d</b><br/>' % max_sweep) + out.write('</td><td>') + out.write('Total in Mark: <b>%d</b><br/>' % total_mark) + out.write('Max in Mark: <b>%d</b><br/>' % max_mark) + out.write('</td></tr></table>') for chart in charts: out.write('<img src="%s">' % chart) out.write('</body></html>') diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp index 8c7ae373..839ae0bb 100644 --- a/tools/gyp/v8.gyp +++ b/tools/gyp/v8.gyp @@ -181,6 +181,11 @@ 'defines': [ 'BUILDING_V8_SHARED' ], + 'direct_dependent_settings': { + 'defines': [ + 'USING_V8_SHARED', + ], + }, }, { 'type': 'none', @@ -738,11 +743,6 @@ # This could be gotten by not setting chromium_code, if that's OK. 'defines': ['_CRT_SECURE_NO_WARNINGS'], }], - ['OS=="win" and component=="shared_library"', { - 'defines': [ - 'USING_V8_SHARED', - ], - }], ], }, ], diff --git a/tools/js2c.py b/tools/js2c.py index 35bf43bc..2da132f5 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -275,8 +275,8 @@ def JS2C(source, target, env): debugger_ids = [] modules = [] # Locate the macros file name. - consts = {} - macros = {} + consts = [] + macros = [] for s in source: if 'macros.py' == (os.path.split(str(s))[1]): (consts, macros) = ReadMacros(ReadLines(str(s))) |