Expand GetPropertyCache only if native; fix x64 unboxValue(). (No bug, r=dvander)
authorSean Stangl <sstangl@mozilla.com>
Tue, 10 Jan 2012 23:05:31 -0800
changeset 105548 eec21ad47cdcb0d2a931ffaffb9a47c27e2df926
parent 105547 f89babd5a9ff7a9b26404a3e969c5c1bdd356596
child 105549 32da87962f94614f8d43121d345e943fabdcdfb3
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdvander
milestone12.0a1
Expand GetPropertyCache only if native; fix x64 unboxValue(). (No bug, r=dvander)
js/src/ion/IonCaches.cpp
js/src/ion/x64/MacroAssembler-x64.h
--- a/js/src/ion/IonCaches.cpp
+++ b/js/src/ion/IonCaches.cpp
@@ -136,17 +136,17 @@ js::ion::GetPropertyCache(JSContext *cx,
 {
     IonScript *ion = GetTopIonFrame(cx);
     IonCacheGetProperty &cache = ion->getCache(cacheIndex).toGetProperty();
     JSAtom *atom = cache.atom();
 
     // 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) {
+    if (cache.stubCount() < MAX_STUBS && obj->isNative()) {
         cache.incrementStubCount();
 
         const Shape *shape = obj->nativeLookup(cx, ATOM_TO_JSID(atom));
         if (shape && shape->hasSlot() && shape->hasDefaultGetter()) {
             if (!cache.attachNative(cx, obj, shape))
                 return false;
         }
     }
--- a/js/src/ion/x64/MacroAssembler-x64.h
+++ b/js/src/ion/x64/MacroAssembler-x64.h
@@ -498,18 +498,17 @@ class MacroAssemblerX64 : public MacroAs
             Label notInt32, end;
             branchTestInt32(Assembler::NotEqual, src, &notInt32);
             cvtsi2sd(src.valueReg(), dest.fpu());
             jump(&end);
             bind(&notInt32);
             unboxDouble(src, dest.fpu());
             bind(&end);
         } else {
-            if (src.valueReg() != dest.gpr())
-                unboxNonDouble(src, dest.gpr());
+            unboxNonDouble(src, dest.gpr());
         }
     }
 
     // These two functions use the low 32-bits of the full value register.
     void boolValueToDouble(const ValueOperand &operand, const FloatRegister &dest) {
         cvtsi2sd(Operand(operand.valueReg()), dest);
     }
     void int32ValueToDouble(const ValueOperand &operand, const FloatRegister &dest) {