mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
[JAEGER] Constant fold neg on ints better (bug 584838, r=dvander).
This commit is contained in:
parent
2bd80dd548
commit
335c2b44df
@ -703,11 +703,21 @@ mjit::Compiler::generateMethod()
|
||||
{
|
||||
FrameEntry *top = frame.peek(-1);
|
||||
if (top->isConstant() && top->getValue().isPrimitive()) {
|
||||
double d;
|
||||
ValueToNumber(cx, top->getValue(), &d);
|
||||
d = -d;
|
||||
frame.pop();
|
||||
frame.push(DoubleValue(d));
|
||||
if (top->isType(JSVAL_TYPE_INT32) &&
|
||||
top->getValue().toInt32() != 0 &&
|
||||
top->getValue().toInt32() != (1 << 31))
|
||||
{
|
||||
int32 value = top->getValue().toInt32();
|
||||
value = -value;
|
||||
frame.pop();
|
||||
frame.push(Int32Value(value));
|
||||
} else {
|
||||
double d;
|
||||
ValueToNumber(cx, top->getValue(), &d);
|
||||
d = -d;
|
||||
frame.pop();
|
||||
frame.push(DoubleValue(d));
|
||||
}
|
||||
} else {
|
||||
jsop_neg();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user