зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset bc2fdecaaec7 (bug 1129769) for hazard failures on a CLOSED TREE
This commit is contained in:
Родитель
feb55fb8f3
Коммит
797908c3f9
|
@ -293,25 +293,15 @@ struct ForEachTrackedOptimizationTypeInfoOp
|
|||
// function.
|
||||
// - "alloc site" for object types tied to an allocation site.
|
||||
// - "prototype" for object types tied neither to a constructor nor
|
||||
// to an allocation site, but to a prototype.
|
||||
// - "singleton" for object types which only has a single value.
|
||||
// - "function" for object types referring to scripted functions.
|
||||
// - "native" for object types referring to native functions.
|
||||
// to an allocation site.
|
||||
//
|
||||
// The name parameter is the string representation of the type. If the
|
||||
// type is keyed by "constructor", or if the type itself refers to a
|
||||
// scripted function, the name is the function's displayAtom. If the type
|
||||
// is keyed by "native", this is nullptr.
|
||||
// scripted function, the name is the function's displayAtom.
|
||||
//
|
||||
// The location parameter is the filename if the type is keyed by
|
||||
// "constructor", "alloc site", or if the type itself refers to a scripted
|
||||
// function. If the type is keyed by "native", it is the offset of the
|
||||
// native function, suitable for use with addr2line on Linux or atos on OS
|
||||
// X. Otherwise it is nullptr.
|
||||
//
|
||||
// The lineno parameter is the line number if the type is keyed by
|
||||
// "constructor", "alloc site", or if the type itself refers to a scripted
|
||||
// function. Otherwise it is UINT32_MAX.
|
||||
// If the type is keyed by "constructor", "alloc site", or if the type
|
||||
// itself refers to a scripted function, the location and lineno
|
||||
// parameters will be respectively non-nullptr and non-0.
|
||||
virtual void readType(const char *keyedBy, const char *name,
|
||||
const char *location, unsigned lineno) = 0;
|
||||
|
||||
|
|
|
@ -1147,7 +1147,7 @@ InterpretedFunctionFilenameAndLineNumber(JSFunction *fun, const char **filename,
|
|||
}
|
||||
|
||||
static JSFunction *
|
||||
FunctionFromTrackedType(const IonTrackedTypeWithAddendum &tracked)
|
||||
InterpretedFunctionFromTrackedType(const IonTrackedTypeWithAddendum &tracked)
|
||||
{
|
||||
if (tracked.hasConstructor())
|
||||
return tracked.constructor;
|
||||
|
@ -1184,32 +1184,7 @@ class ForEachTypeInfoAdapter : public IonTrackedOptimizationsTypeInfo::ForEachOp
|
|||
char buf[512];
|
||||
const uint32_t bufsize = mozilla::ArrayLength(buf);
|
||||
|
||||
if (JSFunction *fun = FunctionFromTrackedType(tracked)) {
|
||||
if (fun->isNative()) {
|
||||
//
|
||||
// Print out the absolute address of the function pointer.
|
||||
//
|
||||
// Note that this address is not usable without knowing the
|
||||
// starting address at which our shared library is loaded. Shared
|
||||
// library information is exposed by the profiler. If this address
|
||||
// needs to be symbolicated manually (e.g., when it is gotten via
|
||||
// debug spewing of all optimization information), it needs to be
|
||||
// converted to an offset from the beginning of the shared library
|
||||
// for use with utilities like `addr2line` on Linux and `atos` on
|
||||
// OS X. Converting to an offset may be done via dladdr():
|
||||
//
|
||||
// void *addr = JS_FUNC_TO_DATA_PTR(void *, fun->native());
|
||||
// uintptr_t offset;
|
||||
// Dl_info info;
|
||||
// if (dladdr(addr, &info) != 0)
|
||||
// offset = uintptr_t(addr) - uintptr_t(info.dli_fbase);
|
||||
//
|
||||
uintptr_t addr = JS_FUNC_TO_DATA_PTR(uintptr_t, fun->native());
|
||||
JS_snprintf(buf, bufsize, "%llx", addr);
|
||||
op_.readType("native", nullptr, buf, UINT32_MAX);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSFunction *fun = InterpretedFunctionFromTrackedType(tracked)) {
|
||||
PutEscapedString(buf, bufsize, fun->displayAtom(), 0);
|
||||
const char *filename;
|
||||
unsigned lineno;
|
||||
|
@ -1229,12 +1204,7 @@ class ForEachTypeInfoAdapter : public IonTrackedOptimizationsTypeInfo::ForEachOp
|
|||
return;
|
||||
}
|
||||
|
||||
if (ty.isGroup()) {
|
||||
op_.readType("prototype", buf, nullptr, UINT32_MAX);
|
||||
return;
|
||||
}
|
||||
|
||||
op_.readType("singleton", buf, nullptr, UINT32_MAX);
|
||||
op_.readType("prototype", buf, nullptr, 0);
|
||||
}
|
||||
|
||||
void operator()(JS::TrackedTypeSite site, MIRType mirType) MOZ_OVERRIDE {
|
||||
|
|
|
@ -222,13 +222,9 @@ public:
|
|||
|
||||
mWriter.BeginObject();
|
||||
mWriter.NameValue("keyedBy", keyedBy);
|
||||
if (name) {
|
||||
mWriter.NameValue("name", name);
|
||||
}
|
||||
mWriter.NameValue("name", name);
|
||||
if (location) {
|
||||
mWriter.NameValue("location", location);
|
||||
}
|
||||
if (lineno != UINT32_MAX) {
|
||||
mWriter.NameValue("line", lineno);
|
||||
}
|
||||
mWriter.EndObject();
|
||||
|
|
Загрузка…
Ссылка в новой задаче