Bug 670059 - Add some JS engine telemetry counters to measure occurrences of: E4X, __iterator__, mutable __proto__ (r=taras,waldo)

This commit is contained in:
Luke Wagner
2011-07-07 15:40:33 -07:00
parent 7413c41e1d
commit 1a03d35516
13 changed files with 129 additions and 9 deletions

View File

@@ -339,6 +339,8 @@ GetPropertyNames(JSContext *cx, JSObject *obj, uintN flags, AutoIdVector *props)
}
size_t sCustomIteratorCount = 0;
static inline bool
GetCustomIterator(JSContext *cx, JSObject *obj, uintN flags, Value *vp)
{
@@ -353,6 +355,9 @@ GetCustomIterator(JSContext *cx, JSObject *obj, uintN flags, Value *vp)
return true;
}
if (!cx->runningWithTrustedPrincipals())
++sCustomIteratorCount;
/* Otherwise call it and return that object. */
LeaveTrace(cx);
Value arg = BooleanValue((flags & JSITER_FOREACH) == 0);