Bug 750573 - Handle __noSuchMethod__ in GetProperty cache. r=dvander
authorSean Stangl <sstangl@mozilla.com>
Tue, 01 May 2012 11:39:32 -0700
changeset 112436 eed34f344d38fbc40ddf6e674a7ddbcf883116de
parent 112435 ff4083f660ed00f8850c9e55e57cfbf8a2444c0f
child 112437 321cdf2e925842f35d95c40c2a1eb583eff463ae
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs750573
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 750573 - Handle __noSuchMethod__ in GetProperty cache. r=dvander
js/src/ion/IonCaches.cpp
--- a/js/src/ion/IonCaches.cpp
+++ b/js/src/ion/IonCaches.cpp
@@ -265,24 +265,28 @@ IsCacheableGetProp(JSObject *obj, JSObje
             IsCacheableProtoChain(obj, holder) &&
             shape->hasSlot() &&
             shape->hasDefaultGetter());
 }
 
 bool
 js::ion::GetPropertyCache(JSContext *cx, size_t cacheIndex, JSObject *obj, Value *vp)
 {
-    JSScript *script = GetTopIonJSScript(cx);
-    IonScript *ion = script->ionScript();
+    JSScript *topScript = GetTopIonJSScript(cx);
+    IonScript *ion = topScript->ionScript();
 
     IonCacheGetProperty &cache = ion->getCache(cacheIndex).toGetProperty();
     JSAtom *atom = cache.atom();
 
+    JSScript *script;
+    jsbytecode *pc;
+    cache.getScriptedLocation(&script, &pc);
+
     // Override the return value if we are invalidated (bug 728188).
-    AutoDetectInvalidation adi(cx, vp, script);
+    AutoDetectInvalidation adi(cx, vp, topScript);
 
     // For now, just stop generating new stubs once we hit the stub count
     // limit. Once we can make calls from within generated stubs, a new call
     // stub will be generated instead and the previous stubs unlinked.
     if (cache.stubCount() < MAX_STUBS && obj->isNative()) {
         cache.incrementStubCount();
 
         jsid id = ATOM_TO_JSID(atom);
@@ -295,25 +299,21 @@ js::ion::GetPropertyCache(JSContext *cx,
 
         const Shape *shape = (const Shape *)prop;
         if (IsCacheableGetProp(obj, holder, shape)) {
             if (!cache.attachNative(cx, obj, holder, shape))
                 return false;
         }
     }
 
-    if (!obj->getGeneric(cx, obj, ATOM_TO_JSID(atom), vp))
+    if (!GetPropertyOperation(cx, pc, ObjectValue(*obj), vp))
         return false;
 
-    {
-        JSScript *script;
-        jsbytecode *pc;
-        cache.getScriptedLocation(&script, &pc);
-        types::TypeScript::Monitor(cx, script, pc, *vp);
-    }
+    // Monitor changes to cache entry.
+    types::TypeScript::Monitor(cx, script, pc, *vp);
 
     return true;
 }
 
 void
 IonCache::updateBaseAddress(IonCode *code, MacroAssembler &masm)
 {
     initialJump_.repoint(code, &masm);