2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- #include < memory>
6
-
7
5
#include " vm/clustered_snapshot.h"
8
6
9
7
#include " platform/assert.h"
@@ -233,8 +231,7 @@ class ClassSerializationCluster : public SerializationCluster {
233
231
UnboxedFieldBitmap CalculateTargetUnboxedFieldsBitmap (Serializer* s,
234
232
intptr_t class_id) {
235
233
const auto unboxed_fields_bitmap_host =
236
- s->isolate ()->group ()->shared_class_table ()->GetUnboxedFieldsMapAt (
237
- class_id);
234
+ s->isolate ()->group ()->class_table ()->GetUnboxedFieldsMapAt (class_id);
238
235
239
236
UnboxedFieldBitmap unboxed_fields_bitmap;
240
237
if (unboxed_fields_bitmap_host.IsEmpty () ||
@@ -352,7 +349,7 @@ class ClassDeserializationCluster : public DeserializationCluster {
352
349
}
353
350
}
354
351
355
- auto shared_class_table = d->isolate ()->group ()->shared_class_table ();
352
+ auto shared_class_table = d->isolate ()->group ()->class_table ();
356
353
for (intptr_t id = start_index_; id < stop_index_; id++) {
357
354
RawClass* cls = reinterpret_cast <RawClass*>(d->Ref (id));
358
355
Deserializer::InitializeHeader (cls, kClassCid , Class::InstanceSize ());
@@ -1204,10 +1201,6 @@ class FieldDeserializationCluster : public DeserializationCluster {
1204
1201
field.InitializeGuardedListLengthInObjectOffset ();
1205
1202
}
1206
1203
}
1207
-
1208
- Isolate* isolate = Isolate::Current ();
1209
- isolate->set_saved_initial_field_table (
1210
- std::shared_ptr<FieldTable>(isolate->field_table ()->Clone ()));
1211
1204
}
1212
1205
};
1213
1206
@@ -3029,8 +3022,7 @@ class InstanceSerializationCluster : public SerializationCluster {
3029
3022
const intptr_t next_field_offset = host_next_field_offset_in_words_
3030
3023
<< kWordSizeLog2 ;
3031
3024
const auto unboxed_fields_bitmap =
3032
- s->isolate ()->group ()->shared_class_table ()->GetUnboxedFieldsMapAt (
3033
- cid_);
3025
+ s->isolate ()->group ()->class_table ()->GetUnboxedFieldsMapAt (cid_);
3034
3026
intptr_t offset = Instance::NextFieldOffset ();
3035
3027
while (offset < next_field_offset) {
3036
3028
// Skips unboxed fields
@@ -3066,8 +3058,7 @@ class InstanceSerializationCluster : public SerializationCluster {
3066
3058
<< kWordSizeLog2 ;
3067
3059
const intptr_t count = objects_.length ();
3068
3060
const auto unboxed_fields_bitmap =
3069
- s->isolate ()->group ()->shared_class_table ()->GetUnboxedFieldsMapAt (
3070
- cid_);
3061
+ s->isolate ()->group ()->class_table ()->GetUnboxedFieldsMapAt (cid_);
3071
3062
for (intptr_t i = 0 ; i < count; i++) {
3072
3063
RawInstance* instance = objects_[i];
3073
3064
AutoTraceObject (instance);
@@ -3125,8 +3116,7 @@ class InstanceDeserializationCluster : public DeserializationCluster {
3125
3116
Object::RoundedAllocationSize (instance_size_in_words_ * kWordSize );
3126
3117
3127
3118
const auto unboxed_fields_bitmap =
3128
- d->isolate ()->group ()->shared_class_table ()->GetUnboxedFieldsMapAt (
3129
- cid_);
3119
+ d->isolate ()->group ()->class_table ()->GetUnboxedFieldsMapAt (cid_);
3130
3120
for (intptr_t id = start_index_; id < stop_index_; id++) {
3131
3121
RawInstance* instance = reinterpret_cast <RawInstance*>(d->Ref (id));
3132
3122
bool is_canonical = d->Read <bool >();
@@ -5531,7 +5521,7 @@ static const char* kObjectStoreFieldNames[] = {
5531
5521
#undef DECLARE_OBJECT_STORE_FIELD
5532
5522
};
5533
5523
5534
- void Serializer::WriteProgramSnapshot (intptr_t num_base_objects,
5524
+ void Serializer::WriteIsolateSnapshot (intptr_t num_base_objects,
5535
5525
ObjectStore* object_store) {
5536
5526
NoSafepointScope no_safepoint;
5537
5527
@@ -5542,7 +5532,7 @@ void Serializer::WriteProgramSnapshot(intptr_t num_base_objects,
5542
5532
AddBaseObject (base_objects.At (i));
5543
5533
}
5544
5534
} else {
5545
- // Base objects carried over from WriteVMSnapshot .
5535
+ // Base objects carried over from WriteVMIsolateSnapshot .
5546
5536
num_base_objects_ += num_base_objects;
5547
5537
next_ref_index_ += num_base_objects;
5548
5538
}
@@ -5823,7 +5813,7 @@ void Deserializer::ReadDispatchTable() {
5823
5813
}
5824
5814
ASSERT (repeat_count == 0 );
5825
5815
5826
- I->group ()-> set_dispatch_table (table);
5816
+ I->set_dispatch_table (table);
5827
5817
#endif
5828
5818
}
5829
5819
@@ -6206,7 +6196,7 @@ void Deserializer::ReadVMSnapshot() {
6206
6196
}
6207
6197
}
6208
6198
6209
- void Deserializer::ReadProgramSnapshot (ObjectStore* object_store) {
6199
+ void Deserializer::ReadIsolateSnapshot (ObjectStore* object_store) {
6210
6200
Array& refs = Array::Handle ();
6211
6201
Prepare ();
6212
6202
@@ -6244,21 +6234,22 @@ void Deserializer::ReadProgramSnapshot(ObjectStore* object_store) {
6244
6234
thread ()->isolate ()->class_table ()->CopySizesFromClassObjects ();
6245
6235
heap_->old_space ()->EvaluateAfterLoading ();
6246
6236
6247
- Isolate* isolate = thread ()->isolate ();
6248
6237
#if defined(DEBUG)
6238
+ Isolate* isolate = thread ()->isolate ();
6249
6239
isolate->ValidateClassTable ();
6250
6240
isolate->heap ()->Verify ();
6251
6241
#endif
6252
6242
6253
6243
for (intptr_t i = 0 ; i < num_clusters_; i++) {
6254
6244
clusters_[i]->PostLoad (refs, kind_, zone_);
6255
6245
}
6256
- isolate-> isolate_object_store ()-> PreallocateObjects ();
6246
+ object_store-> PostLoad ();
6257
6247
6258
6248
// Setup native resolver for bootstrap impl.
6259
6249
Bootstrap::SetupNativeResolver ();
6260
6250
}
6261
6251
6252
+
6262
6253
#if !defined(DART_PRECOMPILED_RUNTIME)
6263
6254
FullSnapshotWriter::FullSnapshotWriter (Snapshot::Kind kind,
6264
6255
uint8_t ** vm_snapshot_data_buffer,
@@ -6333,8 +6324,8 @@ intptr_t FullSnapshotWriter::WriteVMSnapshot() {
6333
6324
return num_objects;
6334
6325
}
6335
6326
6336
- void FullSnapshotWriter::WriteProgramSnapshot (intptr_t num_base_objects) {
6337
- TIMELINE_DURATION (thread (), Isolate, " WriteProgramSnapshot " );
6327
+ void FullSnapshotWriter::WriteIsolateSnapshot (intptr_t num_base_objects) {
6328
+ TIMELINE_DURATION (thread (), Isolate, " WriteIsolateSnapshot " );
6338
6329
6339
6330
Serializer serializer (thread (), kind_, isolate_snapshot_data_buffer_, alloc_,
6340
6331
kInitialSize , isolate_image_writer_, /* vm=*/ false ,
@@ -6353,7 +6344,7 @@ void FullSnapshotWriter::WriteProgramSnapshot(intptr_t num_base_objects) {
6353
6344
serializer.WriteVersionAndFeatures (false );
6354
6345
// Isolate snapshot roots are:
6355
6346
// - the object store
6356
- serializer.WriteProgramSnapshot (num_base_objects, object_store);
6347
+ serializer.WriteIsolateSnapshot (num_base_objects, object_store);
6357
6348
serializer.FillHeader (serializer.kind ());
6358
6349
clustered_isolate_size_ = serializer.bytes_written ();
6359
6350
@@ -6384,7 +6375,7 @@ void FullSnapshotWriter::WriteFullSnapshot() {
6384
6375
}
6385
6376
6386
6377
if (isolate_snapshot_data_buffer () != NULL ) {
6387
- WriteProgramSnapshot (num_base_objects);
6378
+ WriteIsolateSnapshot (num_base_objects);
6388
6379
}
6389
6380
6390
6381
if (FLAG_print_snapshot_sizes) {
@@ -6547,7 +6538,7 @@ RawApiError* FullSnapshotReader::ReadVMSnapshot() {
6547
6538
return ApiError::null ();
6548
6539
}
6549
6540
6550
- RawApiError* FullSnapshotReader::ReadProgramSnapshot () {
6541
+ RawApiError* FullSnapshotReader::ReadIsolateSnapshot () {
6551
6542
SnapshotHeaderReader header_reader (kind_, buffer_, size_);
6552
6543
intptr_t offset = 0 ;
6553
6544
char * error =
@@ -6573,7 +6564,7 @@ RawApiError* FullSnapshotReader::ReadProgramSnapshot() {
6573
6564
}
6574
6565
6575
6566
auto object_store = thread_->isolate ()->object_store ();
6576
- deserializer.ReadProgramSnapshot (object_store);
6567
+ deserializer.ReadIsolateSnapshot (object_store);
6577
6568
6578
6569
#if defined(DART_PRECOMPILED_RUNTIME)
6579
6570
if (FLAG_use_bare_instructions) {
0 commit comments