Skip to content

Commit 0416fd1

Browse files
aamCommit Queue
authored andcommitted
[vm/shared] Allow smis in field table. Tag shared ClassId and Uint8List static instances.
BUG=#61030 TEST=ci Change-Id: I9215b1a98ab1f6ef217e0f5020547724df599878 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445345 Reviewed-by: Slava Egorov <[email protected]>
1 parent 0519deb commit 0416fd1

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

runtime/vm/object.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13434,13 +13434,14 @@ TypePtr Class::GetInstantiationOf(Zone* zone, const Type& type) const {
1343413434
void Field::SetStaticValue(const Object& value) const {
1343513435
auto thread = Thread::Current();
1343613436
ASSERT(thread->IsDartMutatorThread());
13437-
ASSERT(value.IsNull() || value.IsSentinel() || value.IsInstance());
13437+
ASSERT(value.IsNull() || value.IsSentinel() || value.IsInstance() ||
13438+
value.IsSmi());
1343813439

1343913440
ASSERT(is_static()); // Valid only for static dart fields.
1344013441
const intptr_t id = field_id();
1344113442
ASSERT(id >= 0);
1344213443

13443-
if (is_shared() && !value.IsImmutable() &&
13444+
if (is_shared() && !value.IsSmi() && !value.IsImmutable() &&
1344413445
!IsTypedDataBaseClassId(value.GetClassId())) {
1344513446
const String& error = String::Handle(
1344613447
thread->zone(),

sdk/lib/_http/http_impl.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ class _CopyingBytesBuilder implements BytesBuilder {
290290
// Start with 1024 bytes.
291291
static const int _INIT_SIZE = 1024;
292292

293+
@pragma("vm:shared")
293294
static final _emptyList = Uint8List(0);
294295

295296
int _length = 0;

sdk/lib/_internal/vm/lib/convert_patch.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,7 @@ class _JsonStringDecoderSink extends StringConversionSinkBase {
15771577
*/
15781578
class _JsonUtf8Parser extends _JsonParserWithListener
15791579
with _ChunkedJsonParser<Uint8List> {
1580+
@pragma("vm:shared")
15801581
static final Uint8List emptyChunk = Uint8List(0);
15811582

15821583
final _Utf8Decoder decoder;

sdk/lib/_internal/vm_shared/lib/compact_hash.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ mixin _IdenticalAndIdentityHashCode implements _EqualsAndHashCode {
337337
}
338338

339339
mixin _OperatorEqualsAndCanonicalHashCode implements _EqualsAndHashCode {
340+
@pragma('vm:shared')
340341
static final int cidSymbol = ClassID.getID(#a);
341342

342343
int _hashCode(Object? e) {

0 commit comments

Comments
 (0)