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

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

Issue 9368049: Add external byte array API and finalize external strings and byte arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 years, 10 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/scavenger.cc » ('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/visitor.h" 9 #include "vm/visitor.h"
10 10
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 intptr_t object_id, 1472 intptr_t object_id,
1473 Snapshot::Kind kind) { 1473 Snapshot::Kind kind) {
1474 // Serialize as a non-external one byte string. 1474 // Serialize as a non-external one byte string.
1475 StringWriteTo(writer, 1475 StringWriteTo(writer,
1476 object_id, 1476 object_id,
1477 kind, 1477 kind,
1478 ObjectStore::kOneByteStringClass, 1478 ObjectStore::kOneByteStringClass,
1479 ptr()->tags_, 1479 ptr()->tags_,
1480 ptr()->length_, 1480 ptr()->length_,
1481 ptr()->hash_, 1481 ptr()->hash_,
1482 ptr()->external_data_->data_); 1482 ptr()->external_data_->data());
1483 } 1483 }
1484 1484
1485 1485
1486 void RawExternalTwoByteString::WriteTo(SnapshotWriter* writer, 1486 void RawExternalTwoByteString::WriteTo(SnapshotWriter* writer,
1487 intptr_t object_id, 1487 intptr_t object_id,
1488 Snapshot::Kind kind) { 1488 Snapshot::Kind kind) {
1489 // Serialize as a non-external two byte string. 1489 // Serialize as a non-external two byte string.
1490 StringWriteTo(writer, 1490 StringWriteTo(writer,
1491 object_id, 1491 object_id,
1492 kind, 1492 kind,
1493 ObjectStore::kTwoByteStringClass, 1493 ObjectStore::kTwoByteStringClass,
1494 ptr()->tags_, 1494 ptr()->tags_,
1495 ptr()->length_, 1495 ptr()->length_,
1496 ptr()->hash_, 1496 ptr()->hash_,
1497 ptr()->external_data_->data_); 1497 ptr()->external_data_->data());
1498 } 1498 }
1499 1499
1500 1500
1501 void RawExternalFourByteString::WriteTo(SnapshotWriter* writer, 1501 void RawExternalFourByteString::WriteTo(SnapshotWriter* writer,
1502 intptr_t object_id, 1502 intptr_t object_id,
1503 Snapshot::Kind kind) { 1503 Snapshot::Kind kind) {
1504 // Serialize as a non-external four byte string. 1504 // Serialize as a non-external four byte string.
1505 StringWriteTo(writer, 1505 StringWriteTo(writer,
1506 object_id, 1506 object_id,
1507 kind, 1507 kind,
1508 ObjectStore::kFourByteStringClass, 1508 ObjectStore::kFourByteStringClass,
1509 ptr()->tags_, 1509 ptr()->tags_,
1510 ptr()->length_, 1510 ptr()->length_,
1511 ptr()->hash_, 1511 ptr()->hash_,
1512 ptr()->external_data_->data_); 1512 ptr()->external_data_->data());
1513 } 1513 }
1514 1514
1515 1515
1516 RawBool* Bool::ReadFrom(SnapshotReader* reader, 1516 RawBool* Bool::ReadFrom(SnapshotReader* reader,
1517 intptr_t object_id, 1517 intptr_t object_id,
1518 intptr_t tags, 1518 intptr_t tags,
1519 Snapshot::Kind kind) { 1519 Snapshot::Kind kind) {
1520 UNREACHABLE(); 1520 UNREACHABLE();
1521 return Bool::null(); 1521 return Bool::null();
1522 } 1522 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 void RawExternalByteArray::WriteTo(SnapshotWriter* writer, 1731 void RawExternalByteArray::WriteTo(SnapshotWriter* writer,
1732 intptr_t object_id, 1732 intptr_t object_id,
1733 Snapshot::Kind kind) { 1733 Snapshot::Kind kind) {
1734 // Serialize as an internal byte array. 1734 // Serialize as an internal byte array.
1735 ByteArrayWriteTo(writer, 1735 ByteArrayWriteTo(writer,
1736 object_id, 1736 object_id,
1737 kind, 1737 kind,
1738 ObjectStore::kInternalByteArrayClass, 1738 ObjectStore::kInternalByteArrayClass,
1739 ptr()->tags_, 1739 ptr()->tags_,
1740 ptr()->length_, 1740 ptr()->length_,
1741 ptr()->data_); 1741 ptr()->external_data_->data());
1742 } 1742 }
1743 1743
1744 1744
1745 RawClosure* Closure::ReadFrom(SnapshotReader* reader, 1745 RawClosure* Closure::ReadFrom(SnapshotReader* reader,
1746 intptr_t object_id, 1746 intptr_t object_id,
1747 intptr_t tags, 1747 intptr_t tags,
1748 Snapshot::Kind kind) { 1748 Snapshot::Kind kind) {
1749 UNIMPLEMENTED(); 1749 UNIMPLEMENTED();
1750 return Closure::null(); 1750 return Closure::null();
1751 } 1751 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 // Write out all the other fields. 1824 // Write out all the other fields.
1825 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); 1825 writer->Write<RawObject*>(ptr()->num_bracket_expressions_);
1826 writer->WriteObject(ptr()->pattern_); 1826 writer->WriteObject(ptr()->pattern_);
1827 writer->WriteIntptrValue(ptr()->type_); 1827 writer->WriteIntptrValue(ptr()->type_);
1828 writer->WriteIntptrValue(ptr()->flags_); 1828 writer->WriteIntptrValue(ptr()->flags_);
1829 1829
1830 // Do not write out the data part which is native. 1830 // Do not write out the data part which is native.
1831 } 1831 }
1832 1832
1833 } // namespace dart 1833 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698