From cf3725b9d93d41cdae09a74d310d5fe1364b6936 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 18 Dec 2013 15:54:32 -0800 Subject: [PATCH] Bug 925088 - SpiderMonkey: Micro-optimize x64's testStringTruthy. r=mjrosen --- js/src/jit/x64/MacroAssembler-x64.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/js/src/jit/x64/MacroAssembler-x64.h b/js/src/jit/x64/MacroAssembler-x64.h index 25b997d887a4..853030bbb273 100644 --- a/js/src/jit/x64/MacroAssembler-x64.h +++ b/js/src/jit/x64/MacroAssembler-x64.h @@ -1103,14 +1103,11 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared testl(operand.valueReg(), operand.valueReg()); j(truthy ? NonZero : Zero, label); } - // This returns the tag in ScratchReg. Condition testStringTruthy(bool truthy, const ValueOperand &value) { unboxString(value, ScratchReg); Operand lengthAndFlags(ScratchReg, JSString::offsetOfLengthAndFlags()); - movq(lengthAndFlags, ScratchReg); - shrq(Imm32(JSString::LENGTH_SHIFT), ScratchReg); - testq(ScratchReg, ScratchReg); + testq(lengthAndFlags, Imm32(-1 << JSString::LENGTH_SHIFT)); return truthy ? Assembler::NonZero : Assembler::Zero; }