Commit 172ddf42 authored by ishell's avatar ishell Committed by Commit bot

[ic] Don't pollute per-map code cache with CompareIC stubs.

Given that
1) because of code flags mismatch we are not able to fetch any CompareIC stub that was put into the cache (we put MONOMORPHIC stubs but query only UNINITIALIZED ones),
2) it was already broken for a couple of years,
3) we will not need to cache any stub once CompareIC becomes vector-based.

Review-Url: https://codereview.chromium.org/2053583002
Cr-Commit-Position: refs/heads/master@{#36854}
parent cd98c2c3
......@@ -373,40 +373,6 @@ Condition CompareICStub::GetCondition() const {
}
void CompareICStub::AddToSpecialCache(Handle<Code> new_object) {
DCHECK(*known_map_ != NULL);
Isolate* isolate = new_object->GetIsolate();
Factory* factory = isolate->factory();
return Map::UpdateCodeCache(known_map_,
strict() ?
factory->strict_compare_ic_string() :
factory->compare_ic_string(),
new_object);
}
bool CompareICStub::FindCodeInSpecialCache(Code** code_out) {
Code::Flags flags = Code::ComputeFlags(
GetCodeKind(),
UNINITIALIZED);
Name* name = strict() ? isolate()->heap()->strict_compare_ic_string()
: isolate()->heap()->compare_ic_string();
Code* code = known_map_->LookupInCodeCache(name, flags);
if (code != nullptr) {
*code_out = code;
#ifdef DEBUG
CompareICStub decode((*code_out)->stub_key(), isolate());
DCHECK(op() == decode.op());
DCHECK(left() == decode.left());
DCHECK(right() == decode.right());
DCHECK(state() == decode.state());
#endif
return true;
}
return false;
}
void CompareICStub::Generate(MacroAssembler* masm) {
switch (state()) {
case CompareICState::UNINITIALIZED:
......
......@@ -2028,8 +2028,9 @@ class CompareICStub : public PlatformCodeStub {
bool strict() const { return op() == Token::EQ_STRICT; }
Condition GetCondition() const;
void AddToSpecialCache(Handle<Code> new_object) override;
bool FindCodeInSpecialCache(Code** code_out) override;
// Although we don't cache anything in the special cache we have to define
// this predicate to avoid appearance of code stubs with embedded maps in
// the global stub cache.
bool UseSpecialCache() override {
return state() == CompareICState::KNOWN_RECEIVER;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment