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 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2374 #undef TYPED_DATA_READ | 2374 #undef TYPED_DATA_READ |
2375 | 2375 |
2376 | 2376 |
2377 RawExternalTypedData* ExternalTypedData::ReadFrom(SnapshotReader* reader, | 2377 RawExternalTypedData* ExternalTypedData::ReadFrom(SnapshotReader* reader, |
2378 intptr_t object_id, | 2378 intptr_t object_id, |
2379 intptr_t tags, | 2379 intptr_t tags, |
2380 Snapshot::Kind kind) { | 2380 Snapshot::Kind kind) { |
2381 ASSERT(kind != Snapshot::kFull); | 2381 ASSERT(kind != Snapshot::kFull); |
2382 intptr_t cid = RawObject::ClassIdTag::decode(tags); | 2382 intptr_t cid = RawObject::ClassIdTag::decode(tags); |
2383 intptr_t length = reader->ReadSmiValue(); | 2383 intptr_t length = reader->ReadSmiValue(); |
2384 uint8_t* data = reinterpret_cast<uint8_t*>(reader->ReadIntptrValue()); | 2384 uint8_t* data = reinterpret_cast<uint8_t*>(reader->ReadRawPointerValue()); |
2385 const ExternalTypedData& obj = ExternalTypedData::Handle( | 2385 const ExternalTypedData& obj = ExternalTypedData::Handle( |
2386 ExternalTypedData::New(cid, data, length)); | 2386 ExternalTypedData::New(cid, data, length)); |
2387 void* peer = reinterpret_cast<void*>(reader->ReadIntptrValue()); | 2387 void* peer = reinterpret_cast<void*>(reader->ReadRawPointerValue()); |
2388 Dart_WeakPersistentHandleFinalizer callback = | 2388 Dart_WeakPersistentHandleFinalizer callback = |
2389 reinterpret_cast<Dart_WeakPersistentHandleFinalizer>( | 2389 reinterpret_cast<Dart_WeakPersistentHandleFinalizer>( |
2390 reader->ReadIntptrValue()); | 2390 reader->ReadRawPointerValue()); |
2391 obj.AddFinalizer(peer, callback); | 2391 obj.AddFinalizer(peer, callback); |
2392 return obj.raw(); | 2392 return obj.raw(); |
2393 } | 2393 } |
2394 | 2394 |
2395 | 2395 |
2396 #define TYPED_DATA_WRITE(type) \ | 2396 #define TYPED_DATA_WRITE(type) \ |
2397 { \ | 2397 { \ |
2398 type* data = reinterpret_cast<type*>(ptr()->data_); \ | 2398 type* data = reinterpret_cast<type*>(ptr()->data_); \ |
2399 for (intptr_t i = 0; i < len; i++) { \ | 2399 for (intptr_t i = 0; i < len; i++) { \ |
2400 writer->Write(data[i]); \ | 2400 writer->Write(data[i]); \ |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2783 // We do not allow objects with native fields in an isolate message. | 2783 // We do not allow objects with native fields in an isolate message. |
2784 writer->SetWriteException(Exceptions::kArgument, | 2784 writer->SetWriteException(Exceptions::kArgument, |
2785 "Illegal argument in isolate message" | 2785 "Illegal argument in isolate message" |
2786 " : (object is a UserTag)"); | 2786 " : (object is a UserTag)"); |
2787 } else { | 2787 } else { |
2788 UNREACHABLE(); | 2788 UNREACHABLE(); |
2789 } | 2789 } |
2790 } | 2790 } |
2791 | 2791 |
2792 } // namespace dart | 2792 } // namespace dart |
OLD | NEW |