| OLD | NEW |
| 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 Loading... |
| 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 RawType* object_type() const { return object_type_; } | 68 RawParameterizedType* object_type() const { return object_type_; } |
| 69 void set_object_type(const Type& value) { object_type_ = value.raw(); } | 69 void set_object_type(const ParameterizedType& value) { |
| 70 object_type_ = value.raw(); |
| 71 } |
| 70 | 72 |
| 71 RawType* null_type() const { return null_type_; } | 73 RawParameterizedType* null_type() const { return null_type_; } |
| 72 void set_null_type(const Type& value) { null_type_ = value.raw(); } | 74 void set_null_type(const ParameterizedType& value) { |
| 75 null_type_ = value.raw(); |
| 76 } |
| 73 | 77 |
| 74 RawType* dynamic_type() const { return dynamic_type_; } | 78 RawParameterizedType* dynamic_type() const { return dynamic_type_; } |
| 75 void set_dynamic_type(const Type& value) { dynamic_type_ = value.raw(); } | 79 void set_dynamic_type(const ParameterizedType& value) { |
| 80 dynamic_type_ = value.raw(); |
| 81 } |
| 76 | 82 |
| 77 RawType* void_type() const { return void_type_; } | 83 RawParameterizedType* void_type() const { return void_type_; } |
| 78 void set_void_type(const Type& value) { void_type_ = value.raw(); } | 84 void set_void_type(const ParameterizedType& value) { |
| 85 void_type_ = value.raw(); |
| 86 } |
| 79 | 87 |
| 80 RawType* function_interface() const { return function_interface_; } | 88 RawParameterizedType* function_interface() const { |
| 81 void set_function_interface(const Type& value) { | 89 return function_interface_; |
| 90 } |
| 91 void set_function_interface(const ParameterizedType& value) { |
| 82 function_interface_ = value.raw(); | 92 function_interface_ = value.raw(); |
| 83 } | 93 } |
| 84 | 94 |
| 85 RawType* number_interface() const { return number_interface_; } | 95 RawParameterizedType* number_interface() const { return number_interface_; } |
| 86 void set_number_interface(const Type& value) { | 96 void set_number_interface(const ParameterizedType& value) { |
| 87 number_interface_ = value.raw(); | 97 number_interface_ = value.raw(); |
| 88 } | 98 } |
| 89 | 99 |
| 90 RawType* int_interface() const { return int_interface_; } | 100 RawParameterizedType* int_interface() const { return int_interface_; } |
| 91 void set_int_interface(const Type& value) { int_interface_ = value.raw(); } | 101 void set_int_interface(const ParameterizedType& value) { |
| 102 int_interface_ = value.raw(); |
| 103 } |
| 92 | 104 |
| 93 RawClass* smi_class() const { return smi_class_; } | 105 RawClass* smi_class() const { return smi_class_; } |
| 94 void set_smi_class(const Class& value) { smi_class_ = value.raw(); } | 106 void set_smi_class(const Class& value) { smi_class_ = value.raw(); } |
| 95 static intptr_t smi_class_offset() { | 107 static intptr_t smi_class_offset() { |
| 96 return OFFSET_OF(ObjectStore, smi_class_); | 108 return OFFSET_OF(ObjectStore, smi_class_); |
| 97 } | 109 } |
| 98 | 110 |
| 99 RawType* double_interface() const { return double_interface_; } | 111 RawParameterizedType* double_interface() const { return double_interface_; } |
| 100 void set_double_interface(const Type& value) { | 112 void set_double_interface(const ParameterizedType& value) { |
| 101 double_interface_ = value.raw(); | 113 double_interface_ = value.raw(); |
| 102 } | 114 } |
| 103 | 115 |
| 104 RawClass* double_class() const { return double_class_; } | 116 RawClass* double_class() const { return double_class_; } |
| 105 void set_double_class(const Class& value) { double_class_ = value.raw(); } | 117 void set_double_class(const Class& value) { double_class_ = value.raw(); } |
| 106 | 118 |
| 107 RawClass* mint_class() const { return mint_class_; } | 119 RawClass* mint_class() const { return mint_class_; } |
| 108 void set_mint_class(const Class& value) { mint_class_ = value.raw(); } | 120 void set_mint_class(const Class& value) { mint_class_ = value.raw(); } |
| 109 | 121 |
| 110 RawClass* bigint_class() const { return bigint_class_; } | 122 RawClass* bigint_class() const { return bigint_class_; } |
| 111 void set_bigint_class(const Class& value) { bigint_class_ = value.raw(); } | 123 void set_bigint_class(const Class& value) { bigint_class_ = value.raw(); } |
| 112 | 124 |
| 113 RawType* string_interface() const { return string_interface_; } | 125 RawParameterizedType* string_interface() const { return string_interface_; } |
| 114 void set_string_interface(const Type& value) { | 126 void set_string_interface(const ParameterizedType& value) { |
| 115 string_interface_ = value.raw(); | 127 string_interface_ = value.raw(); |
| 116 } | 128 } |
| 117 | 129 |
| 118 RawClass* one_byte_string_class() const { return one_byte_string_class_; } | 130 RawClass* one_byte_string_class() const { return one_byte_string_class_; } |
| 119 void set_one_byte_string_class(const Class& value) { | 131 void set_one_byte_string_class(const Class& value) { |
| 120 one_byte_string_class_ = value.raw(); | 132 one_byte_string_class_ = value.raw(); |
| 121 } | 133 } |
| 122 | 134 |
| 123 RawClass* two_byte_string_class() const { return two_byte_string_class_; } | 135 RawClass* two_byte_string_class() const { return two_byte_string_class_; } |
| 124 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 Loading... |
| 144 external_two_byte_string_class_ = value.raw(); | 156 external_two_byte_string_class_ = value.raw(); |
| 145 } | 157 } |
| 146 | 158 |
| 147 RawClass* external_four_byte_string_class() const { | 159 RawClass* external_four_byte_string_class() const { |
| 148 return external_four_byte_string_class_; | 160 return external_four_byte_string_class_; |
| 149 } | 161 } |
| 150 void set_external_four_byte_string_class(const Class& value) { | 162 void set_external_four_byte_string_class(const Class& value) { |
| 151 external_four_byte_string_class_ = value.raw(); | 163 external_four_byte_string_class_ = value.raw(); |
| 152 } | 164 } |
| 153 | 165 |
| 154 RawType* bool_interface() const { return bool_interface_; } | 166 RawParameterizedType* bool_interface() const { return bool_interface_; } |
| 155 void set_bool_interface(const Type& value) { bool_interface_ = value.raw(); } | 167 void set_bool_interface(const ParameterizedType& value) { |
| 168 bool_interface_ = value.raw(); |
| 169 } |
| 156 | 170 |
| 157 RawClass* bool_class() const { return bool_class_; } | 171 RawClass* bool_class() const { return bool_class_; } |
| 158 void set_bool_class(const Class& value) { bool_class_ = value.raw(); } | 172 void set_bool_class(const Class& value) { bool_class_ = value.raw(); } |
| 159 | 173 |
| 160 RawType* list_interface() const { return list_interface_; } | 174 RawParameterizedType* list_interface() const { return list_interface_; } |
| 161 void set_list_interface(const Type& value) { | 175 void set_list_interface(const ParameterizedType& value) { |
| 162 list_interface_ = value.raw(); | 176 list_interface_ = value.raw(); |
| 163 } | 177 } |
| 164 | 178 |
| 165 RawClass* array_class() const { return array_class_; } | 179 RawClass* array_class() const { return array_class_; } |
| 166 void set_array_class(const Class& value) { array_class_ = value.raw(); } | 180 void set_array_class(const Class& value) { array_class_ = value.raw(); } |
| 167 static intptr_t array_class_offset() { | 181 static intptr_t array_class_offset() { |
| 168 return OFFSET_OF(ObjectStore, array_class_); | 182 return OFFSET_OF(ObjectStore, array_class_); |
| 169 } | 183 } |
| 170 | 184 |
| 171 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 Loading... |
| 263 RawContext* empty_context() const { return empty_context_; } | 277 RawContext* empty_context() const { return empty_context_; } |
| 264 void set_empty_context(const Context& value) { | 278 void set_empty_context(const Context& value) { |
| 265 empty_context_ = value.raw(); | 279 empty_context_ = value.raw(); |
| 266 } | 280 } |
| 267 | 281 |
| 268 // Visit all object pointers. | 282 // Visit all object pointers. |
| 269 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 283 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 270 | 284 |
| 271 RawClass* GetClass(int index); | 285 RawClass* GetClass(int index); |
| 272 int GetClassIndex(const RawClass* raw_class); | 286 int GetClassIndex(const RawClass* raw_class); |
| 273 RawType* GetType(int index); | 287 RawParameterizedType* GetType(int index); |
| 274 int GetTypeIndex(const RawType* raw_type); | 288 int GetTypeIndex(const RawParameterizedType* raw_type); |
| 275 | 289 |
| 276 static void Init(Isolate* isolate); | 290 static void Init(Isolate* isolate); |
| 277 | 291 |
| 278 private: | 292 private: |
| 279 ObjectStore(); | 293 ObjectStore(); |
| 280 | 294 |
| 281 RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); } | 295 RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); } |
| 282 RawClass* object_class_; | 296 RawClass* object_class_; |
| 283 RawType* object_type_; | 297 RawParameterizedType* object_type_; |
| 284 RawType* null_type_; | 298 RawParameterizedType* null_type_; |
| 285 RawType* dynamic_type_; | 299 RawParameterizedType* dynamic_type_; |
| 286 RawType* void_type_; | 300 RawParameterizedType* void_type_; |
| 287 RawType* function_interface_; | 301 RawParameterizedType* function_interface_; |
| 288 RawType* number_interface_; | 302 RawParameterizedType* number_interface_; |
| 289 RawType* int_interface_; | 303 RawParameterizedType* int_interface_; |
| 290 RawClass* smi_class_; | 304 RawClass* smi_class_; |
| 291 RawClass* mint_class_; | 305 RawClass* mint_class_; |
| 292 RawClass* bigint_class_; | 306 RawClass* bigint_class_; |
| 293 RawType* double_interface_; | 307 RawParameterizedType* double_interface_; |
| 294 RawClass* double_class_; | 308 RawClass* double_class_; |
| 295 RawType* string_interface_; | 309 RawParameterizedType* string_interface_; |
| 296 RawClass* one_byte_string_class_; | 310 RawClass* one_byte_string_class_; |
| 297 RawClass* two_byte_string_class_; | 311 RawClass* two_byte_string_class_; |
| 298 RawClass* four_byte_string_class_; | 312 RawClass* four_byte_string_class_; |
| 299 RawClass* external_one_byte_string_class_; | 313 RawClass* external_one_byte_string_class_; |
| 300 RawClass* external_two_byte_string_class_; | 314 RawClass* external_two_byte_string_class_; |
| 301 RawClass* external_four_byte_string_class_; | 315 RawClass* external_four_byte_string_class_; |
| 302 RawType* bool_interface_; | 316 RawParameterizedType* bool_interface_; |
| 303 RawClass* bool_class_; | 317 RawClass* bool_class_; |
| 304 RawType* list_interface_; | 318 RawParameterizedType* list_interface_; |
| 305 RawClass* array_class_; | 319 RawClass* array_class_; |
| 306 RawClass* immutable_array_class_; | 320 RawClass* immutable_array_class_; |
| 307 RawClass* byte_buffer_class_; | 321 RawClass* byte_buffer_class_; |
| 308 RawClass* unhandled_exception_class_; | 322 RawClass* unhandled_exception_class_; |
| 309 RawClass* stacktrace_class_; | 323 RawClass* stacktrace_class_; |
| 310 RawClass* jsregexp_class_; | 324 RawClass* jsregexp_class_; |
| 311 RawBool* true_value_; | 325 RawBool* true_value_; |
| 312 RawBool* false_value_; | 326 RawBool* false_value_; |
| 313 RawArray* empty_array_; | 327 RawArray* empty_array_; |
| 314 RawArray* symbol_table_; | 328 RawArray* symbol_table_; |
| 315 RawLibrary* core_library_; | 329 RawLibrary* core_library_; |
| 316 RawLibrary* core_impl_library_; | 330 RawLibrary* core_impl_library_; |
| 317 RawLibrary* native_wrappers_library_; | 331 RawLibrary* native_wrappers_library_; |
| 318 RawLibrary* root_library_; | 332 RawLibrary* root_library_; |
| 319 RawLibrary* registered_libraries_; | 333 RawLibrary* registered_libraries_; |
| 320 RawArray* pending_classes_; | 334 RawArray* pending_classes_; |
| 321 RawString* sticky_error_; | 335 RawString* sticky_error_; |
| 322 RawContext* empty_context_; | 336 RawContext* empty_context_; |
| 323 RawObject** to() { return reinterpret_cast<RawObject**>(&empty_context_); } | 337 RawObject** to() { return reinterpret_cast<RawObject**>(&empty_context_); } |
| 324 | 338 |
| 325 friend class SnapshotReader; | 339 friend class SnapshotReader; |
| 326 | 340 |
| 327 DISALLOW_COPY_AND_ASSIGN(ObjectStore); | 341 DISALLOW_COPY_AND_ASSIGN(ObjectStore); |
| 328 }; | 342 }; |
| 329 | 343 |
| 330 } // namespace dart | 344 } // namespace dart |
| 331 | 345 |
| 332 #endif // VM_OBJECT_STORE_H_ | 346 #endif // VM_OBJECT_STORE_H_ |
| OLD | NEW |