| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 if (strncmp(func, "dart::", 6) == 0) { | 48 if (strncmp(func, "dart::", 6) == 0) { |
| 49 return func + 6; | 49 return func + 6; |
| 50 } else { | 50 } else { |
| 51 return func; | 51 return func; |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 static RawInstance* GetListInstance(Isolate* isolate, const Object& obj) { | 56 static RawInstance* GetListInstance(Isolate* isolate, const Object& obj) { |
| 57 if (obj.IsInstance()) { | 57 if (obj.IsInstance()) { |
| 58 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
| 59 const Class& list_class = |
| 60 Class::Handle(core_lib.LookupClass(Symbols::List())); |
| 61 ASSERT(!list_class.IsNull()); |
| 58 const Instance& instance = Instance::Cast(obj); | 62 const Instance& instance = Instance::Cast(obj); |
| 59 const Class& obj_class = Class::Handle(isolate, obj.clazz()); | 63 const Class& obj_class = Class::Handle(isolate, obj.clazz()); |
| 60 const Class& list_class = | |
| 61 Class::Handle(isolate, isolate->object_store()->list_class()); | |
| 62 Error& malformed_type_error = Error::Handle(isolate); | 64 Error& malformed_type_error = Error::Handle(isolate); |
| 63 if (obj_class.IsSubtypeOf(TypeArguments::Handle(isolate), | 65 if (obj_class.IsSubtypeOf(TypeArguments::Handle(isolate), |
| 64 list_class, | 66 list_class, |
| 65 TypeArguments::Handle(isolate), | 67 TypeArguments::Handle(isolate), |
| 66 &malformed_type_error)) { | 68 &malformed_type_error)) { |
| 67 ASSERT(malformed_type_error.IsNull()); // Type is a raw List. | 69 ASSERT(malformed_type_error.IsNull()); // Type is a raw List. |
| 68 return instance.raw(); | 70 return instance.raw(); |
| 69 } | 71 } |
| 70 } | 72 } |
| 71 return Instance::null(); | 73 return Instance::null(); |
| (...skipping 3921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3993 } | 3995 } |
| 3994 { | 3996 { |
| 3995 NoGCScope no_gc; | 3997 NoGCScope no_gc; |
| 3996 RawObject* raw_obj = obj.raw(); | 3998 RawObject* raw_obj = obj.raw(); |
| 3997 isolate->heap()->SetPeer(raw_obj, peer); | 3999 isolate->heap()->SetPeer(raw_obj, peer); |
| 3998 } | 4000 } |
| 3999 return Api::Success(); | 4001 return Api::Success(); |
| 4000 } | 4002 } |
| 4001 | 4003 |
| 4002 } // namespace dart | 4004 } // namespace dart |
| OLD | NEW |