Bug 1147608 - Fixes for unboxed object creation stub compilation on x86 and ARM, r=jandem.
authorBrian Hackett <bhackett1024@gmail.com>
Wed, 08 Apr 2015 11:10:56 -0600
changeset 238185 f345912dc20cfa1f91a8627ad412c35aac336d88
parent 238184 33d37539c4ab3c06e65172277e27fe2e77beccbd
child 238186 1dfe22ca4abee887d5c87dfed633795393e506ad
push id58135
push userbhackett@mozilla.com
push dateWed, 08 Apr 2015 17:11:25 +0000
treeherdermozilla-inbound@f345912dc20c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1147608
milestone40.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 1147608 - Fixes for unboxed object creation stub compilation on x86 and ARM, r=jandem.
js/src/vm/UnboxedObject.cpp
--- a/js/src/vm/UnboxedObject.cpp
+++ b/js/src/vm/UnboxedObject.cpp
@@ -104,16 +104,20 @@ UnboxedLayout::makeConstructorCode(JSCon
     regs.take(propertiesReg);
     regs.take(newKindReg);
     Register object = regs.takeAny(), scratch1 = regs.takeAny(), scratch2 = regs.takeAny();
 
     LiveGeneralRegisterSet savedNonVolatileRegisters = SavedNonVolatileRegisters(regs);
     for (GeneralRegisterForwardIterator iter(savedNonVolatileRegisters); iter.more(); ++iter)
         masm.Push(*iter);
 
+    // The scratch double register might be used by MacroAssembler methods.
+    if (ScratchDoubleReg.volatile_())
+        masm.push(ScratchDoubleReg);
+
     Label failure, tenuredObject, allocated;
     masm.branch32(Assembler::NotEqual, newKindReg, Imm32(GenericObject), &tenuredObject);
     masm.branchTest32(Assembler::NonZero, AbsoluteAddress(group->addressOfFlags()),
                       Imm32(OBJECT_FLAG_PRE_TENURE), &tenuredObject);
 
     // Allocate an object in the nursery
     masm.createGCObject(object, scratch1, templateObject, gc::DefaultHeap, &failure,
                         /* initFixedSlots = */ false);
@@ -201,16 +205,18 @@ UnboxedLayout::makeConstructorCode(JSCon
 
     Label done;
     masm.bind(&done);
 
     if (object != ReturnReg)
         masm.movePtr(object, ReturnReg);
 
     // Restore non-volatile registers which were saved on entry.
+    if (ScratchDoubleReg.volatile_())
+        masm.pop(ScratchDoubleReg);
     for (GeneralRegisterBackwardIterator iter(savedNonVolatileRegisters); iter.more(); ++iter)
         masm.Pop(*iter);
 
     masm.abiret();
 
     masm.bind(&failureStoreOther);
 
     // There was a failure while storing a value which cannot be stored at all
@@ -645,17 +651,20 @@ UnboxedPlainObject::createWithProperties
         return nullptr;
 
     for (size_t i = 0; i < layout.properties().length(); i++) {
         if (!obj->setValue(cx, layout.properties()[i], properties[i].value))
             return NewPlainObjectWithProperties(cx, properties, layout.properties().length(), newKind);
     }
 
 #ifndef JS_CODEGEN_NONE
-    if (cx->isJSContext() && !layout.constructorCode()) {
+    if (cx->isJSContext() &&
+        !layout.constructorCode() &&
+        cx->asJSContext()->runtime()->jitSupportsFloatingPoint)
+    {
         if (!UnboxedLayout::makeConstructorCode(cx->asJSContext(), group))
             return nullptr;
     }
 #endif
 
     return obj;
 }