Backed out changeset c22b643cdf51 (bug 1479961, bug 1480129)

This commit is contained in:
Steve Fink 2018-10-16 14:35:44 -07:00
Родитель 1e4c6cc85c
Коммит 04fc511d3d
5 изменённых файлов: 5 добавлений и 43 удалений

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

@ -55,11 +55,6 @@
// subsumes JS_HAZ_GC_CALL, since anything that can run script can GC.`
# define JS_HAZ_CAN_RUN_SCRIPT __attribute__((annotate("Can run script")))
// Mark a function as able to call JSNatives. Otherwise, JSNatives don't show
// up in the callgraph. This doesn't matter for the can-GC analysis, but it is
// very nice for other uses of the callgraph.
# define JS_HAZ_JSNATIVE_CALLER __attribute__((annotate("Calls JSNatives")))
#else
# define JS_HAZ_GC_THING
@ -71,7 +66,6 @@
# define JS_HAZ_GC_CALL
# define JS_HAZ_GC_SUPPRESSED
# define JS_HAZ_CAN_RUN_SCRIPT
# define JS_HAZ_JSNATIVE_CALLER
#endif

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

@ -427,15 +427,3 @@ function listNonGCPointers() {
'NPIdentifier',
];
}
function isJSNative(mangled)
{
// _Z...E = function
// 9JSContext = JSContext*
// j = uint32
// PN2JS5Value = JS::Value*
// P = pointer
// N2JS = JS::
// 5Value = Value
return mangled.endsWith("P9JSContextjPN2JS5ValueE") && mangled.startsWith("_Z");
}

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

@ -18,9 +18,6 @@ var origOut = os.file.redirect(callgraphOut_filename);
var memoized = new Map();
var memoizedCount = 0;
var JSNativeCaller = Object.create(null);
var JSNatives = [];
var unmangled2id = new Set();
function getId(name)
@ -105,11 +102,8 @@ function processBody(functionName, body)
return;
for (var tag of getAnnotations(functionName, body).values()) {
for (var tag of getAnnotations(functionName, body).values())
print("T " + functionId(functionName) + " " + tag);
if (tag == "Calls JSNatives")
JSNativeCaller[functionName] = true;
}
// Set of all callees that have been output so far, in order to suppress
// repeated callgraph edges from being recorded. This uses a Map from
@ -228,8 +222,6 @@ function process(functionName, functionBodies)
printOnce("D " + functionId(inChargeXTor) + " " + functionId(functionName));
}
const [ mangled, unmangled ] = splitFunction(functionName);
// Further note: from https://itanium-cxx-abi.github.io/cxx-abi/abi.html the
// different kinds of constructors/destructors are:
// C1 # complete object constructor
@ -264,6 +256,7 @@ function process(functionName, functionBodies)
// Currently, allocating constructors are never used.
//
if (functionName.indexOf("C4") != -1) {
var [ mangled, unmangled ] = splitFunction(functionName);
// E terminates the method name (and precedes the method parameters).
// If eg "C4E" shows up in the mangled name for another reason, this
// will create bogus edges in the callgraph. But it will affect little
@ -312,17 +305,6 @@ function process(functionName, functionBodies)
printOnce("D " + functionId(D1) + " " + functionId(D2));
printOnce("D " + functionId(D2) + " " + functionId(functionName));
}
if (isJSNative(mangled))
JSNatives.push(functionName);
}
function postprocess_callgraph() {
for (const caller of Object.keys(JSNativeCaller)) {
const caller_id = functionId(caller);
for (const callee of JSNatives)
printOnce(`D ${caller_id} ${functionId(callee)}`);
}
}
for (var nameIndex = minStream; nameIndex <= maxStream; nameIndex++) {
@ -333,6 +315,4 @@ for (var nameIndex = minStream; nameIndex <= maxStream; nameIndex++) {
xdb.free_string(data);
}
postprocess_callgraph();
os.file.close(os.file.redirect(origOut));

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

@ -17,7 +17,7 @@
using namespace js;
using namespace js::jit;
static EnterJitStatus JS_HAZ_JSNATIVE_CALLER
static EnterJitStatus
EnterJit(JSContext* cx, RunState& state, uint8_t* code)
{
MOZ_ASSERT(state.script()->hasBaselineScript());

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

@ -368,7 +368,7 @@ MaybeCreateThisForConstructor(JSContext* cx, JSScript* calleeScript, const CallA
return CreateThis(cx, callee, calleeScript, newTarget, newKind, args.mutableThisv());
}
static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool
static MOZ_NEVER_INLINE bool
Interpret(JSContext* cx, RunState& state);
InterpreterFrame*
@ -1992,7 +1992,7 @@ js::ReportInNotObjectError(JSContext* cx, HandleValue lref, int lindex,
InformalValueTypeName(rref));
}
static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool
static MOZ_NEVER_INLINE bool
Interpret(JSContext* cx, RunState& state)
{
/*