Commit dd6233ab authored by Igor Sheludko's avatar Igor Sheludko Committed by V8 LUCI CQ

[ext-code-space] Use Object::SafeEquals() in DescriptorLookupCache

... which works for stale pointers. The default == operator contains
a DCHECK guarding against Code vs. non-Code object comparisons and
thus it can't be used for stale pointer.

Bug: v8:13252, v8:11880
Change-Id: Iaf80d7d1039515fee0d4d294f1fc4c6689cd8d5c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3867734
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82896}
parent a7a0c7b5
......@@ -24,7 +24,10 @@ int DescriptorLookupCache::Hash(Map source, Name name) {
int DescriptorLookupCache::Lookup(Map source, Name name) {
int index = Hash(source, name);
Key& key = keys_[index];
if ((key.source == source) && (key.name == name)) return results_[index];
// Pointers in the table might be stale, so use SafeEquals.
if (key.source.SafeEquals(source) && key.name.SafeEquals(name)) {
return results_[index];
}
return kAbsent;
}
......
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