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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 bool as_reference) { | 577 bool as_reference) { |
578 ASSERT(reader != NULL); | 578 ASSERT(reader != NULL); |
579 ASSERT(kind == Snapshot::kScript); | 579 ASSERT(kind == Snapshot::kScript); |
580 | 580 |
581 // Allocate closure data object. | 581 // Allocate closure data object. |
582 ClosureData& data = | 582 ClosureData& data = |
583 ClosureData::ZoneHandle(reader->zone(), ClosureData::New()); | 583 ClosureData::ZoneHandle(reader->zone(), ClosureData::New()); |
584 reader->AddBackRef(object_id, &data, kIsDeserialized); | 584 reader->AddBackRef(object_id, &data, kIsDeserialized); |
585 | 585 |
586 // Set all the object fields. | 586 // Set all the object fields. |
587 // Cached hash is null-initialized by ClosureData::New() | |
588 READ_OBJECT_FIELDS(data, data.raw()->from(), data.raw()->to_snapshot(), | 587 READ_OBJECT_FIELDS(data, data.raw()->from(), data.raw()->to_snapshot(), |
589 kAsInlinedObject); | 588 kAsInlinedObject); |
590 | 589 |
591 return data.raw(); | 590 return data.raw(); |
592 } | 591 } |
593 | 592 |
594 void RawClosureData::WriteTo(SnapshotWriter* writer, | 593 void RawClosureData::WriteTo(SnapshotWriter* writer, |
595 intptr_t object_id, | 594 intptr_t object_id, |
596 Snapshot::Kind kind, | 595 Snapshot::Kind kind, |
597 bool as_reference) { | 596 bool as_reference) { |
(...skipping 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2920 // We do not allow objects with native fields in an isolate message. | 2919 // We do not allow objects with native fields in an isolate message. |
2921 writer->SetWriteException(Exceptions::kArgument, | 2920 writer->SetWriteException(Exceptions::kArgument, |
2922 "Illegal argument in isolate message" | 2921 "Illegal argument in isolate message" |
2923 " : (object is a UserTag)"); | 2922 " : (object is a UserTag)"); |
2924 } else { | 2923 } else { |
2925 UNREACHABLE(); | 2924 UNREACHABLE(); |
2926 } | 2925 } |
2927 } | 2926 } |
2928 | 2927 |
2929 } // namespace dart | 2928 } // namespace dart |
OLD | NEW |