Bug 1409187 - Remove telemetry for __proto__. r=luke

This commit is contained in:
André Bargull 2017-11-02 07:14:45 -07:00
parent 80db1396dc
commit ca52711eb9
5 changed files with 4 additions and 33 deletions

View File

@ -1535,10 +1535,6 @@ ProtoGetter(JSContext* cx, unsigned argc, Value* vp)
return true;
}
namespace js {
size_t sSetProtoCalled = 0;
} // namespace js
static bool
ProtoSetter(JSContext* cx, unsigned argc, Value* vp)
{
@ -1555,9 +1551,6 @@ ProtoSetter(JSContext* cx, unsigned argc, Value* vp)
return true;
}
if (!cx->runningWithTrustedPrincipals())
++sSetProtoCalled;
Rooted<JSObject*> obj(cx, &args.thisv().toObject());
/* Do nothing if __proto__ isn't being set to an object or null. */

View File

@ -528,22 +528,6 @@ js::SetPreserveWrapperCallback(JSContext* cx, PreserveWrapperCallback callback)
cx->runtime()->preserveWrapperCallback = callback;
}
/*
* The below code is for temporary telemetry use. It can be removed when
* sufficient data has been harvested.
*/
namespace js {
// Defined in vm/GlobalObject.cpp.
extern size_t sSetProtoCalled;
} // namespace js
JS_FRIEND_API(size_t)
JS_SetProtoCalled(JSContext*)
{
return sSetProtoCalled;
}
JS_FRIEND_API(unsigned)
JS_PCToLineNumber(JSScript* script, jsbytecode* pc, unsigned* columnp)
{

View File

@ -71,9 +71,6 @@ JS_NewObjectWithoutMetadata(JSContext* cx, const JSClass* clasp, JS::Handle<JSOb
extern JS_FRIEND_API(uint32_t)
JS_ObjectCountDynamicSlots(JS::HandleObject obj);
extern JS_FRIEND_API(size_t)
JS_SetProtoCalled(JSContext* cx);
extern JS_FRIEND_API(bool)
JS_NondeterministicGetWeakMapKeys(JSContext* cx, JS::HandleObject obj, JS::MutableHandleObject ret);

View File

@ -3057,12 +3057,7 @@ nsXPCComponents_Utils::GetJSEngineTelemetryValue(JSContext* cx, MutableHandleVal
if (!obj)
return NS_ERROR_OUT_OF_MEMORY;
unsigned attrs = JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT;
size_t i = JS_SetProtoCalled(cx);
RootedValue v(cx, DoubleValue(i));
if (!JS_DefineProperty(cx, obj, "setProto", v, attrs))
return NS_ERROR_OUT_OF_MEMORY;
// No JS engine telemetry in use at the moment.
rval.setObject(*obj);
return NS_OK;

View File

@ -188,9 +188,11 @@ Structure:
.. code-block:: js
"js" : {
"setProto": <unsigned integer>, // Number of times __proto__ is set
// ...
}
As of Firefox 59 this section no longer contains any entries.
maximalNumberOfConcurrentThreads
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An integer representing the highest number of threads encountered so far during the session.