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

Side by Side Diff: runtime/vm/raw_object.h

Issue 8383029: Implement external strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address final review comments Created 9 years, 1 month 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/object_test.cc ('k') | runtime/vm/raw_object.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #ifndef VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "vm/assert.h" 8 #include "vm/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/snapshot.h" 10 #include "vm/snapshot.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 V(Number) \ 42 V(Number) \
43 V(Integer) \ 43 V(Integer) \
44 V(Smi) \ 44 V(Smi) \
45 V(Mint) \ 45 V(Mint) \
46 V(Bigint) \ 46 V(Bigint) \
47 V(Double) \ 47 V(Double) \
48 V(String) \ 48 V(String) \
49 V(OneByteString) \ 49 V(OneByteString) \
50 V(TwoByteString) \ 50 V(TwoByteString) \
51 V(FourByteString) \ 51 V(FourByteString) \
52 V(ExternalOneByteString) \
53 V(ExternalTwoByteString) \
54 V(ExternalFourByteString) \
52 V(Bool) \ 55 V(Bool) \
53 V(Array) \ 56 V(Array) \
54 V(ImmutableArray) \ 57 V(ImmutableArray) \
55 V(ByteBuffer) \ 58 V(ByteBuffer) \
56 V(Closure) \ 59 V(Closure) \
57 V(Stacktrace) \ 60 V(Stacktrace) \
58 V(JSRegExp) \ 61 V(JSRegExp) \
59 62
60 #define CLASS_LIST(V) \ 63 #define CLASS_LIST(V) \
61 V(Object) \ 64 V(Object) \
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 692
690 693
691 class RawFourByteString : public RawString { 694 class RawFourByteString : public RawString {
692 RAW_HEAP_OBJECT_IMPLEMENTATION(FourByteString); 695 RAW_HEAP_OBJECT_IMPLEMENTATION(FourByteString);
693 696
694 // Variable length data follows here. 697 // Variable length data follows here.
695 uint32_t data_[0]; 698 uint32_t data_[0];
696 }; 699 };
697 700
698 701
702 template<typename T>
703 class ExternalStringData {
704 public:
705 typedef void Callback(void* peer);
706 ExternalStringData(const T* data, void* peer, Callback* callback) :
707 data_(data), peer_(peer), callback_(callback) {
708 }
709 const T* data_;
710 void* peer_;
711 Callback* callback_;
712 };
713
714
715 class RawExternalOneByteString : public RawString {
716 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalOneByteString);
717
718 ExternalStringData<uint8_t>* external_data_;
719 };
720
721
722 class RawExternalTwoByteString : public RawString {
723 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTwoByteString);
724
725 ExternalStringData<uint16_t>* external_data_;
726 };
727
728
729 class RawExternalFourByteString : public RawString {
730 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFourByteString);
731
732 ExternalStringData<uint32_t>* external_data_;
733 };
734
735
699 class RawBool : public RawInstance { 736 class RawBool : public RawInstance {
700 RAW_HEAP_OBJECT_IMPLEMENTATION(Bool); 737 RAW_HEAP_OBJECT_IMPLEMENTATION(Bool);
701 738
702 bool value_; 739 bool value_;
703 }; 740 };
704 741
705 742
706 class RawArray : public RawInstance { 743 class RawArray : public RawInstance {
707 RAW_HEAP_OBJECT_IMPLEMENTATION(Array); 744 RAW_HEAP_OBJECT_IMPLEMENTATION(Array);
708 745
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 intptr_t type_; // Uninitialized, simple or complex. 827 intptr_t type_; // Uninitialized, simple or complex.
791 intptr_t flags_; // Represents global/local, case insensitive, multiline. 828 intptr_t flags_; // Represents global/local, case insensitive, multiline.
792 829
793 // Variable length data follows here. 830 // Variable length data follows here.
794 uint8_t data_[0]; 831 uint8_t data_[0];
795 }; 832 };
796 833
797 } // namespace dart 834 } // namespace dart
798 835
799 #endif // VM_RAW_OBJECT_H_ 836 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698