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

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

Issue 1289643005: Rename accessors of class Field to make it more apparent as to what is being accessed - static fiel… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-code-review Created 5 years, 3 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
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/object.h" 5 #include "vm/object.h"
6 #include "vm/object_store.h" 6 #include "vm/object_store.h"
7 #include "vm/snapshot.h" 7 #include "vm/snapshot.h"
8 #include "vm/stub_code.h" 8 #include "vm/stub_code.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 // Write out the class and tags information. 806 // Write out the class and tags information.
807 writer->WriteVMIsolateObject(kFieldCid); 807 writer->WriteVMIsolateObject(kFieldCid);
808 writer->WriteTags(writer->GetObjectTags(this)); 808 writer->WriteTags(writer->GetObjectTags(this));
809 809
810 // Write out all the non object fields. 810 // Write out all the non object fields.
811 writer->Write<int32_t>(ptr()->token_pos_); 811 writer->Write<int32_t>(ptr()->token_pos_);
812 writer->Write<int32_t>(ptr()->guarded_cid_); 812 writer->Write<int32_t>(ptr()->guarded_cid_);
813 writer->Write<int32_t>(ptr()->is_nullable_); 813 writer->Write<int32_t>(ptr()->is_nullable_);
814 writer->Write<uint8_t>(ptr()->kind_bits_); 814 writer->Write<uint8_t>(ptr()->kind_bits_);
815 815
816 // Write out all the object pointer fields. 816 // Write out the name.
rmacnak 2015/09/01 16:54:55 WriteObjectImpl doesn't care about the C++ type of
siva 2015/09/03 23:32:10 As discussed offline this is used to ensure that w
817 SnapshotWriterVisitor visitor(writer); 817 writer->WriteObjectImpl(ptr()->name_, kAsReference);
818 visitor.VisitPointers(from(), to()); 818 // Write out the owner.
819 writer->WriteObjectImpl(ptr()->owner_, kAsReference);
820 // Write out the type.
821 writer->WriteObjectImpl(ptr()->type_, kAsReference);
822 // Write out the initial static value or field offset.
823 if (Field::StaticBit::decode(ptr()->kind_bits_)) {
824 writer->WriteObjectImpl(ptr()->initializer_.value_, kAsReference);
rmacnak 2015/09/01 16:54:55 value_.value_
rmacnak 2015/09/01 18:28:51 Okay, nvm. Add a comment in the then branch that w
siva 2015/09/03 23:32:10 Acknowledged.
siva 2015/09/03 23:32:10 initializer_.saved_value_;
825 } else {
826 writer->WriteObjectImpl(ptr()->value_.value_, kAsReference);
827 }
828 // Write out the dependent code.
829 writer->WriteObjectImpl(ptr()->dependent_code_, kAsReference);
830 // Write out the initializer value.
831 writer->WriteObjectImpl(ptr()->initializer_.value_, kAsReference);
832 // Write out the guarded list length.
833 writer->WriteObjectImpl(ptr()->guarded_list_length_, kAsReference);
819 } 834 }
820 835
821 836
822 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, 837 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader,
823 intptr_t object_id, 838 intptr_t object_id,
824 intptr_t tags, 839 intptr_t tags,
825 Snapshot::Kind kind) { 840 Snapshot::Kind kind) {
826 ASSERT(reader != NULL); 841 ASSERT(reader != NULL);
827 ASSERT(kind != Snapshot::kMessage); 842 ASSERT(kind != Snapshot::kMessage);
828 843
(...skipping 2488 matching lines...) Expand 10 before | Expand all | Expand 10 after
3317 // We do not allow objects with native fields in an isolate message. 3332 // We do not allow objects with native fields in an isolate message.
3318 writer->SetWriteException(Exceptions::kArgument, 3333 writer->SetWriteException(Exceptions::kArgument,
3319 "Illegal argument in isolate message" 3334 "Illegal argument in isolate message"
3320 " : (object is a UserTag)"); 3335 " : (object is a UserTag)");
3321 } else { 3336 } else {
3322 UNREACHABLE(); 3337 UNREACHABLE();
3323 } 3338 }
3324 } 3339 }
3325 3340
3326 } // namespace dart 3341 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698