Skip to content

Commit 93c5134

Browse files
liamappelbecommit-bot@chromium.org
authored andcommitted
[vm] Add nullability variations for snapshot singletons
This fixes snapshot_test.cc in legacy mode. Bug: #40169 Change-Id: Ibb47634be296b3b9159af9fe0500d64f9d279b60 Fixes: #40169 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133148 Commit-Queue: Liam Appelbe <[email protected]> Reviewed-by: Alexander Markov <[email protected]> Reviewed-by: Siva Annamalai <[email protected]>
1 parent 44dff4e commit 93c5134

File tree

6 files changed

+336
-125
lines changed

6 files changed

+336
-125
lines changed

runtime/vm/compiler/runtime_offsets_extracted.h

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ static constexpr dart::compiler::target::word NativeArguments_retval_offset =
164164
12;
165165
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
166166
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
167-
64;
168-
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 32;
167+
112;
168+
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 56;
169169
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
170-
80;
170+
136;
171171
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
172172
static constexpr dart::compiler::target::word Pointer_c_memory_address_offset =
173173
8;
@@ -541,10 +541,10 @@ static constexpr dart::compiler::target::word NativeArguments_retval_offset =
541541
24;
542542
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
543543
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
544-
128;
545-
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 64;
544+
224;
545+
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 112;
546546
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
547-
160;
547+
272;
548548
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
549549
static constexpr dart::compiler::target::word Pointer_c_memory_address_offset =
550550
16;
@@ -918,10 +918,10 @@ static constexpr dart::compiler::target::word NativeArguments_retval_offset =
918918
12;
919919
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
920920
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
921-
64;
922-
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 32;
921+
112;
922+
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 56;
923923
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
924-
80;
924+
136;
925925
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
926926
static constexpr dart::compiler::target::word Pointer_c_memory_address_offset =
927927
8;
@@ -1291,10 +1291,10 @@ static constexpr dart::compiler::target::word NativeArguments_retval_offset =
12911291
24;
12921292
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
12931293
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
1294-
128;
1295-
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 64;
1294+
224;
1295+
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 112;
12961296
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
1297-
160;
1297+
272;
12981298
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
12991299
static constexpr dart::compiler::target::word Pointer_c_memory_address_offset =
13001300
16;
@@ -1668,10 +1668,10 @@ static constexpr dart::compiler::target::word NativeArguments_retval_offset =
16681668
12;
16691669
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
16701670
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
1671-
64;
1672-
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 32;
1671+
112;
1672+
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 56;
16731673
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
1674-
80;
1674+
136;
16751675
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
16761676
static constexpr dart::compiler::target::word Pointer_c_memory_address_offset =
16771677
8;
@@ -2039,10 +2039,10 @@ static constexpr dart::compiler::target::word NativeArguments_retval_offset =
20392039
24;
20402040
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
20412041
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
2042-
128;
2043-
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 64;
2042+
224;
2043+
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 112;
20442044
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
2045-
160;
2045+
272;
20462046
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
20472047
static constexpr dart::compiler::target::word Pointer_c_memory_address_offset =
20482048
16;
@@ -2410,10 +2410,10 @@ static constexpr dart::compiler::target::word NativeArguments_retval_offset =
24102410
12;
24112411
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
24122412
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
2413-
64;
2414-
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 32;
2413+
112;
2414+
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 56;
24152415
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
2416-
80;
2416+
136;
24172417
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
24182418
static constexpr dart::compiler::target::word Pointer_c_memory_address_offset =
24192419
8;
@@ -2777,10 +2777,10 @@ static constexpr dart::compiler::target::word NativeArguments_retval_offset =
27772777
24;
27782778
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
27792779
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
2780-
128;
2781-
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 64;
2780+
224;
2781+
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 112;
27822782
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
2783-
160;
2783+
272;
27842784
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
27852785
static constexpr dart::compiler::target::word Pointer_c_memory_address_offset =
27862786
16;
@@ -3162,11 +3162,11 @@ static constexpr dart::compiler::target::word
31623162
static constexpr dart::compiler::target::word
31633163
AOT_NativeArguments_thread_offset = 0;
31643164
static constexpr dart::compiler::target::word
3165-
AOT_ObjectStore_double_type_offset = 64;
3165+
AOT_ObjectStore_double_type_offset = 112;
31663166
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
3167-
32;
3167+
56;
31683168
static constexpr dart::compiler::target::word
3169-
AOT_ObjectStore_string_type_offset = 80;
3169+
AOT_ObjectStore_string_type_offset = 136;
31703170
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
31713171
12;
31723172
static constexpr dart::compiler::target::word
@@ -3564,11 +3564,11 @@ static constexpr dart::compiler::target::word
35643564
static constexpr dart::compiler::target::word
35653565
AOT_NativeArguments_thread_offset = 0;
35663566
static constexpr dart::compiler::target::word
3567-
AOT_ObjectStore_double_type_offset = 128;
3567+
AOT_ObjectStore_double_type_offset = 224;
35683568
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
3569-
64;
3569+
112;
35703570
static constexpr dart::compiler::target::word
3571-
AOT_ObjectStore_string_type_offset = 160;
3571+
AOT_ObjectStore_string_type_offset = 272;
35723572
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
35733573
16;
35743574
static constexpr dart::compiler::target::word
@@ -3970,11 +3970,11 @@ static constexpr dart::compiler::target::word
39703970
static constexpr dart::compiler::target::word
39713971
AOT_NativeArguments_thread_offset = 0;
39723972
static constexpr dart::compiler::target::word
3973-
AOT_ObjectStore_double_type_offset = 128;
3973+
AOT_ObjectStore_double_type_offset = 224;
39743974
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
3975-
64;
3975+
112;
39763976
static constexpr dart::compiler::target::word
3977-
AOT_ObjectStore_string_type_offset = 160;
3977+
AOT_ObjectStore_string_type_offset = 272;
39783978
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
39793979
16;
39803980
static constexpr dart::compiler::target::word
@@ -4372,11 +4372,11 @@ static constexpr dart::compiler::target::word
43724372
static constexpr dart::compiler::target::word
43734373
AOT_NativeArguments_thread_offset = 0;
43744374
static constexpr dart::compiler::target::word
4375-
AOT_ObjectStore_double_type_offset = 64;
4375+
AOT_ObjectStore_double_type_offset = 112;
43764376
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
4377-
32;
4377+
56;
43784378
static constexpr dart::compiler::target::word
4379-
AOT_ObjectStore_string_type_offset = 80;
4379+
AOT_ObjectStore_string_type_offset = 136;
43804380
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
43814381
12;
43824382
static constexpr dart::compiler::target::word
@@ -4767,11 +4767,11 @@ static constexpr dart::compiler::target::word
47674767
static constexpr dart::compiler::target::word
47684768
AOT_NativeArguments_thread_offset = 0;
47694769
static constexpr dart::compiler::target::word
4770-
AOT_ObjectStore_double_type_offset = 128;
4770+
AOT_ObjectStore_double_type_offset = 224;
47714771
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
4772-
64;
4772+
112;
47734773
static constexpr dart::compiler::target::word
4774-
AOT_ObjectStore_string_type_offset = 160;
4774+
AOT_ObjectStore_string_type_offset = 272;
47754775
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
47764776
16;
47774777
static constexpr dart::compiler::target::word
@@ -5166,11 +5166,11 @@ static constexpr dart::compiler::target::word
51665166
static constexpr dart::compiler::target::word
51675167
AOT_NativeArguments_thread_offset = 0;
51685168
static constexpr dart::compiler::target::word
5169-
AOT_ObjectStore_double_type_offset = 128;
5169+
AOT_ObjectStore_double_type_offset = 224;
51705170
static constexpr dart::compiler::target::word AOT_ObjectStore_int_type_offset =
5171-
64;
5171+
112;
51725172
static constexpr dart::compiler::target::word
5173-
AOT_ObjectStore_string_type_offset = 160;
5173+
AOT_ObjectStore_string_type_offset = 272;
51745174
static constexpr dart::compiler::target::word AOT_OneByteString_data_offset =
51755175
16;
51765176
static constexpr dart::compiler::target::word

runtime/vm/dart_api_message.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -694,16 +694,12 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
694694
}
695695

696696
Dart_CObject* ApiMessageReader::ReadIndexedObject(intptr_t object_id) {
697-
if (object_id == kDynamicType || object_id == kDoubleType ||
698-
object_id == kIntType || object_id == kBoolType ||
699-
object_id == kStringType || object_id == kObjectType) {
697+
if (object_id >= kFirstTypeSnapshotId && object_id <= kLastTypeSnapshotId) {
700698
// Always return dynamic type (this is only a marker).
701699
return &dynamic_type_marker;
702700
}
703-
if (object_id == kIntTypeArguments || object_id == kDoubleTypeArguments ||
704-
object_id == kStringTypeArguments ||
705-
object_id == kStringDynamicTypeArguments ||
706-
object_id == kStringStringTypeArguments) {
701+
if (object_id >= kFirstTypeArgumentsSnapshotId &&
702+
object_id <= kLastTypeArgumentsSnapshotId) {
707703
return &type_arguments_marker;
708704
}
709705

0 commit comments

Comments
 (0)