Backed out 3 changesets (bug 1680607, bug 1685588, bug 1685586) for SM bustages. CLOSED TREE

Backed out changeset 0382d66d1f7a (bug 1685588)
Backed out changeset bdd7ddb19a48 (bug 1685586)
Backed out changeset cc6fbd4db752 (bug 1680607)
This commit is contained in:
Narcis Beleuzu 2021-01-27 18:16:33 +02:00
Родитель 15a8aa84e8
Коммит 1fbccc0d6c
5 изменённых файлов: 16 добавлений и 82 удалений

Просмотреть файл

@ -54,17 +54,6 @@ struct TypedArray_base : public SpiderMonkeyInterfaceObjectStorage,
mutable bool mShared;
mutable bool mComputed;
// This class stores a pointer to a typed array's data that might be unstable
// across a GC. Specifically, a typed array can store its data inline in the
// header, which can move during compaction. This member will prevent this
// class from being held across a GC.
//
// Note that because this class has a nontrivial destructor, it will be
// considered live for its entire scope. Use the below Reset() method to mark
// the end of its live region if you get a false positive hazard (false
// alarm) after the data pointer is last used.
JS::AutoCheckCannotGC mNoGC;
public:
inline bool Init(JSObject* obj) {
MOZ_ASSERT(!inited());
@ -147,7 +136,6 @@ struct TypedArray_base : public SpiderMonkeyInterfaceObjectStorage,
mComputed = true;
}
// See the mNoGC comment above.
inline void Reset() {
// This method mostly exists to inform the GC rooting hazard analysis that
// the variable can be considered dead, at least until you do anything else

Просмотреть файл

@ -11,7 +11,7 @@ loadRelativeToScript('annotations.js');
loadRelativeToScript('CFG.js');
loadRelativeToScript('dumpCFG.js');
var sourceRoot = (os.getenv('SOURCE') || '') + '/';
var sourceRoot = (os.getenv('SOURCE') || '') + '/'
var functionName;
var functionBodies;
@ -37,8 +37,8 @@ var tmpfile = scriptArgs[7] || "tmp.txt";
var gcFunctions = {};
var text = snarf("gcFunctions.lst").split("\n");
assert(text.pop().length == 0);
for (const line of text)
gcFunctions[mangled(line)] = readable(line);
for (var line of text)
gcFunctions[mangled(line)] = true;
var limitedFunctions = {};
var text = snarf(limitedFunctionsFile).split("\n");
@ -55,7 +55,7 @@ var typeInfo = loadTypeInfo(typeInfoFile);
var gcEdges = {};
text = snarf(gcEdgesFile).split('\n');
assert(text.pop().length == 0);
for (const line of text) {
for (var line of text) {
var [ block, edge, func ] = line.split(" || ");
if (!(block in gcEdges))
gcEdges[block] = {}
@ -531,7 +531,7 @@ function edgeCanGC(edge)
if (variable.Kind == "Func") {
var func = mangled(variable.Name[0]);
if ((func in gcFunctions) || ((func + internalMarker) in gcFunctions))
return `'${func}$${gcFunctions[func]}'`;
return "'" + variable.Name[0] + "'";
return null;
}

Просмотреть файл

@ -192,7 +192,7 @@ function str_call(prefix, edge, env) {
}
print(JSON.stringify(edge, null, 4));
throw new Error("unhandled format error");
throw "unhandled format error";
}
function str_assign(prefix, edge) {
@ -224,7 +224,7 @@ function str_assume(prefix, edge) {
}
print(JSON.stringify(edge, null, 4));
throw new Error("unhandled format error");
throw "unhandled format error";
}
function str_edge(edge, env) {

Просмотреть файл

@ -19,15 +19,6 @@ parser.add_argument("extra", nargs="?", default="unnecessary.txt")
parser.add_argument("refs", nargs="?", default="refs.txt")
args = parser.parse_args()
# Imitate splitFunction from utility.js.
def splitfunc(full):
idx = full.find("$")
if idx == -1:
return (full, full)
return (full[0:idx], full[idx + 1 :])
num_hazards = 0
num_refs = 0
num_missing = 0
@ -75,10 +66,7 @@ try:
) # NOQA: E501
if m:
current_gcFunction = m.group(1)
_, readable = splitfunc(current_gcFunction)
hazardousGCFunctions[current_gcFunction].append(
line.replace(current_gcFunction, readable)
)
hazardousGCFunctions[current_gcFunction].append(line)
hazardOrder.append(
(
current_gcFunction,
@ -102,7 +90,6 @@ try:
else:
hazardousGCFunctions[current_gcFunction][-1] += line
mangled2full = {}
with open(args.gcFunctions) as gcFunctions:
gcExplanations = {} # gcFunction => stack showing why it can GC
@ -113,10 +100,10 @@ try:
if m:
if current_func:
gcExplanations[current_func] = explanation
current_func = m.group(1)
mangled, _ = splitfunc(current_func)
mangled2full[mangled] = current_func
explanation = line
current_func = None
if m.group(1) in hazardousGCFunctions:
current_func = m.group(1)
explanation = line
elif current_func:
explanation += line
if current_func:
@ -126,25 +113,7 @@ try:
gcHazards = hazardousGCFunctions[gcFunction]
if gcFunction in gcExplanations:
key = gcFunction
else:
# Mangled constructor/destructor names can map to multiple
# unmangled names. We have both here, and the unmangled name
# seen here in the caller may not match the unmangled name in
# the callee, so if we don't find the full function then key
# off of the mangled name instead.
#
# Normally the analysis tries to use the mangled name for
# identity comparison, but here we're processing human-readable
# output. Perhaps a better solution might be to treat the
# rootingHazards.txt input here as internal and only list
# mangled names, expanding them to unmangled names when
# producing hazards.txt and the other output files.
mangled, _ = splitfunc(gcFunction)
key = mangled2full[mangled]
if key in gcExplanations:
print(gcHazards[index] + gcExplanations[key], file=hazards)
print(gcHazards[index] + gcExplanations[gcFunction], file=hazards)
else:
print(gcHazards[index], file=hazards)

Просмотреть файл

@ -346,22 +346,7 @@ no shell found in %s -- must build the JS shell with `mach hazards build-shell`
@CommandArgument(
"--work-dir", default=None, help="Directory for output and working files."
)
@CommandArgument(
"--jobs", "-j", default=None, type=int, help="Number of parallel analyzers."
)
@CommandArgument(
"--verbose",
"-v",
default=False,
action="store_true",
help="Display executed commands.",
)
@CommandArgument(
"--from-stage",
default="gcTypes",
help="Stage to begin running at ('list' to see all).",
)
def analyze(self, application, shell_objdir, work_dir, jobs, verbose, from_stage):
def analyze(self, application, shell_objdir, work_dir):
"""Analyzed gathered data for rooting hazards"""
shell = self.ensure_shell(shell_objdir)
@ -369,18 +354,10 @@ no shell found in %s -- must build the JS shell with `mach hazards build-shell`
os.path.join(self.script_dir, "analyze.py"),
"--js",
shell,
"gcTypes",
"-v",
]
if from_stage == "list":
from_stage = "--list"
args.append(from_stage)
if jobs is not None:
args.extend(["-j", jobs])
if verbose:
args.append("-v")
self.setup_env_for_tools(os.environ)
os.environ["LD_LIBRARY_PATH"] += ":" + os.path.dirname(shell)