mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00: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
3ed82e176d
commit
5c0dfa45d4
@ -1969,6 +1969,8 @@ DoCompareFallback(JSContext *cx, BaselineFrame *frame, ICCompare_Fallback *stub_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stub->noteUnoptimizableAccess();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1966,6 +1966,14 @@ class ICCompare_Fallback : public ICFallbackStub
|
|||||||
return space->allocate<ICCompare_Fallback>(code);
|
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.
|
// Compiler for this stub kind.
|
||||||
class Compiler : public ICStubCompiler {
|
class Compiler : public ICStubCompiler {
|
||||||
protected:
|
protected:
|
||||||
|
@ -226,6 +226,12 @@ BaselineInspector::expectedCompareType(jsbytecode *pc)
|
|||||||
if (!first && !dimorphicStub(pc, &first, &second))
|
if (!first && !dimorphicStub(pc, &first, &second))
|
||||||
return MCompare::Compare_Unknown;
|
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()))) {
|
if (CanUseInt32Compare(first->kind()) && (!second || CanUseInt32Compare(second->kind()))) {
|
||||||
ICCompare_Int32WithBoolean *coerce =
|
ICCompare_Int32WithBoolean *coerce =
|
||||||
first->isCompare_Int32WithBoolean()
|
first->isCompare_Int32WithBoolean()
|
||||||
|
Loading…
Reference in New Issue
Block a user