| 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 #include "vm/object_store.h" | 5 #include "vm/object_store.h" |
| 6 | 6 |
| 7 #include "vm/isolate.h" | 7 #include "vm/isolate.h" |
| 8 #include "vm/object.h" | 8 #include "vm/object.h" |
| 9 #include "vm/raw_object.h" | 9 #include "vm/raw_object.h" |
| 10 #include "vm/visitor.h" | 10 #include "vm/visitor.h" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 ObjectStore::ObjectStore() | 14 ObjectStore::ObjectStore() |
| 15 : object_class_(Class::null()), | 15 : object_class_(Class::null()), |
| 16 function_interface_(Type::null()), | 16 function_interface_(Type::null()), |
| 17 number_interface_(Type::null()), | 17 number_interface_(Type::null()), |
| 18 int_interface_(Type::null()), | 18 int_interface_(Type::null()), |
| 19 smi_class_(Class::null()), | 19 smi_class_(Class::null()), |
| 20 mint_class_(Class::null()), | 20 mint_class_(Class::null()), |
| 21 bigint_class_(Class::null()), | 21 bigint_class_(Class::null()), |
| 22 double_interface_(Type::null()), | 22 double_interface_(Type::null()), |
| 23 double_class_(Class::null()), | 23 double_class_(Class::null()), |
| 24 string_interface_(Type::null()), | 24 string_interface_(Type::null()), |
| 25 one_byte_string_class_(Class::null()), | 25 one_byte_string_class_(Class::null()), |
| 26 two_byte_string_class_(Class::null()), | 26 two_byte_string_class_(Class::null()), |
| 27 four_byte_string_class_(Class::null()), | 27 four_byte_string_class_(Class::null()), |
| 28 external_one_byte_string_class_(Class::null()), |
| 29 external_two_byte_string_class_(Class::null()), |
| 30 external_four_byte_string_class_(Class::null()), |
| 28 bool_interface_(Type::null()), | 31 bool_interface_(Type::null()), |
| 29 bool_class_(Class::null()), | 32 bool_class_(Class::null()), |
| 30 list_interface_(Type::null()), | 33 list_interface_(Type::null()), |
| 31 array_class_(Class::null()), | 34 array_class_(Class::null()), |
| 32 immutable_array_class_(Class::null()), | 35 immutable_array_class_(Class::null()), |
| 36 byte_buffer_class_(Class::null()), |
| 33 unhandled_exception_class_(Class::null()), | 37 unhandled_exception_class_(Class::null()), |
| 34 stacktrace_class_(Class::null()), | 38 stacktrace_class_(Class::null()), |
| 35 jsregexp_class_(Class::null()), | 39 jsregexp_class_(Class::null()), |
| 36 true_value_(Bool::null()), | 40 true_value_(Bool::null()), |
| 37 false_value_(Bool::null()), | 41 false_value_(Bool::null()), |
| 38 empty_array_(Array::null()), | 42 empty_array_(Array::null()), |
| 39 symbol_table_(Array::null()), | 43 symbol_table_(Array::null()), |
| 40 core_library_(Library::null()), | 44 core_library_(Library::null()), |
| 41 core_impl_library_(Library::null()), | 45 core_impl_library_(Library::null()), |
| 42 native_wrappers_library_(Library::null()), | 46 native_wrappers_library_(Library::null()), |
| (...skipping 25 matching lines...) Expand all Loading... |
| 68 RawClass* ObjectStore::GetClass(int index) { | 72 RawClass* ObjectStore::GetClass(int index) { |
| 69 switch (index) { | 73 switch (index) { |
| 70 case kObjectClass: return object_class_; | 74 case kObjectClass: return object_class_; |
| 71 case kSmiClass: return smi_class_; | 75 case kSmiClass: return smi_class_; |
| 72 case kMintClass: return mint_class_; | 76 case kMintClass: return mint_class_; |
| 73 case kBigintClass: return bigint_class_; | 77 case kBigintClass: return bigint_class_; |
| 74 case kDoubleClass: return double_class_; | 78 case kDoubleClass: return double_class_; |
| 75 case kOneByteStringClass: return one_byte_string_class_; | 79 case kOneByteStringClass: return one_byte_string_class_; |
| 76 case kTwoByteStringClass: return two_byte_string_class_; | 80 case kTwoByteStringClass: return two_byte_string_class_; |
| 77 case kFourByteStringClass: return four_byte_string_class_; | 81 case kFourByteStringClass: return four_byte_string_class_; |
| 82 case kExternalOneByteStringClass: return external_one_byte_string_class_; |
| 83 case kExternalTwoByteStringClass: return external_two_byte_string_class_; |
| 84 case kExternalFourByteStringClass: return external_four_byte_string_class_; |
| 78 case kBoolClass: return bool_class_; | 85 case kBoolClass: return bool_class_; |
| 79 case kArrayClass: return array_class_; | 86 case kArrayClass: return array_class_; |
| 80 case kImmutableArrayClass: return immutable_array_class_; | 87 case kImmutableArrayClass: return immutable_array_class_; |
| 81 case kByteBufferClass: return byte_buffer_class_; | 88 case kByteBufferClass: return byte_buffer_class_; |
| 82 case kUnhandledExceptionClass: return unhandled_exception_class_; | 89 case kUnhandledExceptionClass: return unhandled_exception_class_; |
| 83 case kStacktraceClass: return stacktrace_class_; | 90 case kStacktraceClass: return stacktrace_class_; |
| 84 case kJSRegExpClass: return jsregexp_class_; | 91 case kJSRegExpClass: return jsregexp_class_; |
| 85 default: break; | 92 default: break; |
| 86 } | 93 } |
| 87 UNREACHABLE(); | 94 UNREACHABLE(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 100 } else if (raw_class == bigint_class_) { | 107 } else if (raw_class == bigint_class_) { |
| 101 return kBigintClass; | 108 return kBigintClass; |
| 102 } else if (raw_class == double_class_) { | 109 } else if (raw_class == double_class_) { |
| 103 return kDoubleClass; | 110 return kDoubleClass; |
| 104 } else if (raw_class == one_byte_string_class_) { | 111 } else if (raw_class == one_byte_string_class_) { |
| 105 return kOneByteStringClass; | 112 return kOneByteStringClass; |
| 106 } else if (raw_class == two_byte_string_class_) { | 113 } else if (raw_class == two_byte_string_class_) { |
| 107 return kTwoByteStringClass; | 114 return kTwoByteStringClass; |
| 108 } else if (raw_class == four_byte_string_class_) { | 115 } else if (raw_class == four_byte_string_class_) { |
| 109 return kFourByteStringClass; | 116 return kFourByteStringClass; |
| 117 } else if (raw_class == external_one_byte_string_class_) { |
| 118 return kExternalOneByteStringClass; |
| 119 } else if (raw_class == external_two_byte_string_class_) { |
| 120 return kExternalTwoByteStringClass; |
| 121 } else if (raw_class == external_four_byte_string_class_) { |
| 122 return kExternalFourByteStringClass; |
| 110 } else if (raw_class == bool_class_) { | 123 } else if (raw_class == bool_class_) { |
| 111 return kBoolClass; | 124 return kBoolClass; |
| 112 } else if (raw_class == array_class_) { | 125 } else if (raw_class == array_class_) { |
| 113 return kArrayClass; | 126 return kArrayClass; |
| 114 } else if (raw_class == immutable_array_class_) { | 127 } else if (raw_class == immutable_array_class_) { |
| 115 return kImmutableArrayClass; | 128 return kImmutableArrayClass; |
| 116 } else if (raw_class == byte_buffer_class_) { | 129 } else if (raw_class == byte_buffer_class_) { |
| 117 return kByteBufferClass; | 130 return kByteBufferClass; |
| 118 } else if (raw_class == unhandled_exception_class_) { | 131 } else if (raw_class == unhandled_exception_class_) { |
| 119 return kUnhandledExceptionClass; | 132 return kUnhandledExceptionClass; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 return kBoolInterface; | 181 return kBoolInterface; |
| 169 } else if (raw_type == string_interface()) { | 182 } else if (raw_type == string_interface()) { |
| 170 return kStringInterface; | 183 return kStringInterface; |
| 171 } else if (raw_type == list_interface()) { | 184 } else if (raw_type == list_interface()) { |
| 172 return kListInterface; | 185 return kListInterface; |
| 173 } | 186 } |
| 174 return kInvalidIndex; | 187 return kInvalidIndex; |
| 175 } | 188 } |
| 176 | 189 |
| 177 } // namespace dart | 190 } // namespace dart |
| OLD | NEW |