Closed
Bug 894582
Opened 11 years ago
Closed 11 years ago
IonMonkey: constant fold arithm operations with double output that fits in int32
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla25
People
(Reporter: h4writer, Assigned: h4writer)
Details
Attachments
(1 file, 1 obsolete file)
977 bytes,
patch
|
Details | Diff | Splinter Review |
Noticed this on kraken-stanford-crypto-ccm. EvaluateConstantOperands uses setNumber what will try to put the value in int32 if possible. Now if the output result needs to be in double, we won't constant fold, since the types don't match. But we can just transform the int32 result to double without precision loss.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee: general → hv1989
Attachment #776659 -
Flags: review?(jdemooij)
Comment 2•11 years ago
|
||
Comment on attachment 776659 [details] [diff] [review]
Patch
Review of attachment 776659 [details] [diff] [review]:
-----------------------------------------------------------------
Nice find!
::: js/src/ion/MIR.cpp
@@ +123,5 @@
> }
>
> + // setNumber eagerly transforms a number to int32.
> + // Transform back to double, if the output type is double.
> + if (ins->type() == MIRType_Double && MIRTypeFromValue(ret) == MIRType_Int32)
You can use ret.isInt32() instead of MIRTypeFromValue(ret) == MIRType_Int32.
Attachment #776659 -
Flags: review?(jdemooij) → review+
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #776659 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 4•11 years ago
|
||
Keywords: checkin-needed
Comment 5•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in
before you can comment on or make changes to this bug.
Description
•