| Index: runtime/vm/snapshot.cc
|
| diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
|
| index 825cb6b802c6cfaf9dfa3854142ac35992fe7ccd..80c034b01bcc7df2a1808a67bfeaf43679ffa5fd 100644
|
| --- a/runtime/vm/snapshot.cc
|
| +++ b/runtime/vm/snapshot.cc
|
| @@ -28,6 +28,9 @@
|
|
|
| namespace dart {
|
|
|
| +DECLARE_FLAG(bool, use_field_guards);
|
| +
|
| +
|
| static const int kNumVmIsolateSnapshotReferences = 32 * KB;
|
| static const int kNumInitialReferencesInFullSnapshot = 160 * KB;
|
| static const int kNumInitialReferences = 64;
|
| @@ -510,7 +513,8 @@ RawObject* SnapshotReader::ReadInstance(intptr_t object_id,
|
| pobj_ = ReadObjectImpl(read_as_reference);
|
| result->SetFieldAtOffset(offset, pobj_);
|
| if ((offset != type_argument_field_offset) &&
|
| - (kind_ == Snapshot::kMessage)) {
|
| + (kind_ == Snapshot::kMessage) &&
|
| + FLAG_use_field_guards) {
|
| // TODO(fschneider): Consider hoisting these lookups out of the loop.
|
| // This would involve creating a handle, since cls_ can't be reused
|
| // across the call to ReadObjectImpl.
|
|
|