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/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 type = Type::NewNonParameterizedType(cls); | 841 type = Type::NewNonParameterizedType(cls); |
842 object_store->set_int_type(type); | 842 object_store->set_int_type(type); |
843 | 843 |
844 name = Symbols::New("double"); | 844 name = Symbols::New("double"); |
845 cls = Class::New<Instance>(name, script, Scanner::kDummyTokenIndex); | 845 cls = Class::New<Instance>(name, script, Scanner::kDummyTokenIndex); |
846 RegisterClass(cls, name, core_lib); | 846 RegisterClass(cls, name, core_lib); |
847 pending_classes.Add(cls, Heap::kOld); | 847 pending_classes.Add(cls, Heap::kOld); |
848 type = Type::NewNonParameterizedType(cls); | 848 type = Type::NewNonParameterizedType(cls); |
849 object_store->set_double_type(type); | 849 object_store->set_double_type(type); |
850 | 850 |
851 cls = CreateAndRegisterInterface("String", script, core_lib); | 851 name = Symbols::New("String"); |
| 852 cls = Class::New<Instance>(name, script, Scanner::kDummyTokenIndex); |
| 853 RegisterClass(cls, name, core_lib); |
852 pending_classes.Add(cls, Heap::kOld); | 854 pending_classes.Add(cls, Heap::kOld); |
853 type = Type::NewNonParameterizedType(cls); | 855 type = Type::NewNonParameterizedType(cls); |
854 object_store->set_string_interface(type); | 856 object_store->set_string_type(type); |
855 | 857 |
856 cls = CreateAndRegisterInterface("List", script, core_lib); | 858 cls = CreateAndRegisterInterface("List", script, core_lib); |
857 pending_classes.Add(cls, Heap::kOld); | 859 pending_classes.Add(cls, Heap::kOld); |
858 type = Type::NewNonParameterizedType(cls); | 860 type = Type::NewNonParameterizedType(cls); |
859 object_store->set_list_interface(type); | 861 object_store->set_list_interface(type); |
860 | 862 |
861 cls = object_store->bool_class(); | 863 cls = object_store->bool_class(); |
862 type = Type::NewNonParameterizedType(cls); | 864 type = Type::NewNonParameterizedType(cls); |
863 object_store->set_bool_type(type); | 865 object_store->set_bool_type(type); |
864 | 866 |
(...skipping 7494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8359 (type_class() == Type::Handle(Type::Double()).type_class()); | 8361 (type_class() == Type::Handle(Type::Double()).type_class()); |
8360 } | 8362 } |
8361 | 8363 |
8362 | 8364 |
8363 bool AbstractType::IsNumberType() const { | 8365 bool AbstractType::IsNumberType() const { |
8364 return HasResolvedTypeClass() && | 8366 return HasResolvedTypeClass() && |
8365 (type_class() == Type::Handle(Type::Number()).type_class()); | 8367 (type_class() == Type::Handle(Type::Number()).type_class()); |
8366 } | 8368 } |
8367 | 8369 |
8368 | 8370 |
8369 bool AbstractType::IsStringInterface() const { | 8371 bool AbstractType::IsStringType() const { |
8370 return HasResolvedTypeClass() && | 8372 return HasResolvedTypeClass() && |
8371 (type_class() == Type::Handle(Type::StringInterface()).type_class()); | 8373 (type_class() == Type::Handle(Type::StringType()).type_class()); |
8372 } | 8374 } |
8373 | 8375 |
8374 | 8376 |
8375 bool AbstractType::IsFunctionType() const { | 8377 bool AbstractType::IsFunctionType() const { |
8376 return HasResolvedTypeClass() && | 8378 return HasResolvedTypeClass() && |
8377 (type_class() == Type::Handle(Type::Function()).type_class()); | 8379 (type_class() == Type::Handle(Type::Function()).type_class()); |
8378 } | 8380 } |
8379 | 8381 |
8380 | 8382 |
8381 bool AbstractType::IsListInterface() const { | 8383 bool AbstractType::IsListInterface() const { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8498 RawType* Type::Double() { | 8500 RawType* Type::Double() { |
8499 return Isolate::Current()->object_store()->double_type(); | 8501 return Isolate::Current()->object_store()->double_type(); |
8500 } | 8502 } |
8501 | 8503 |
8502 | 8504 |
8503 RawType* Type::Number() { | 8505 RawType* Type::Number() { |
8504 return Isolate::Current()->object_store()->number_type(); | 8506 return Isolate::Current()->object_store()->number_type(); |
8505 } | 8507 } |
8506 | 8508 |
8507 | 8509 |
8508 RawType* Type::StringInterface() { | 8510 RawType* Type::StringType() { |
8509 return Isolate::Current()->object_store()->string_interface(); | 8511 return Isolate::Current()->object_store()->string_type(); |
8510 } | 8512 } |
8511 | 8513 |
8512 | 8514 |
8513 RawType* Type::Function() { | 8515 RawType* Type::Function() { |
8514 return Isolate::Current()->object_store()->function_type(); | 8516 return Isolate::Current()->object_store()->function_type(); |
8515 } | 8517 } |
8516 | 8518 |
8517 | 8519 |
8518 RawType* Type::ListInterface() { | 8520 RawType* Type::ListInterface() { |
8519 return Isolate::Current()->object_store()->list_interface(); | 8521 return Isolate::Current()->object_store()->list_interface(); |
(...skipping 3652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12172 } | 12174 } |
12173 return result.raw(); | 12175 return result.raw(); |
12174 } | 12176 } |
12175 | 12177 |
12176 | 12178 |
12177 const char* WeakProperty::ToCString() const { | 12179 const char* WeakProperty::ToCString() const { |
12178 return "_WeakProperty"; | 12180 return "_WeakProperty"; |
12179 } | 12181 } |
12180 | 12182 |
12181 } // namespace dart | 12183 } // namespace dart |
OLD | NEW |