Bug 503694 - TM: Code run off an event handler is never traced, r=brendan.

This commit is contained in:
Graydon Hoare
2009-08-06 12:40:51 -07:00
parent 1300b509ec
commit ce2fb51bf2
4 changed files with 57 additions and 57 deletions

View File

@@ -3942,25 +3942,6 @@ out:
return protoIndex;
}
/*
* We cache name lookup results only for the global object or for native
* non-global objects without prototype or with prototype that never mutates,
* see bug 462734 and bug 487039.
*/
static inline bool
IsCacheableNonGlobalScope(JSObject *obj)
{
JS_ASSERT(STOBJ_GET_PARENT(obj));
JSClass *clasp = STOBJ_GET_CLASS(obj);
bool cacheable = (clasp == &js_CallClass ||
clasp == &js_BlockClass ||
clasp == &js_DeclEnvClass);
JS_ASSERT_IF(cacheable, obj->map->ops->lookupProperty == js_LookupProperty);
return cacheable;
}
JSPropCacheEntry *
js_FindPropertyHelper(JSContext *cx, jsid id, JSBool cacheResult,
JSObject **objp, JSObject **pobjp, JSProperty **propp)
@@ -3979,7 +3960,7 @@ js_FindPropertyHelper(JSContext *cx, jsid id, JSBool cacheResult,
parent = OBJ_GET_PARENT(cx, obj);
for (scopeIndex = 0;
parent
? IsCacheableNonGlobalScope(obj)
? js_IsCacheableNonGlobalScope(obj)
: obj->map->ops->lookupProperty == js_LookupProperty;
++scopeIndex) {
protoIndex =
@@ -4078,7 +4059,7 @@ js_FindIdentifierBase(JSContext *cx, JSObject *scopeChain, jsid id)
* farther checks or lookups. For details see the JSOP_BINDNAME case of
* js_Interpret.
*/
for (int scopeIndex = 0; IsCacheableNonGlobalScope(obj); scopeIndex++) {
for (int scopeIndex = 0; js_IsCacheableNonGlobalScope(obj); scopeIndex++) {
JSObject *pobj;
JSProperty *prop;
int protoIndex = js_LookupPropertyWithFlags(cx, obj, id,