Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 749 writer->Write<uint8_t>(ptr()->kind_bits_); | 749 writer->Write<uint8_t>(ptr()->kind_bits_); |
| 750 | 750 |
| 751 // Write out the name. | 751 // Write out the name. |
| 752 writer->WriteObjectImpl(ptr()->name_, kAsReference); | 752 writer->WriteObjectImpl(ptr()->name_, kAsReference); |
| 753 // Write out the owner. | 753 // Write out the owner. |
| 754 writer->WriteObjectImpl(ptr()->owner_, kAsReference); | 754 writer->WriteObjectImpl(ptr()->owner_, kAsReference); |
| 755 // Write out the type. | 755 // Write out the type. |
| 756 writer->WriteObjectImpl(ptr()->type_, kAsReference); | 756 writer->WriteObjectImpl(ptr()->type_, kAsReference); |
| 757 // Write out the initial static value or field offset. | 757 // Write out the initial static value or field offset. |
| 758 if (Field::StaticBit::decode(ptr()->kind_bits_)) { | 758 if (Field::StaticBit::decode(ptr()->kind_bits_)) { |
| 759 // For static field we write out the initial static value. | 759 if (writer->snapshot_code()) { |
| 760 writer->WriteObjectImpl(ptr()->initializer_.saved_value_, kAsReference); | 760 // For precompiled static fields, the value was already reset and |
| 761 // initializer_ now contains a Function. | |
| 762 writer->WriteObjectImpl(ptr()->value_.static_value_, kAsReference); | |
| 763 } else { | |
| 764 // Otherwise, for static fields we write out the initial static value. | |
| 765 writer->WriteObjectImpl(ptr()->initializer_.saved_value_, kAsReference); | |
| 766 } | |
| 761 } else { | 767 } else { |
| 762 writer->WriteObjectImpl(ptr()->value_.offset_, kAsReference); | 768 writer->WriteObjectImpl(ptr()->value_.offset_, kAsReference); |
| 763 } | 769 } |
| 764 // Write out the dependent code. | 770 // Write out the dependent code. |
| 765 writer->WriteObjectImpl(ptr()->dependent_code_, kAsReference); | 771 writer->WriteObjectImpl(ptr()->dependent_code_, kAsReference); |
| 766 // Write out the initializer value. | 772 // Write out the initializer value. |
| 767 writer->WriteObjectImpl(ptr()->initializer_.saved_value_, kAsReference); | 773 writer->WriteObjectImpl(ptr()->initializer_.precompiled_, kAsReference); |
|
siva
2015/09/14 20:32:59
should this also be conditional under
if (writer->
rmacnak
2015/09/15 17:56:42
Done.
| |
| 768 // Write out the guarded list length. | 774 // Write out the guarded list length. |
| 769 writer->WriteObjectImpl(ptr()->guarded_list_length_, kAsReference); | 775 writer->WriteObjectImpl(ptr()->guarded_list_length_, kAsReference); |
| 770 } | 776 } |
| 771 | 777 |
| 772 | 778 |
| 773 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, | 779 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, |
| 774 intptr_t object_id, | 780 intptr_t object_id, |
| 775 intptr_t tags, | 781 intptr_t tags, |
| 776 Snapshot::Kind kind) { | 782 Snapshot::Kind kind) { |
| 777 ASSERT(reader != NULL); | 783 ASSERT(reader != NULL); |
| (...skipping 2486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3264 // We do not allow objects with native fields in an isolate message. | 3270 // We do not allow objects with native fields in an isolate message. |
| 3265 writer->SetWriteException(Exceptions::kArgument, | 3271 writer->SetWriteException(Exceptions::kArgument, |
| 3266 "Illegal argument in isolate message" | 3272 "Illegal argument in isolate message" |
| 3267 " : (object is a UserTag)"); | 3273 " : (object is a UserTag)"); |
| 3268 } else { | 3274 } else { |
| 3269 UNREACHABLE(); | 3275 UNREACHABLE(); |
| 3270 } | 3276 } |
| 3271 } | 3277 } |
| 3272 | 3278 |
| 3273 } // namespace dart | 3279 } // namespace dart |
| OLD | NEW |