Bug 1499128 - Use MacroAssembler::branctTestPtr with NonZero instead of NotEqual condition in WasmBaselineCompile; r=nbp
authorDragan Mladjenovic <dragan.mladjenovic>
Mon, 15 Oct 2018 19:15:52 +0200
changeset 489775 2a75c991871634b64f4dbf179130be4d279f521d
parent 489774 26d29ab41cdf753774f2d7ccdc0a7b460a5528cc
child 489776 458bf1864db00b40822ad8954b6f9c7d1c5429db
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersnbp
bugs1499128
milestone64.0a1
Bug 1499128 - Use MacroAssembler::branctTestPtr with NonZero instead of NotEqual condition in WasmBaselineCompile; r=nbp
js/src/wasm/WasmBaselineCompile.cpp
--- a/js/src/wasm/WasmBaselineCompile.cpp
+++ b/js/src/wasm/WasmBaselineCompile.cpp
@@ -9774,17 +9774,17 @@ BaseCompiler::emitStructNew()
     const StructType& structType = env_.types[typeIndex].structType();
 
     pushI32(structType.moduleIndex_);
     emitInstanceCall(lineOrBytecode, SigPI_, ExprType::AnyRef, SymbolicAddress::StructNew);
 
     // Null pointer check.
 
     Label ok;
-    masm.branchTestPtr(Assembler::NotEqual, ReturnReg, ReturnReg, &ok);
+    masm.branchTestPtr(Assembler::NonZero, ReturnReg, ReturnReg, &ok);
     trap(Trap::ThrowReported);
     masm.bind(&ok);
 
     // As many arguments as there are fields.
 
     MOZ_ASSERT(args.length() == structType.fields_.length());
 
     // Optimization opportunity: Iterate backward to pop arguments off the
@@ -9903,17 +9903,17 @@ BaseCompiler::emitStructGet()
         return true;
     }
 
     const StructType& structType = env_.types[typeIndex].structType();
 
     RegPtr rp = popRef();
 
     Label ok;
-    masm.branchTestPtr(Assembler::NotEqual, rp, rp, &ok);
+    masm.branchTestPtr(Assembler::NonZero, rp, rp, &ok);
     trap(Trap::NullPointerDereference);
     masm.bind(&ok);
 
     if (!structType.isInline_) {
         masm.loadPtr(Address(rp, OutlineTypedObject::offsetOfData()), rp);
     }
 
     uint32_t offs = structType.fields_[fieldIndex].offset;
@@ -10008,17 +10008,17 @@ BaseCompiler::emitStructSet()
         break;
       default:
         MOZ_CRASH("Unexpected field type");
     }
 
     RegPtr rp = popRef();
 
     Label ok;
-    masm.branchTestPtr(Assembler::NotEqual, rp, rp, &ok);
+    masm.branchTestPtr(Assembler::NonZero, rp, rp, &ok);
     trap(Trap::NullPointerDereference);
     masm.bind(&ok);
 
     if (!structType.isInline_) {
         masm.loadPtr(Address(rp, OutlineTypedObject::offsetOfData()), rp);
     }
 
     uint32_t offs = structType.fields_[fieldIndex].offset;
@@ -10080,17 +10080,17 @@ BaseCompiler::emitStructNarrow()
         return true;
     }
 
     // Null pointers are just passed through.
 
     Label done;
     Label doTest;
     RegPtr rp = popRef();
-    masm.branchTestPtr(Assembler::NotEqual, rp, rp, &doTest);
+    masm.branchTestPtr(Assembler::NonZero, rp, rp, &doTest);
     pushRef(NULLREF_VALUE);
     masm.jump(&done);
 
     // AnyRef -> (ref T) must first unbox; leaves rp or null
 
     bool mustUnboxAnyref = inputType == ValType::AnyRef;
 
     // Dynamic downcast (ref T) -> (ref U), leaves rp or null