Skip to content
Snippets Groups Projects
Commit 5e413554 authored by Steve Fink's avatar Steve Fink
Browse files

Bug 1400442 - Fix handling of parameterNames, r=jonco

This is for nicer output only, and does not affect the computation. A WorkListEntry contains a stack of CallSites, and the top of the stack represents the entry itself and so should share parameterNames. This changes fixes cases where some names were being registered in a different table than ended up being used by printouts.

--HG--
extra : rebase_source : e52bbc9ab3e4596d748ca2d729772a61cde1430a
parent ed820e5f
No related branches found
No related tags found
No related merge requests found
......@@ -604,12 +604,12 @@ function isZero(exp)
// which are safe using a sorted array, so that this can be propagated down the
// stack. Zero is |this|, and arguments are indexed starting at one.
function WorklistEntry(name, safeArguments, stack)
function WorklistEntry(name, safeArguments, stack, parameterNames)
{
this.name = name;
this.safeArguments = safeArguments;
this.stack = stack;
this.parameterNames = {};
this.parameterNames = parameterNames;
}
WorklistEntry.prototype.readable = function()
......@@ -944,7 +944,7 @@ function process(entry, body, addCallee)
switch (callee.kind) {
case "direct":
var safeArguments = getEdgeSafeArguments(entry, edge, callee.name);
addCallee(new CallSite(callee.name, safeArguments, location, entry.parameterNames));
addCallee(new CallSite(callee.name, safeArguments, location, {}));
break;
case "resolved-field":
break;
......@@ -1040,7 +1040,8 @@ function maybeProcessMissingFunction(entry, addCallee)
function processRoot(name)
{
var safeArguments = [];
var worklist = [new WorklistEntry(name, safeArguments, [new CallSite(name, safeArguments, null, {})])];
var parameterNames = {};
var worklist = [new WorklistEntry(name, safeArguments, [new CallSite(name, safeArguments, null, parameterNames)], parameterNames)];
while (worklist.length > 0) {
var entry = worklist.pop();
......@@ -1081,7 +1082,7 @@ function processRoot(name)
for (var callee of callees) {
if (!ignoreCallEdge(entry, callee.callee)) {
var nstack = [callee, ...entry.stack];
worklist.push(new WorklistEntry(callee.callee, callee.safeArguments, nstack));
worklist.push(new WorklistEntry(callee.callee, callee.safeArguments, nstack, callee.parameterNames));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment