| OLD | NEW |
| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 | 1069 |
| 1070 name = Symbols::New("String"); | 1070 name = Symbols::New("String"); |
| 1071 cls = Class::New<Instance>(kIllegalCid); | 1071 cls = Class::New<Instance>(kIllegalCid); |
| 1072 cls.set_is_prefinalized(); | 1072 cls.set_is_prefinalized(); |
| 1073 RegisterClass(cls, name, core_lib); | 1073 RegisterClass(cls, name, core_lib); |
| 1074 cls.set_is_prefinalized(); | 1074 cls.set_is_prefinalized(); |
| 1075 pending_classes.Add(cls, Heap::kOld); | 1075 pending_classes.Add(cls, Heap::kOld); |
| 1076 type = Type::NewNonParameterizedType(cls); | 1076 type = Type::NewNonParameterizedType(cls); |
| 1077 object_store->set_string_type(type); | 1077 object_store->set_string_type(type); |
| 1078 | 1078 |
| 1079 cls = Class::New<Instance>(kIllegalCid); | |
| 1080 RegisterClass(cls, Symbols::List(), core_lib); | |
| 1081 cls.set_is_prefinalized(); | |
| 1082 pending_classes.Add(cls, Heap::kOld); | |
| 1083 object_store->set_list_class(cls); | |
| 1084 | |
| 1085 cls = object_store->bool_class(); | 1079 cls = object_store->bool_class(); |
| 1086 type = Type::NewNonParameterizedType(cls); | 1080 type = Type::NewNonParameterizedType(cls); |
| 1087 object_store->set_bool_type(type); | 1081 object_store->set_bool_type(type); |
| 1088 | 1082 |
| 1089 cls = object_store->smi_class(); | 1083 cls = object_store->smi_class(); |
| 1090 type = Type::NewNonParameterizedType(cls); | 1084 type = Type::NewNonParameterizedType(cls); |
| 1091 object_store->set_smi_type(type); | 1085 object_store->set_smi_type(type); |
| 1092 | 1086 |
| 1093 cls = object_store->mint_class(); | 1087 cls = object_store->mint_class(); |
| 1094 type = Type::NewNonParameterizedType(cls); | 1088 type = Type::NewNonParameterizedType(cls); |
| (...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2312 ASSERT(raw_ptr()->allocation_stub_ == Code::null()); | 2306 ASSERT(raw_ptr()->allocation_stub_ == Code::null()); |
| 2313 StorePointer(&raw_ptr()->allocation_stub_, value.raw()); | 2307 StorePointer(&raw_ptr()->allocation_stub_, value.raw()); |
| 2314 } | 2308 } |
| 2315 | 2309 |
| 2316 | 2310 |
| 2317 bool Class::IsFunctionClass() const { | 2311 bool Class::IsFunctionClass() const { |
| 2318 return raw() == Type::Handle(Type::Function()).type_class(); | 2312 return raw() == Type::Handle(Type::Function()).type_class(); |
| 2319 } | 2313 } |
| 2320 | 2314 |
| 2321 | 2315 |
| 2322 bool Class::IsListClass() const { | |
| 2323 return raw() == Isolate::Current()->object_store()->list_class(); | |
| 2324 } | |
| 2325 | |
| 2326 | |
| 2327 bool Class::IsCanonicalSignatureClass() const { | 2316 bool Class::IsCanonicalSignatureClass() const { |
| 2328 const Function& function = Function::Handle(signature_function()); | 2317 const Function& function = Function::Handle(signature_function()); |
| 2329 return (!function.IsNull() && (function.signature_class() == raw())); | 2318 return (!function.IsNull() && (function.signature_class() == raw())); |
| 2330 } | 2319 } |
| 2331 | 2320 |
| 2332 | 2321 |
| 2333 // If test_kind == kIsSubtypeOf, checks if type S is a subtype of type T. | 2322 // If test_kind == kIsSubtypeOf, checks if type S is a subtype of type T. |
| 2334 // If test_kind == kIsMoreSpecificThan, checks if S is more specific than T. | 2323 // If test_kind == kIsMoreSpecificThan, checks if S is more specific than T. |
| 2335 // Type S is specified by this class parameterized with 'type_arguments', and | 2324 // Type S is specified by this class parameterized with 'type_arguments', and |
| 2336 // type T by class 'other' parameterized with 'other_type_arguments'. | 2325 // type T by class 'other' parameterized with 'other_type_arguments'. |
| (...skipping 11808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14145 } | 14134 } |
| 14146 | 14135 |
| 14147 | 14136 |
| 14148 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 14137 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 14149 stream->OpenObject(); | 14138 stream->OpenObject(); |
| 14150 stream->CloseObject(); | 14139 stream->CloseObject(); |
| 14151 } | 14140 } |
| 14152 | 14141 |
| 14153 | 14142 |
| 14154 } // namespace dart | 14143 } // namespace dart |
| OLD | NEW |