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

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

Issue 98253009: Refactor VM service IDs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
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 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 other, 871 other,
872 other_type_arguments, 872 other_type_arguments,
873 bound_error); 873 bound_error);
874 } 874 }
875 875
876 // Check if this is the top level class. 876 // Check if this is the top level class.
877 bool IsTopLevel() const; 877 bool IsTopLevel() const;
878 878
879 RawArray* fields() const { return raw_ptr()->fields_; } 879 RawArray* fields() const { return raw_ptr()->fields_; }
880 void SetFields(const Array& value) const; 880 void SetFields(const Array& value) const;
881 intptr_t FindFieldIndex(const Field& field) const;
881 882
882 // Returns an array of all fields of this class and its superclasses indexed 883 // Returns an array of all fields of this class and its superclasses indexed
883 // by offset in words. 884 // by offset in words.
884 RawArray* OffsetToFieldMap() const; 885 RawArray* OffsetToFieldMap() const;
885 886
886 // Returns true if non-static fields are defined. 887 // Returns true if non-static fields are defined.
887 bool HasInstanceFields() const; 888 bool HasInstanceFields() const;
888 889
889 RawArray* functions() const { return raw_ptr()->functions_; } 890 RawArray* functions() const { return raw_ptr()->functions_; }
890 void SetFunctions(const Array& value) const; 891 void SetFunctions(const Array& value) const;
891 void AddFunction(const Function& function) const; 892 void AddFunction(const Function& function) const;
893 intptr_t FindFunctionIndex(const Function& function) const;
892 894
893 RawGrowableObjectArray* closures() const { 895 RawGrowableObjectArray* closures() const {
894 return raw_ptr()->closure_functions_; 896 return raw_ptr()->closure_functions_;
895 } 897 }
896 void AddClosureFunction(const Function& function) const; 898 void AddClosureFunction(const Function& function) const;
897 RawFunction* LookupClosureFunction(intptr_t token_pos) const; 899 RawFunction* LookupClosureFunction(intptr_t token_pos) const;
900 intptr_t FindClosureIndex(intptr_t token_pos) const;
898 901
899 RawFunction* LookupDynamicFunction(const String& name) const; 902 RawFunction* LookupDynamicFunction(const String& name) const;
900 RawFunction* LookupDynamicFunctionAllowPrivate(const String& name) const; 903 RawFunction* LookupDynamicFunctionAllowPrivate(const String& name) const;
901 RawFunction* LookupStaticFunction(const String& name) const; 904 RawFunction* LookupStaticFunction(const String& name) const;
902 RawFunction* LookupStaticFunctionAllowPrivate(const String& name) const; 905 RawFunction* LookupStaticFunctionAllowPrivate(const String& name) const;
903 RawFunction* LookupConstructor(const String& name) const; 906 RawFunction* LookupConstructor(const String& name) const;
904 RawFunction* LookupConstructorAllowPrivate(const String& name) const; 907 RawFunction* LookupConstructorAllowPrivate(const String& name) const;
905 RawFunction* LookupFactory(const String& name) const; 908 RawFunction* LookupFactory(const String& name) const;
906 RawFunction* LookupFunction(const String& name) const; 909 RawFunction* LookupFunction(const String& name) const;
907 RawFunction* LookupFunctionAllowPrivate(const String& name) const; 910 RawFunction* LookupFunctionAllowPrivate(const String& name) const;
(...skipping 4157 matching lines...) Expand 10 before | Expand all | Expand 10 after
5065 intptr_t dst_offset, 5068 intptr_t dst_offset,
5066 const uint16_t* characters, 5069 const uint16_t* characters,
5067 intptr_t len); 5070 intptr_t len);
5068 static void Copy(const String& dst, 5071 static void Copy(const String& dst,
5069 intptr_t dst_offset, 5072 intptr_t dst_offset,
5070 const String& src, 5073 const String& src,
5071 intptr_t src_offset, 5074 intptr_t src_offset,
5072 intptr_t len); 5075 intptr_t len);
5073 5076
5074 static RawString* EscapeSpecialCharacters(const String& str); 5077 static RawString* EscapeSpecialCharacters(const String& str);
5075 5078 static RawString* EncodeURI(const String& str);
5079 static RawString* DecodeURI(const String& str);
5076 static RawString* Concat(const String& str1, 5080 static RawString* Concat(const String& str1,
5077 const String& str2, 5081 const String& str2,
5078 Heap::Space space = Heap::kNew); 5082 Heap::Space space = Heap::kNew);
5079 static RawString* ConcatAll(const Array& strings, 5083 static RawString* ConcatAll(const Array& strings,
5080 Heap::Space space = Heap::kNew); 5084 Heap::Space space = Heap::kNew);
5081 // Concat all strings in 'strings' from 'start' to 'end' (excluding). 5085 // Concat all strings in 'strings' from 'start' to 'end' (excluding).
5082 static RawString* ConcatAllRange(const Array& strings, 5086 static RawString* ConcatAllRange(const Array& strings,
5083 intptr_t start, 5087 intptr_t start,
5084 intptr_t end, 5088 intptr_t end,
5085 Heap::Space space = Heap::kNew); 5089 Heap::Space space = Heap::kNew);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
5156 class OneByteString : public AllStatic { 5160 class OneByteString : public AllStatic {
5157 public: 5161 public:
5158 static int32_t CharAt(const String& str, intptr_t index) { 5162 static int32_t CharAt(const String& str, intptr_t index) {
5159 return *CharAddr(str, index); 5163 return *CharAddr(str, index);
5160 } 5164 }
5161 5165
5162 static void SetCharAt(const String& str, intptr_t index, uint8_t code_point) { 5166 static void SetCharAt(const String& str, intptr_t index, uint8_t code_point) {
5163 *CharAddr(str, index) = code_point; 5167 *CharAddr(str, index) = code_point;
5164 } 5168 }
5165 static RawOneByteString* EscapeSpecialCharacters(const String& str); 5169 static RawOneByteString* EscapeSpecialCharacters(const String& str);
5166
5167 // We use the same maximum elements for all strings. 5170 // We use the same maximum elements for all strings.
5168 static const intptr_t kBytesPerElement = 1; 5171 static const intptr_t kBytesPerElement = 1;
5169 static const intptr_t kMaxElements = String::kMaxElements; 5172 static const intptr_t kMaxElements = String::kMaxElements;
5170 5173
5171 static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); } 5174 static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); }
5172 5175
5173 static intptr_t InstanceSize() { 5176 static intptr_t InstanceSize() {
5174 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); 5177 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_));
5175 return 0; 5178 return 0;
5176 } 5179 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
5380 intptr_t len, 5383 intptr_t len,
5381 void* peer, 5384 void* peer,
5382 Dart_PeerFinalizer callback, 5385 Dart_PeerFinalizer callback,
5383 Heap::Space space); 5386 Heap::Space space);
5384 5387
5385 static RawExternalOneByteString* null() { 5388 static RawExternalOneByteString* null() {
5386 return reinterpret_cast<RawExternalOneByteString*>(Object::null()); 5389 return reinterpret_cast<RawExternalOneByteString*>(Object::null());
5387 } 5390 }
5388 5391
5389 static RawOneByteString* EscapeSpecialCharacters(const String& str); 5392 static RawOneByteString* EscapeSpecialCharacters(const String& str);
5393 static RawOneByteString* EncodeURI(const String& str);
5394 static RawOneByteString* DecodeURI(const String& str);
5390 5395
5391 static const ClassId kClassId = kExternalOneByteStringCid; 5396 static const ClassId kClassId = kExternalOneByteStringCid;
5392 5397
5393 private: 5398 private:
5394 static RawExternalOneByteString* raw(const String& str) { 5399 static RawExternalOneByteString* raw(const String& str) {
5395 return reinterpret_cast<RawExternalOneByteString*>(str.raw()); 5400 return reinterpret_cast<RawExternalOneByteString*>(str.raw());
5396 } 5401 }
5397 5402
5398 static RawExternalOneByteString* raw_ptr(const String& str) { 5403 static RawExternalOneByteString* raw_ptr(const String& str) {
5399 return reinterpret_cast<RawExternalOneByteString*>(str.raw_ptr()); 5404 return reinterpret_cast<RawExternalOneByteString*>(str.raw_ptr());
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
6564 6569
6565 6570
6566 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6571 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6567 intptr_t index) { 6572 intptr_t index) {
6568 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6573 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6569 } 6574 }
6570 6575
6571 } // namespace dart 6576 } // namespace dart
6572 6577
6573 #endif // VM_OBJECT_H_ 6578 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698