Commit 1d2ee8fd authored by machenbach's avatar machenbach Committed by Commit bot

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

Revert of [ic] Don't pollute per-map code cache with CompareIC stubs. (patchset #1 id:20001 of https://codereview.chromium.org/2053583002/ )

Reason for revert:
[Sheriff] Speculative revert. Tail call test timing out:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/10014

Original issue's description:
> [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.
>
> Committed: https://crrev.com/172ddf4250e5c4b7510ce352631fb9f8eb291940
> Cr-Commit-Position: refs/heads/master@{#36854}

TBR=verwaest@chromium.org,jkummerow@chromium.org,ishell@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2055793002
Cr-Commit-Position: refs/heads/master@{#36856}
parent a9af61d0
......@@ -373,6 +373,40 @@ 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,9 +2028,8 @@ class CompareICStub : public PlatformCodeStub {
bool strict() const { return op() == Token::EQ_STRICT; }
Condition GetCondition() const;
// 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.
void AddToSpecialCache(Handle<Code> new_object) override;
bool FindCodeInSpecialCache(Code** code_out) override;
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