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

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

Issue 8761011: Renaming type classes as discussed: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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) 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_OBJECT_STORE_H_ 5 #ifndef VM_OBJECT_STORE_H_
6 #define VM_OBJECT_STORE_H_ 6 #define VM_OBJECT_STORE_H_
7 7
8 #include "vm/object.h" 8 #include "vm/object.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 }; 58 };
59 59
60 ~ObjectStore(); 60 ~ObjectStore();
61 61
62 RawClass* object_class() const { return object_class_; } 62 RawClass* object_class() const { return object_class_; }
63 void set_object_class(const Class& value) { object_class_ = value.raw(); } 63 void set_object_class(const Class& value) { object_class_ = value.raw(); }
64 static intptr_t object_class_offset() { 64 static intptr_t object_class_offset() {
65 return OFFSET_OF(ObjectStore, object_class_); 65 return OFFSET_OF(ObjectStore, object_class_);
66 } 66 }
67 67
68 RawParameterizedType* object_type() const { return object_type_; } 68 RawType* object_type() const { return object_type_; }
69 void set_object_type(const ParameterizedType& value) { 69 void set_object_type(const Type& value) {
70 object_type_ = value.raw(); 70 object_type_ = value.raw();
71 } 71 }
72 72
73 RawParameterizedType* null_type() const { return null_type_; } 73 RawType* null_type() const { return null_type_; }
74 void set_null_type(const ParameterizedType& value) { 74 void set_null_type(const Type& value) {
75 null_type_ = value.raw(); 75 null_type_ = value.raw();
76 } 76 }
77 77
78 RawParameterizedType* dynamic_type() const { return dynamic_type_; } 78 RawType* dynamic_type() const { return dynamic_type_; }
79 void set_dynamic_type(const ParameterizedType& value) { 79 void set_dynamic_type(const Type& value) {
80 dynamic_type_ = value.raw(); 80 dynamic_type_ = value.raw();
81 } 81 }
82 82
83 RawParameterizedType* void_type() const { return void_type_; } 83 RawType* void_type() const { return void_type_; }
84 void set_void_type(const ParameterizedType& value) { 84 void set_void_type(const Type& value) {
85 void_type_ = value.raw(); 85 void_type_ = value.raw();
86 } 86 }
87 87
88 RawParameterizedType* function_interface() const { 88 RawType* function_interface() const {
89 return function_interface_; 89 return function_interface_;
90 } 90 }
91 void set_function_interface(const ParameterizedType& value) { 91 void set_function_interface(const Type& value) {
92 function_interface_ = value.raw(); 92 function_interface_ = value.raw();
93 } 93 }
94 94
95 RawParameterizedType* number_interface() const { return number_interface_; } 95 RawType* number_interface() const { return number_interface_; }
96 void set_number_interface(const ParameterizedType& value) { 96 void set_number_interface(const Type& value) {
97 number_interface_ = value.raw(); 97 number_interface_ = value.raw();
98 } 98 }
99 99
100 RawParameterizedType* int_interface() const { return int_interface_; } 100 RawType* int_interface() const { return int_interface_; }
101 void set_int_interface(const ParameterizedType& value) { 101 void set_int_interface(const Type& value) {
102 int_interface_ = value.raw(); 102 int_interface_ = value.raw();
103 } 103 }
104 104
105 RawClass* smi_class() const { return smi_class_; } 105 RawClass* smi_class() const { return smi_class_; }
106 void set_smi_class(const Class& value) { smi_class_ = value.raw(); } 106 void set_smi_class(const Class& value) { smi_class_ = value.raw(); }
107 static intptr_t smi_class_offset() { 107 static intptr_t smi_class_offset() {
108 return OFFSET_OF(ObjectStore, smi_class_); 108 return OFFSET_OF(ObjectStore, smi_class_);
109 } 109 }
110 110
111 RawParameterizedType* double_interface() const { return double_interface_; } 111 RawType* double_interface() const { return double_interface_; }
112 void set_double_interface(const ParameterizedType& value) { 112 void set_double_interface(const Type& value) {
113 double_interface_ = value.raw(); 113 double_interface_ = value.raw();
114 } 114 }
115 115
116 RawClass* double_class() const { return double_class_; } 116 RawClass* double_class() const { return double_class_; }
117 void set_double_class(const Class& value) { double_class_ = value.raw(); } 117 void set_double_class(const Class& value) { double_class_ = value.raw(); }
118 118
119 RawClass* mint_class() const { return mint_class_; } 119 RawClass* mint_class() const { return mint_class_; }
120 void set_mint_class(const Class& value) { mint_class_ = value.raw(); } 120 void set_mint_class(const Class& value) { mint_class_ = value.raw(); }
121 121
122 RawClass* bigint_class() const { return bigint_class_; } 122 RawClass* bigint_class() const { return bigint_class_; }
123 void set_bigint_class(const Class& value) { bigint_class_ = value.raw(); } 123 void set_bigint_class(const Class& value) { bigint_class_ = value.raw(); }
124 124
125 RawParameterizedType* string_interface() const { return string_interface_; } 125 RawType* string_interface() const { return string_interface_; }
126 void set_string_interface(const ParameterizedType& value) { 126 void set_string_interface(const Type& value) {
127 string_interface_ = value.raw(); 127 string_interface_ = value.raw();
128 } 128 }
129 129
130 RawClass* one_byte_string_class() const { return one_byte_string_class_; } 130 RawClass* one_byte_string_class() const { return one_byte_string_class_; }
131 void set_one_byte_string_class(const Class& value) { 131 void set_one_byte_string_class(const Class& value) {
132 one_byte_string_class_ = value.raw(); 132 one_byte_string_class_ = value.raw();
133 } 133 }
134 134
135 RawClass* two_byte_string_class() const { return two_byte_string_class_; } 135 RawClass* two_byte_string_class() const { return two_byte_string_class_; }
136 void set_two_byte_string_class(const Class& value) { 136 void set_two_byte_string_class(const Class& value) {
(...skipping 19 matching lines...) Expand all
156 external_two_byte_string_class_ = value.raw(); 156 external_two_byte_string_class_ = value.raw();
157 } 157 }
158 158
159 RawClass* external_four_byte_string_class() const { 159 RawClass* external_four_byte_string_class() const {
160 return external_four_byte_string_class_; 160 return external_four_byte_string_class_;
161 } 161 }
162 void set_external_four_byte_string_class(const Class& value) { 162 void set_external_four_byte_string_class(const Class& value) {
163 external_four_byte_string_class_ = value.raw(); 163 external_four_byte_string_class_ = value.raw();
164 } 164 }
165 165
166 RawParameterizedType* bool_interface() const { return bool_interface_; } 166 RawType* bool_interface() const { return bool_interface_; }
167 void set_bool_interface(const ParameterizedType& value) { 167 void set_bool_interface(const Type& value) {
168 bool_interface_ = value.raw(); 168 bool_interface_ = value.raw();
169 } 169 }
170 170
171 RawClass* bool_class() const { return bool_class_; } 171 RawClass* bool_class() const { return bool_class_; }
172 void set_bool_class(const Class& value) { bool_class_ = value.raw(); } 172 void set_bool_class(const Class& value) { bool_class_ = value.raw(); }
173 173
174 RawParameterizedType* list_interface() const { return list_interface_; } 174 RawType* list_interface() const { return list_interface_; }
175 void set_list_interface(const ParameterizedType& value) { 175 void set_list_interface(const Type& value) {
176 list_interface_ = value.raw(); 176 list_interface_ = value.raw();
177 } 177 }
178 178
179 RawClass* array_class() const { return array_class_; } 179 RawClass* array_class() const { return array_class_; }
180 void set_array_class(const Class& value) { array_class_ = value.raw(); } 180 void set_array_class(const Class& value) { array_class_ = value.raw(); }
181 static intptr_t array_class_offset() { 181 static intptr_t array_class_offset() {
182 return OFFSET_OF(ObjectStore, array_class_); 182 return OFFSET_OF(ObjectStore, array_class_);
183 } 183 }
184 184
185 RawClass* immutable_array_class() const { return immutable_array_class_; } 185 RawClass* immutable_array_class() const { return immutable_array_class_; }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 RawContext* empty_context() const { return empty_context_; } 277 RawContext* empty_context() const { return empty_context_; }
278 void set_empty_context(const Context& value) { 278 void set_empty_context(const Context& value) {
279 empty_context_ = value.raw(); 279 empty_context_ = value.raw();
280 } 280 }
281 281
282 // Visit all object pointers. 282 // Visit all object pointers.
283 void VisitObjectPointers(ObjectPointerVisitor* visitor); 283 void VisitObjectPointers(ObjectPointerVisitor* visitor);
284 284
285 RawClass* GetClass(int index); 285 RawClass* GetClass(int index);
286 int GetClassIndex(const RawClass* raw_class); 286 int GetClassIndex(const RawClass* raw_class);
287 RawParameterizedType* GetType(int index); 287 RawType* GetType(int index);
288 int GetTypeIndex(const RawParameterizedType* raw_type); 288 int GetTypeIndex(const RawType* raw_type);
289 289
290 static void Init(Isolate* isolate); 290 static void Init(Isolate* isolate);
291 291
292 private: 292 private:
293 ObjectStore(); 293 ObjectStore();
294 294
295 RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); } 295 RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); }
296 RawClass* object_class_; 296 RawClass* object_class_;
297 RawParameterizedType* object_type_; 297 RawType* object_type_;
298 RawParameterizedType* null_type_; 298 RawType* null_type_;
299 RawParameterizedType* dynamic_type_; 299 RawType* dynamic_type_;
300 RawParameterizedType* void_type_; 300 RawType* void_type_;
301 RawParameterizedType* function_interface_; 301 RawType* function_interface_;
302 RawParameterizedType* number_interface_; 302 RawType* number_interface_;
303 RawParameterizedType* int_interface_; 303 RawType* int_interface_;
304 RawClass* smi_class_; 304 RawClass* smi_class_;
305 RawClass* mint_class_; 305 RawClass* mint_class_;
306 RawClass* bigint_class_; 306 RawClass* bigint_class_;
307 RawParameterizedType* double_interface_; 307 RawType* double_interface_;
308 RawClass* double_class_; 308 RawClass* double_class_;
309 RawParameterizedType* string_interface_; 309 RawType* string_interface_;
310 RawClass* one_byte_string_class_; 310 RawClass* one_byte_string_class_;
311 RawClass* two_byte_string_class_; 311 RawClass* two_byte_string_class_;
312 RawClass* four_byte_string_class_; 312 RawClass* four_byte_string_class_;
313 RawClass* external_one_byte_string_class_; 313 RawClass* external_one_byte_string_class_;
314 RawClass* external_two_byte_string_class_; 314 RawClass* external_two_byte_string_class_;
315 RawClass* external_four_byte_string_class_; 315 RawClass* external_four_byte_string_class_;
316 RawParameterizedType* bool_interface_; 316 RawType* bool_interface_;
317 RawClass* bool_class_; 317 RawClass* bool_class_;
318 RawParameterizedType* list_interface_; 318 RawType* list_interface_;
319 RawClass* array_class_; 319 RawClass* array_class_;
320 RawClass* immutable_array_class_; 320 RawClass* immutable_array_class_;
321 RawClass* byte_buffer_class_; 321 RawClass* byte_buffer_class_;
322 RawClass* unhandled_exception_class_; 322 RawClass* unhandled_exception_class_;
323 RawClass* stacktrace_class_; 323 RawClass* stacktrace_class_;
324 RawClass* jsregexp_class_; 324 RawClass* jsregexp_class_;
325 RawBool* true_value_; 325 RawBool* true_value_;
326 RawBool* false_value_; 326 RawBool* false_value_;
327 RawArray* empty_array_; 327 RawArray* empty_array_;
328 RawArray* symbol_table_; 328 RawArray* symbol_table_;
329 RawLibrary* core_library_; 329 RawLibrary* core_library_;
330 RawLibrary* core_impl_library_; 330 RawLibrary* core_impl_library_;
331 RawLibrary* native_wrappers_library_; 331 RawLibrary* native_wrappers_library_;
332 RawLibrary* root_library_; 332 RawLibrary* root_library_;
333 RawLibrary* registered_libraries_; 333 RawLibrary* registered_libraries_;
334 RawArray* pending_classes_; 334 RawArray* pending_classes_;
335 RawString* sticky_error_; 335 RawString* sticky_error_;
336 RawContext* empty_context_; 336 RawContext* empty_context_;
337 RawObject** to() { return reinterpret_cast<RawObject**>(&empty_context_); } 337 RawObject** to() { return reinterpret_cast<RawObject**>(&empty_context_); }
338 338
339 friend class SnapshotReader; 339 friend class SnapshotReader;
340 340
341 DISALLOW_COPY_AND_ASSIGN(ObjectStore); 341 DISALLOW_COPY_AND_ASSIGN(ObjectStore);
342 }; 342 };
343 343
344 } // namespace dart 344 } // namespace dart
345 345
346 #endif // VM_OBJECT_STORE_H_ 346 #endif // VM_OBJECT_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698