mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 862103 - Address review comments, r=jandem.
This commit is contained in:
parent
598edcfbee
commit
220a7d9c7f
@ -120,3 +120,28 @@ BaselineInspector::expectedResultType(jsbytecode *pc)
|
||||
return MIRType_None;
|
||||
}
|
||||
}
|
||||
|
||||
// Whether a baseline stub kind is suitable for a double comparison that
|
||||
// converts its operands to doubles.
|
||||
static bool
|
||||
CanUseDoubleCompare(ICStub::Kind kind)
|
||||
{
|
||||
return kind == ICStub::Compare_Double || kind == ICStub::Compare_NumberWithUndefined;
|
||||
}
|
||||
|
||||
MCompare::CompareType
|
||||
BaselineInspector::expectedCompareType(jsbytecode *pc)
|
||||
{
|
||||
ICStub::Kind kind = monomorphicStubKind(pc);
|
||||
|
||||
if (CanUseDoubleCompare(kind))
|
||||
return MCompare::Compare_Double;
|
||||
|
||||
ICStub::Kind first, second;
|
||||
if (dimorphicStubKind(pc, &first, &second)) {
|
||||
if (CanUseDoubleCompare(first) && CanUseDoubleCompare(second))
|
||||
return MCompare::Compare_Double;
|
||||
}
|
||||
|
||||
return MCompare::Compare_Unknown;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
#include "BaselineJIT.h"
|
||||
#include "BaselineIC.h"
|
||||
#include "MIR.h"
|
||||
|
||||
namespace js {
|
||||
namespace ion {
|
||||
@ -89,6 +90,9 @@ class BaselineInspector
|
||||
return ICInspectorType(this, pc, ent);
|
||||
}
|
||||
|
||||
ICStub::Kind monomorphicStubKind(jsbytecode *pc);
|
||||
bool dimorphicStubKind(jsbytecode *pc, ICStub::Kind *pfirst, ICStub::Kind *psecond);
|
||||
|
||||
public:
|
||||
RawShape maybeMonomorphicShapeForPropertyOp(jsbytecode *pc);
|
||||
|
||||
@ -96,10 +100,8 @@ class BaselineInspector
|
||||
return makeICInspector<SetElemICInspector>(pc, ICStub::SetElem_Fallback);
|
||||
}
|
||||
|
||||
ICStub::Kind monomorphicStubKind(jsbytecode *pc);
|
||||
bool dimorphicStubKind(jsbytecode *pc, ICStub::Kind *pfirst, ICStub::Kind *psecond);
|
||||
|
||||
MIRType expectedResultType(jsbytecode *pc);
|
||||
MCompare::CompareType expectedCompareType(jsbytecode *pc);
|
||||
};
|
||||
|
||||
} // namespace ion
|
||||
|
@ -1383,14 +1383,6 @@ MCompare::inputType()
|
||||
}
|
||||
}
|
||||
|
||||
// Whether a baseline stub kind is suitable for a double comparison that
|
||||
// converts its operands to doubles.
|
||||
static bool
|
||||
CanUseDoubleCompare(ICStub::Kind kind)
|
||||
{
|
||||
return kind == ICStub::Compare_Double || kind == ICStub::Compare_NumberWithUndefined;
|
||||
}
|
||||
|
||||
void
|
||||
MCompare::infer(JSContext *cx, BaselineInspector *inspector, jsbytecode *pc)
|
||||
{
|
||||
@ -1505,22 +1497,8 @@ MCompare::infer(JSContext *cx, BaselineInspector *inspector, jsbytecode *pc)
|
||||
// instruction's type policy to insert fallible unboxes to the appropriate
|
||||
// input types.
|
||||
|
||||
if (!strictEq) {
|
||||
ICStub::Kind kind = inspector->monomorphicStubKind(pc);
|
||||
|
||||
if (CanUseDoubleCompare(kind)) {
|
||||
compareType_ = Compare_Double;
|
||||
return;
|
||||
}
|
||||
|
||||
ICStub::Kind first, second;
|
||||
if (inspector->dimorphicStubKind(pc, &first, &second)) {
|
||||
if (CanUseDoubleCompare(first) && CanUseDoubleCompare(second)) {
|
||||
compareType_ = Compare_Double;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!strictEq)
|
||||
compareType_ = inspector->expectedCompareType(pc);
|
||||
}
|
||||
|
||||
MBitNot *
|
||||
|
Loading…
Reference in New Issue
Block a user