mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1019983 - Don't optimize compare based on baseline caches when more types are seen than present in the cache, r=jandem
This commit is contained in:
parent
4ffc41a6b9
commit
59a8c1f0c5
@ -1969,6 +1969,8 @@ DoCompareFallback(JSContext *cx, BaselineFrame *frame, ICCompare_Fallback *stub_
|
||||
}
|
||||
}
|
||||
|
||||
stub->noteUnoptimizableAccess();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1966,6 +1966,14 @@ class ICCompare_Fallback : public ICFallbackStub
|
||||
return space->allocate<ICCompare_Fallback>(code);
|
||||
}
|
||||
|
||||
static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0;
|
||||
void noteUnoptimizableAccess() {
|
||||
extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT);
|
||||
}
|
||||
bool hadUnoptimizableAccess() const {
|
||||
return extra_ & (1u << UNOPTIMIZABLE_ACCESS_BIT);
|
||||
}
|
||||
|
||||
// Compiler for this stub kind.
|
||||
class Compiler : public ICStubCompiler {
|
||||
protected:
|
||||
|
@ -226,6 +226,12 @@ BaselineInspector::expectedCompareType(jsbytecode *pc)
|
||||
if (!first && !dimorphicStub(pc, &first, &second))
|
||||
return MCompare::Compare_Unknown;
|
||||
|
||||
if (ICStub *fallback = second ? second->next() : first->next()) {
|
||||
JS_ASSERT(fallback->isFallback());
|
||||
if (fallback->toCompare_Fallback()->hadUnoptimizableAccess())
|
||||
return MCompare::Compare_Unknown;
|
||||
}
|
||||
|
||||
if (CanUseInt32Compare(first->kind()) && (!second || CanUseInt32Compare(second->kind()))) {
|
||||
ICCompare_Int32WithBoolean *coerce =
|
||||
first->isCompare_Int32WithBoolean()
|
||||
|
Loading…
Reference in New Issue
Block a user