[vm] Account for pool entries that are immediate objects.

Cf. 4c82eb5836

TEST=gallery
Bug: https://github.com/flutter/gallery/issues/545
Change-Id: I90935aba3737f7b6873368e5a8ebf1cc48d34a22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250320
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
Ryan Macnak 2022-06-30 20:32:44 +00:00 committed by Commit Bot
parent 90da09e2db
commit 7004b1859f

View file

@ -1988,14 +1988,12 @@ class CodeSerializationCluster : public SerializationCluster {
// indirectly by passing the field to the runtime. A const closure
// is a call target because its function may be called indirectly
// via a closure call.
if (!only_call_targets || target->IsCode() || target->IsFunction() ||
target->IsField() || target->IsClosure()) {
intptr_t cid = target->GetClassIdMayBeSmi();
if (!only_call_targets || (cid == kCodeCid) || (cid == kFunctionCid) ||
(cid == kFieldCid) || (cid == kClosureCid)) {
s->Push(target);
} else {
intptr_t cid = target->GetClassIdMayBeSmi();
if (cid >= kNumPredefinedCids) {
s->Push(s->isolate_group()->class_table()->At(cid));
}
} else if (cid >= kNumPredefinedCids) {
s->Push(s->isolate_group()->class_table()->At(cid));
}
}
}