[vm] Handle entry point object pool entries only in AOT

Avoid touching stubs in JIT mode when reading object pool
as stubs may not be initialized yet. This may happen if
using a core-jit snapshot.

TEST=ci

Change-Id: I598ef2ca4b6b22fb1bb560ad25b6ada9939799a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216924
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Alexander Markov 2021-10-14 21:39:05 +00:00 committed by commit-bot@chromium.org
parent ff26406d72
commit bb06e649f4

View file

@ -2381,6 +2381,7 @@ class ObjectPoolDeserializationCluster : public DeserializationCluster {
void ReadFill(Deserializer* d, bool primary) { void ReadFill(Deserializer* d, bool primary) {
ASSERT(!is_canonical()); // Never canonical. ASSERT(!is_canonical()); // Never canonical.
fill_position_ = d->position(); fill_position_ = d->position();
#if defined(DART_PRECOMPILED_RUNTIME)
const uint8_t immediate_bits = const uint8_t immediate_bits =
ObjectPool::EncodeBits(ObjectPool::EntryType::kImmediate, ObjectPool::EncodeBits(ObjectPool::EntryType::kImmediate,
ObjectPool::Patchability::kPatchable); ObjectPool::Patchability::kPatchable);
@ -2392,6 +2393,7 @@ class ObjectPoolDeserializationCluster : public DeserializationCluster {
megamorphic_call_entry_point = megamorphic_call_entry_point =
StubCode::MegamorphicCall().MonomorphicEntryPoint(); StubCode::MegamorphicCall().MonomorphicEntryPoint();
} }
#endif // defined(DART_PRECOMPILED_RUNTIME)
for (intptr_t id = start_index_; id < stop_index_; id++) { for (intptr_t id = start_index_; id < stop_index_; id++) {
const intptr_t length = d->ReadUnsigned(); const intptr_t length = d->ReadUnsigned();
@ -2416,6 +2418,7 @@ class ObjectPoolDeserializationCluster : public DeserializationCluster {
entry.raw_value_ = static_cast<intptr_t>(new_entry); entry.raw_value_ = static_cast<intptr_t>(new_entry);
break; break;
} }
#if defined(DART_PRECOMPILED_RUNTIME)
case ObjectPool::EntryType::kSwitchableCallMissEntryPoint: case ObjectPool::EntryType::kSwitchableCallMissEntryPoint:
ASSERT(FLAG_use_bare_instructions); ASSERT(FLAG_use_bare_instructions);
pool->untag()->entry_bits()[j] = immediate_bits; pool->untag()->entry_bits()[j] = immediate_bits;
@ -2428,6 +2431,7 @@ class ObjectPoolDeserializationCluster : public DeserializationCluster {
entry.raw_value_ = entry.raw_value_ =
static_cast<intptr_t>(megamorphic_call_entry_point); static_cast<intptr_t>(megamorphic_call_entry_point);
break; break;
#endif // defined(DART_PRECOMPILED_RUNTIME)
default: default:
UNREACHABLE(); UNREACHABLE();
} }