Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 468423002: Add support for TypedData in full snapshot. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698