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

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

Issue 2893553002: More compact string representation on 64 bit. (Closed)
Patch Set: Slava feedback Created 3 years, 7 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
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/simulator_dbc.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/raw_object.h" 5 #include "vm/raw_object.h"
6 6
7 #include "vm/become.h" 7 #include "vm/become.h"
8 #include "vm/class_table.h" 8 #include "vm/class_table.h"
9 #include "vm/dart.h" 9 #include "vm/dart.h"
10 #include "vm/freelist.h" 10 #include "vm/freelist.h"
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 // String is an abstract class. 814 // String is an abstract class.
815 UNREACHABLE(); 815 UNREACHABLE();
816 return 0; 816 return 0;
817 } 817 }
818 818
819 819
820 intptr_t RawOneByteString::VisitOneByteStringPointers( 820 intptr_t RawOneByteString::VisitOneByteStringPointers(
821 RawOneByteString* raw_obj, 821 RawOneByteString* raw_obj,
822 ObjectPointerVisitor* visitor) { 822 ObjectPointerVisitor* visitor) {
823 ASSERT(!raw_obj->ptr()->length_->IsHeapObject()); 823 ASSERT(!raw_obj->ptr()->length_->IsHeapObject());
824 #if !defined(HASH_IN_OBJECT_HEADER)
824 ASSERT(!raw_obj->ptr()->hash_->IsHeapObject()); 825 ASSERT(!raw_obj->ptr()->hash_->IsHeapObject());
826 #endif
825 intptr_t length = Smi::Value(raw_obj->ptr()->length_); 827 intptr_t length = Smi::Value(raw_obj->ptr()->length_);
826 return OneByteString::InstanceSize(length); 828 return OneByteString::InstanceSize(length);
827 } 829 }
828 830
829 831
830 intptr_t RawTwoByteString::VisitTwoByteStringPointers( 832 intptr_t RawTwoByteString::VisitTwoByteStringPointers(
831 RawTwoByteString* raw_obj, 833 RawTwoByteString* raw_obj,
832 ObjectPointerVisitor* visitor) { 834 ObjectPointerVisitor* visitor) {
833 ASSERT(!raw_obj->ptr()->length_->IsHeapObject()); 835 ASSERT(!raw_obj->ptr()->length_->IsHeapObject());
836 #if !defined(HASH_IN_OBJECT_HEADER)
834 ASSERT(!raw_obj->ptr()->hash_->IsHeapObject()); 837 ASSERT(!raw_obj->ptr()->hash_->IsHeapObject());
838 #endif
835 intptr_t length = Smi::Value(raw_obj->ptr()->length_); 839 intptr_t length = Smi::Value(raw_obj->ptr()->length_);
836 return TwoByteString::InstanceSize(length); 840 return TwoByteString::InstanceSize(length);
837 } 841 }
838 842
839 843
840 intptr_t RawExternalOneByteString::VisitExternalOneByteStringPointers( 844 intptr_t RawExternalOneByteString::VisitExternalOneByteStringPointers(
841 RawExternalOneByteString* raw_obj, 845 RawExternalOneByteString* raw_obj,
842 ObjectPointerVisitor* visitor) { 846 ObjectPointerVisitor* visitor) {
843 // Make sure that we got here with the tagged pointer as this. 847 // Make sure that we got here with the tagged pointer as this.
844 ASSERT(raw_obj->IsHeapObject()); 848 ASSERT(raw_obj->IsHeapObject());
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 intptr_t RawUserTag::VisitUserTagPointers(RawUserTag* raw_obj, 1008 intptr_t RawUserTag::VisitUserTagPointers(RawUserTag* raw_obj,
1005 ObjectPointerVisitor* visitor) { 1009 ObjectPointerVisitor* visitor) {
1006 // Make sure that we got here with the tagged pointer as this. 1010 // Make sure that we got here with the tagged pointer as this.
1007 ASSERT(raw_obj->IsHeapObject()); 1011 ASSERT(raw_obj->IsHeapObject());
1008 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 1012 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
1009 return UserTag::InstanceSize(); 1013 return UserTag::InstanceSize();
1010 } 1014 }
1011 1015
1012 1016
1013 } // namespace dart 1017 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698