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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 str_obj.MakeExternal(array, length, peer, cback)); | 1753 str_obj.MakeExternal(array, length, peer, cback)); |
1754 } | 1754 } |
1755 | 1755 |
1756 | 1756 |
1757 // --- Lists --- | 1757 // --- Lists --- |
1758 | 1758 |
1759 | 1759 |
1760 static RawInstance* GetListInstance(Isolate* isolate, const Object& obj) { | 1760 static RawInstance* GetListInstance(Isolate* isolate, const Object& obj) { |
1761 if (obj.IsInstance()) { | 1761 if (obj.IsInstance()) { |
1762 const Instance& instance = Instance::Cast(obj); | 1762 const Instance& instance = Instance::Cast(obj); |
1763 const Type& type = | 1763 const Class& obj_class = Class::Handle(isolate, obj.clazz()); |
1764 Type::Handle(isolate, isolate->object_store()->list_interface()); | 1764 const Class& list_class = |
| 1765 Class::Handle(isolate, isolate->object_store()->list_class()); |
1765 Error& malformed_type_error = Error::Handle(isolate); | 1766 Error& malformed_type_error = Error::Handle(isolate); |
1766 if (instance.IsInstanceOf(type, | 1767 if (obj_class.IsSubtypeOf(TypeArguments::Handle(isolate), |
| 1768 list_class, |
1767 TypeArguments::Handle(isolate), | 1769 TypeArguments::Handle(isolate), |
1768 &malformed_type_error)) { | 1770 &malformed_type_error)) { |
1769 ASSERT(malformed_type_error.IsNull()); // Type is a raw List. | 1771 ASSERT(malformed_type_error.IsNull()); // Type is a raw List. |
1770 return instance.raw(); | 1772 return instance.raw(); |
1771 } | 1773 } |
1772 } | 1774 } |
1773 return Instance::null(); | 1775 return Instance::null(); |
1774 } | 1776 } |
1775 | 1777 |
1776 | 1778 |
(...skipping 2713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4490 } | 4492 } |
4491 { | 4493 { |
4492 NoGCScope no_gc; | 4494 NoGCScope no_gc; |
4493 RawObject* raw_obj = obj.raw(); | 4495 RawObject* raw_obj = obj.raw(); |
4494 isolate->heap()->SetPeer(raw_obj, peer); | 4496 isolate->heap()->SetPeer(raw_obj, peer); |
4495 } | 4497 } |
4496 return Api::Success(isolate); | 4498 return Api::Success(isolate); |
4497 } | 4499 } |
4498 | 4500 |
4499 } // namespace dart | 4501 } // namespace dart |
OLD | NEW |