Bug 1259850 - Various refactorings, r=terrence

MozReview-Commit-ID: GYrqbzK3U8W

--HG--
extra : rebase_source : dfe6bfb523799becf7ab34c9dbbc365c46035bfc
This commit is contained in:
Steve Fink 2016-03-25 11:41:54 -07:00
parent 7ef77cb0e1
commit c6f370b8e1
4 changed files with 16 additions and 17 deletions

View File

@ -43,6 +43,7 @@ _OPT\.OBJ/
^js/src/autom4te.cache$
# SpiderMonkey test result logs
^js/src/tests/results-.*\.(html|txt)$
^js/src/devtools/rootAnalysis/t/out
# Java HTML5 parser classes
^parser/html/java/(html|java)parser/

View File

@ -242,7 +242,7 @@ if args.tag and not args.buildcommand:
if args.jobs is not None:
data['jobs'] = args.jobs
if not data.get('jobs'):
data['jobs'] = subprocess.check_output(['nproc', '--ignore=1'])
data['jobs'] = subprocess.check_output(['nproc', '--ignore=1']).strip()
if args.buildcommand:
data['buildcommand'] = args.buildcommand
@ -286,7 +286,7 @@ for step in steps:
for (i, name) in out_indexes(command):
data[name] = outfiles[outfile]
outfile += 1
assert len(outfiles) == outfile, 'step \'%s\': mismatched number of output files and params' % step
assert len(outfiles) == outfile, 'step \'%s\': mismatched number of output files (%d) and params (%d)' % (step, outfile, len(outfiles))
if args.step:
steps = steps[steps.index(args.step):]

View File

@ -3,6 +3,8 @@
import re
import argparse
from collections import defaultdict
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('rootingHazards', nargs='?', default='rootingHazards.txt')
parser.add_argument('gcFunctions', nargs='?', default='gcFunctions.txt')
@ -22,7 +24,7 @@ try:
# Map from a GC function name to the list of hazards resulting from
# that GC function
hazardousGCFunctions = {}
hazardousGCFunctions = defaultdict(list)
# List of tuples (gcFunction, index of hazard) used to maintain the
# ordering of the hazards
@ -53,7 +55,7 @@ try:
# Function names are surrounded by single quotes. Field calls
# are unquoted.
current_gcFunction = m.group(2)
hazardousGCFunctions.setdefault(current_gcFunction, []).append(line)
hazardousGCFunctions[current_gcFunction].append(line)
hazardOrder.append((current_gcFunction, len(hazardousGCFunctions[current_gcFunction]) - 1))
num_hazards += 1
continue
@ -84,12 +86,13 @@ try:
if current_func:
gcExplanations[current_func] = explanation
for gcFunction, index in hazardOrder:
gcHazards = hazardousGCFunctions[gcFunction]
if gcFunction in gcExplanations:
print >>hazards, (gcHazards[index] + gcExplanations[gcFunction])
else:
print >>hazards, gcHazards[index]
for gcFunction, index in hazardOrder:
gcHazards = hazardousGCFunctions[gcFunction]
if gcFunction in gcExplanations:
print >>hazards, (gcHazards[index] + gcExplanations[gcFunction])
else:
print >>hazards, gcHazards[index]
except IOError as e:
print 'Failed: %s' % str(e)

View File

@ -53,13 +53,8 @@ function addGCFunction(caller, reason)
function addCallEdge(caller, callee, suppressed)
{
if (!(caller in calleeGraph))
calleeGraph[caller] = [];
calleeGraph[caller].push({callee:callee, suppressed:suppressed});
if (!(callee in callerGraph))
callerGraph[callee] = [];
callerGraph[callee].push({caller:caller, suppressed:suppressed});
addToKeyedList(calleeGraph, caller, {callee:callee, suppressed:suppressed});
addToKeyedList(callerGraph, callee, {caller:caller, suppressed:suppressed});
}
// Map from identifier to full "mangled|readable" name. Or sometimes to a