mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 925088 - SpiderMonkey: Micro-optimize x64's testStringTruthy. r=mjrosen
This commit is contained in:
parent
890486dfd3
commit
11d1351e08
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user