Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 2715213008: VM: Allow configuring use_field_guards on the per-isolate basis and include it into snapshot featur… (Closed)
Patch Set: Done Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/native_entry.h" 5 #include "vm/native_entry.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
9 #include "vm/stub_code.h" 9 #include "vm/stub_code.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 field.set_guarded_cid(reader->Read<int32_t>()); 865 field.set_guarded_cid(reader->Read<int32_t>());
866 field.set_is_nullable(reader->Read<int32_t>()); 866 field.set_is_nullable(reader->Read<int32_t>());
867 field.set_kind_bits(reader->Read<uint8_t>()); 867 field.set_kind_bits(reader->Read<uint8_t>());
868 field.set_kernel_field(NULL); 868 field.set_kernel_field(NULL);
869 869
870 // Set all the object fields. 870 // Set all the object fields.
871 READ_OBJECT_FIELDS(field, field.raw()->from(), field.raw()->to_snapshot(kind), 871 READ_OBJECT_FIELDS(field, field.raw()->from(), field.raw()->to_snapshot(kind),
872 kAsReference); 872 kAsReference);
873 field.StorePointer(&field.raw_ptr()->dependent_code_, Array::null()); 873 field.StorePointer(&field.raw_ptr()->dependent_code_, Array::null());
874 874
875 if (!FLAG_use_field_guards) { 875 if (!reader->isolate()->use_field_guards()) {
876 field.set_guarded_cid(kDynamicCid); 876 field.set_guarded_cid(kDynamicCid);
877 field.set_is_nullable(true); 877 field.set_is_nullable(true);
878 field.set_guarded_list_length(Field::kNoFixedLength); 878 field.set_guarded_list_length(Field::kNoFixedLength);
879 field.set_guarded_list_length_in_object_offset(Field::kUnknownLengthOffset); 879 field.set_guarded_list_length_in_object_offset(Field::kUnknownLengthOffset);
880 } else { 880 } else {
881 field.InitializeGuardedListLengthInObjectOffset(); 881 field.InitializeGuardedListLengthInObjectOffset();
882 } 882 }
883 883
884 return field.raw(); 884 return field.raw();
885 } 885 }
(...skipping 2182 matching lines...) Expand 10 before | Expand all | Expand 10 after
3068 // We do not allow objects with native fields in an isolate message. 3068 // We do not allow objects with native fields in an isolate message.
3069 writer->SetWriteException(Exceptions::kArgument, 3069 writer->SetWriteException(Exceptions::kArgument,
3070 "Illegal argument in isolate message" 3070 "Illegal argument in isolate message"
3071 " : (object is a UserTag)"); 3071 " : (object is a UserTag)");
3072 } else { 3072 } else {
3073 UNREACHABLE(); 3073 UNREACHABLE();
3074 } 3074 }
3075 } 3075 }
3076 3076
3077 } // namespace dart 3077 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698