| 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/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 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1823 intptr_t tags, | 1823 intptr_t tags, |
| 1824 Snapshot::Kind kind) { | 1824 Snapshot::Kind kind) { |
| 1825 ASSERT(reader != NULL); | 1825 ASSERT(reader != NULL); |
| 1826 | 1826 |
| 1827 // Read the 64 bit value for the object. | 1827 // Read the 64 bit value for the object. |
| 1828 int64_t value = reader->Read<int64_t>(); | 1828 int64_t value = reader->Read<int64_t>(); |
| 1829 | 1829 |
| 1830 // Check if the value could potentially fit in a Smi in our current | 1830 // Check if the value could potentially fit in a Smi in our current |
| 1831 // architecture, if so return the object as a Smi. | 1831 // architecture, if so return the object as a Smi. |
| 1832 if (Smi::IsValid(value)) { | 1832 if (Smi::IsValid(value)) { |
| 1833 return Smi::New(static_cast<intptr_t>(value)); | 1833 Smi& smi = Smi::ZoneHandle(reader->zone(), |
| 1834 Smi::New(static_cast<intptr_t>(value))); |
| 1835 reader->AddBackRef(object_id, &smi, kIsDeserialized); |
| 1836 return smi.raw(); |
| 1834 } | 1837 } |
| 1835 | 1838 |
| 1836 // Create a Mint object or get canonical one if it is a canonical constant. | 1839 // Create a Mint object or get canonical one if it is a canonical constant. |
| 1837 Mint& mint = Mint::ZoneHandle(reader->zone(), Mint::null()); | 1840 Mint& mint = Mint::ZoneHandle(reader->zone(), Mint::null()); |
| 1838 if (kind == Snapshot::kFull) { | 1841 if (kind == Snapshot::kFull) { |
| 1839 mint = reader->NewMint(value); | 1842 mint = reader->NewMint(value); |
| 1840 // Set the object tags. | 1843 // Set the object tags. |
| 1841 mint.set_tags(tags); | 1844 mint.set_tags(tags); |
| 1842 } else { | 1845 } else { |
| 1843 // When reading a script snapshot we need to canonicalize only those object | 1846 // When reading a script snapshot we need to canonicalize only those object |
| (...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3094 // We do not allow objects with native fields in an isolate message. | 3097 // We do not allow objects with native fields in an isolate message. |
| 3095 writer->SetWriteException(Exceptions::kArgument, | 3098 writer->SetWriteException(Exceptions::kArgument, |
| 3096 "Illegal argument in isolate message" | 3099 "Illegal argument in isolate message" |
| 3097 " : (object is a UserTag)"); | 3100 " : (object is a UserTag)"); |
| 3098 } else { | 3101 } else { |
| 3099 UNREACHABLE(); | 3102 UNREACHABLE(); |
| 3100 } | 3103 } |
| 3101 } | 3104 } |
| 3102 | 3105 |
| 3103 } // namespace dart | 3106 } // namespace dart |
| OLD | NEW |