mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
[JAEGER] Added JSOP_BITXOR.
This commit is contained in:
parent
15bafd4e40
commit
7c6f4d702b
@ -360,6 +360,7 @@ mjit::Compiler::generateMethod()
|
||||
frame.dup2();
|
||||
END_CASE(JSOP_DUP2)
|
||||
|
||||
BEGIN_CASE(JSOP_BITXOR)
|
||||
BEGIN_CASE(JSOP_BITAND)
|
||||
jsop_bitop(op);
|
||||
END_CASE(JSOP_BITAND)
|
||||
|
@ -780,6 +780,19 @@ stubs::BitAnd(VMFrame &f)
|
||||
f.regs.sp[-2].setInt32(i);
|
||||
}
|
||||
|
||||
void JS_FASTCALL
|
||||
stubs::BitXor(VMFrame &f)
|
||||
{
|
||||
int32_t i, j;
|
||||
|
||||
if (!ValueToECMAInt32(f.cx, f.regs.sp[-2], &i) ||
|
||||
!ValueToECMAInt32(f.cx, f.regs.sp[-1], &j)) {
|
||||
THROW();
|
||||
}
|
||||
i = i ^ j;
|
||||
f.regs.sp[-2].setInt32(i);
|
||||
}
|
||||
|
||||
void JS_FASTCALL
|
||||
stubs::Lsh(VMFrame &f)
|
||||
{
|
||||
|
@ -74,6 +74,7 @@ JSBool JS_FASTCALL Equal(VMFrame &f);
|
||||
JSBool JS_FASTCALL NotEqual(VMFrame &f);
|
||||
|
||||
void JS_FASTCALL BitAnd(VMFrame &f);
|
||||
void JS_FASTCALL BitXor(VMFrame &f);
|
||||
void JS_FASTCALL Lsh(VMFrame &f);
|
||||
void JS_FASTCALL Rsh(VMFrame &f);
|
||||
void JS_FASTCALL Add(VMFrame &f);
|
||||
|
@ -77,6 +77,9 @@ mjit::Compiler::jsop_bitop(JSOp op)
|
||||
case JSOP_BITAND:
|
||||
stub = stubs::BitAnd;
|
||||
break;
|
||||
case JSOP_BITXOR:
|
||||
stub = stubs::BitXor;
|
||||
break;
|
||||
case JSOP_LSH:
|
||||
stub = stubs::Lsh;
|
||||
break;
|
||||
@ -124,6 +127,9 @@ mjit::Compiler::jsop_bitop(JSOp op)
|
||||
|
||||
frame.popn(2);
|
||||
switch (op) {
|
||||
case JSOP_BITXOR:
|
||||
frame.push(Int32Tag(L ^ R));
|
||||
break;
|
||||
case JSOP_BITAND:
|
||||
frame.push(Int32Tag(L & R));
|
||||
return;
|
||||
@ -141,6 +147,7 @@ mjit::Compiler::jsop_bitop(JSOp op)
|
||||
RegisterID reg;
|
||||
|
||||
switch (op) {
|
||||
case JSOP_BITXOR:
|
||||
case JSOP_BITAND:
|
||||
{
|
||||
/* Commutative, and we're guaranteed both are ints. */
|
||||
@ -153,12 +160,21 @@ mjit::Compiler::jsop_bitop(JSOp op)
|
||||
|
||||
reg = frame.ownRegForData(lhs);
|
||||
if (rhs->isConstant()) {
|
||||
masm.and32(Imm32(rhs->getValue().asInt32()), reg);
|
||||
if (op == JSOP_BITAND)
|
||||
masm.and32(Imm32(rhs->getValue().asInt32()), reg);
|
||||
else if (op == JSOP_BITXOR)
|
||||
masm.xor32(Imm32(rhs->getValue().asInt32()), reg);
|
||||
} else if (frame.shouldAvoidDataRemat(rhs)) {
|
||||
masm.and32(masm.payloadOf(frame.addressOf(rhs)), reg);
|
||||
if (op == JSOP_BITAND)
|
||||
masm.and32(masm.payloadOf(frame.addressOf(rhs)), reg);
|
||||
else if (op == JSOP_BITXOR)
|
||||
masm.xor32(masm.payloadOf(frame.addressOf(rhs)), reg);
|
||||
} else {
|
||||
RegisterID rhsReg = frame.tempRegForData(rhs);
|
||||
masm.and32(rhsReg, reg);
|
||||
if (op == JSOP_BITAND)
|
||||
masm.and32(rhsReg, reg);
|
||||
else if (op == JSOP_BITXOR)
|
||||
masm.xor32(rhsReg, reg);
|
||||
}
|
||||
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user