Bug 1145426 - Fix compilation of unboxed object construction stubs on ARM and x86, r=jandem.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 23 Mar 2015 08:06:40 -0700
changeset 265374 66536c9de5ffc1d74b432207ec2645b14a861038
parent 265373 72c48d6ddc0bd616d7f6105858e99ca9752363c8
child 265375 efdffcda26710985e2349dfa1f6431c773aca061
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1145426
milestone39.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 1145426 - Fix compilation of unboxed object construction stubs on ARM and x86, r=jandem.
js/src/vm/UnboxedObject.cpp
--- a/js/src/vm/UnboxedObject.cpp
+++ b/js/src/vm/UnboxedObject.cpp
@@ -171,18 +171,20 @@ UnboxedLayout::makeConstructorCode(JSCon
             HeapTypeSet *types = group->maybeGetProperty(IdToTypeId(NameToId(property.name)));
 
             Label notObject;
             masm.branchTestObject(Assembler::NotEqual, valueOperand,
                                   types->mightBeMIRType(MIRType_Null) ? &notObject : &failureStoreObject);
 
             Register payloadReg = masm.extractObject(valueOperand, scratch1);
 
-            if (!types->hasType(TypeSet::AnyObjectType()))
-                masm.guardObjectType(payloadReg, types, scratch2, &failureStoreObject);
+            if (!types->hasType(TypeSet::AnyObjectType())) {
+                Register scratch = (payloadReg == scratch1) ? scratch2 : scratch1;
+                masm.guardObjectType(payloadReg, types, scratch, &failureStoreObject);
+            }
 
             masm.storeUnboxedProperty(targetAddress, JSVAL_TYPE_OBJECT,
                                       TypedOrValueRegister(MIRType_Object,
                                                            AnyRegister(payloadReg)), nullptr);
 
             if (notObject.used()) {
                 Label done;
                 masm.jump(&done);
@@ -202,17 +204,17 @@ UnboxedLayout::makeConstructorCode(JSCon
 
     if (object != ReturnReg)
         masm.movePtr(object, ReturnReg);
 
     // Restore non-volatile registers which were saved on entry.
     for (GeneralRegisterBackwardIterator iter(savedNonVolatileRegisters); iter.more(); ++iter)
         masm.Pop(*iter);
 
-    masm.ret();
+    masm.abiret();
 
     masm.bind(&failureStoreOther);
 
     // There was a failure while storing a value which cannot be stored at all
     // in the unboxed object. Initialize the object so it is safe for GC and
     // return null.
     masm.initUnboxedObjectContents(object, templateObject);
 
@@ -236,17 +238,17 @@ UnboxedLayout::makeConstructorCode(JSCon
 
     // Initialize the object so it is safe for GC.
     masm.initUnboxedObjectContents(object, templateObject);
 
     masm.movePtr(ImmWord(CLEAR_CONSTRUCTOR_CODE_TOKEN), object);
     masm.jump(&done);
 
     Linker linker(masm);
-    AutoFlushICache afc("RegExp");
+    AutoFlushICache afc("UnboxedObject");
     JitCode *code = linker.newCode<NoGC>(cx, OTHER_CODE);
     if (!code)
         return false;
 
     layout.setConstructorCode(code);
     return true;
 }