зеркало из https://github.com/mozilla/gecko-dev.git
Bug 925088 - SpiderMonkey: Micro-optimize x64's testStringTruthy. r=mjrosen
This commit is contained in:
Родитель
d45bd41ac3
Коммит
cf3725b9d9
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче