| 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/bigint_operations.h" | 5 #include "vm/bigint_operations.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 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2384 | 2384 |
| 2385 | 2385 |
| 2386 RawTypedData* TypedData::ReadFrom(SnapshotReader* reader, | 2386 RawTypedData* TypedData::ReadFrom(SnapshotReader* reader, |
| 2387 intptr_t object_id, | 2387 intptr_t object_id, |
| 2388 intptr_t tags, | 2388 intptr_t tags, |
| 2389 Snapshot::Kind kind) { | 2389 Snapshot::Kind kind) { |
| 2390 ASSERT(reader != NULL); | 2390 ASSERT(reader != NULL); |
| 2391 | 2391 |
| 2392 intptr_t cid = RawObject::ClassIdTag::decode(tags); | 2392 intptr_t cid = RawObject::ClassIdTag::decode(tags); |
| 2393 intptr_t len = reader->ReadSmiValue(); | 2393 intptr_t len = reader->ReadSmiValue(); |
| 2394 TypedData& result = TypedData::ZoneHandle( | 2394 TypedData& result = TypedData::ZoneHandle(reader->isolate(), |
| 2395 reader->isolate(), TypedData::New(cid, len, HEAP_SPACE(kind))); | 2395 (kind == Snapshot::kFull) ? reader->NewTypedData(cid, len) |
| 2396 : TypedData::New(cid, len, HEAP_SPACE(kind))); |
| 2396 reader->AddBackRef(object_id, &result, kIsDeserialized); | 2397 reader->AddBackRef(object_id, &result, kIsDeserialized); |
| 2397 | 2398 |
| 2398 // Set the object tags. | 2399 // Set the object tags. |
| 2399 result.set_tags(tags); | 2400 result.set_tags(tags); |
| 2400 | 2401 |
| 2401 // Setup the array elements. | 2402 // Setup the array elements. |
| 2402 intptr_t element_size = ElementSizeInBytes(cid); | 2403 intptr_t element_size = ElementSizeInBytes(cid); |
| 2403 intptr_t length_in_bytes = len * element_size; | 2404 intptr_t length_in_bytes = len * element_size; |
| 2404 switch (cid) { | 2405 switch (cid) { |
| 2405 case kTypedDataInt8ArrayCid: | 2406 case kTypedDataInt8ArrayCid: |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2870 // We do not allow objects with native fields in an isolate message. | 2871 // We do not allow objects with native fields in an isolate message. |
| 2871 writer->SetWriteException(Exceptions::kArgument, | 2872 writer->SetWriteException(Exceptions::kArgument, |
| 2872 "Illegal argument in isolate message" | 2873 "Illegal argument in isolate message" |
| 2873 " : (object is a UserTag)"); | 2874 " : (object is a UserTag)"); |
| 2874 } else { | 2875 } else { |
| 2875 UNREACHABLE(); | 2876 UNREACHABLE(); |
| 2876 } | 2877 } |
| 2877 } | 2878 } |
| 2878 | 2879 |
| 2879 } // namespace dart | 2880 } // namespace dart |
| OLD | NEW |