mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 06:45:33 +00:00
Bug 900297: Folds MToDouble in its input if it is already a double; r=sstangl
This commit is contained in:
parent
391654aa12
commit
6e5133d3c8
@ -1911,8 +1911,12 @@ MTruncateToInt32::foldsTo(bool useValueNumbers)
|
||||
MDefinition *
|
||||
MToDouble::foldsTo(bool useValueNumbers)
|
||||
{
|
||||
if (input()->isConstant()) {
|
||||
const Value &v = input()->toConstant()->value();
|
||||
MDefinition *in = input();
|
||||
if (in->type() == MIRType_Double)
|
||||
return in;
|
||||
|
||||
if (in->isConstant()) {
|
||||
const Value &v = in->toConstant()->value();
|
||||
if (v.isNumber()) {
|
||||
double out = v.toNumber();
|
||||
return MConstant::New(DoubleValue(out));
|
||||
|
Loading…
x
Reference in New Issue
Block a user