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 3737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3748 // Set up the type arguments array. | 3748 // Set up the type arguments array. |
3749 type_args_obj ^= TypeArguments::New(num_expected_type_arguments); | 3749 type_args_obj ^= TypeArguments::New(num_expected_type_arguments); |
3750 AbstractType& type_arg = AbstractType::Handle(); | 3750 AbstractType& type_arg = AbstractType::Handle(); |
3751 for (intptr_t i = 0; i < number_of_type_arguments; i++) { | 3751 for (intptr_t i = 0; i < number_of_type_arguments; i++) { |
3752 type_arg ^= array.At(i); | 3752 type_arg ^= array.At(i); |
3753 type_args_obj.SetTypeAt(i, type_arg); | 3753 type_args_obj.SetTypeAt(i, type_arg); |
3754 } | 3754 } |
3755 } | 3755 } |
3756 | 3756 |
3757 // Construct the type object, canonicalize it and return. | 3757 // Construct the type object, canonicalize it and return. |
3758 const Type& instantiated_type = Type::Handle( | 3758 Type& instantiated_type = Type::Handle( |
3759 Type::New(cls, type_args_obj, Scanner::kDummyTokenIndex)); | 3759 Type::New(cls, type_args_obj, Scanner::kDummyTokenIndex)); |
3760 ClassFinalizer::FinalizeType(cls, | 3760 instantiated_type ^= ClassFinalizer::FinalizeType( |
3761 instantiated_type, | 3761 cls, instantiated_type, ClassFinalizer::kCanonicalize); |
3762 ClassFinalizer::kCanonicalize); | |
3763 return Api::NewHandle(isolate, instantiated_type.raw()); | 3762 return Api::NewHandle(isolate, instantiated_type.raw()); |
3764 } | 3763 } |
3765 | 3764 |
3766 | 3765 |
3767 DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library) { | 3766 DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library) { |
3768 Isolate* isolate = Isolate::Current(); | 3767 Isolate* isolate = Isolate::Current(); |
3769 DARTSCOPE(isolate); | 3768 DARTSCOPE(isolate); |
3770 const Library& lib = Api::UnwrapLibraryHandle(isolate, library); | 3769 const Library& lib = Api::UnwrapLibraryHandle(isolate, library); |
3771 if (lib.IsNull()) { | 3770 if (lib.IsNull()) { |
3772 RETURN_TYPE_ERROR(isolate, library, Library); | 3771 RETURN_TYPE_ERROR(isolate, library, Library); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3988 } | 3987 } |
3989 { | 3988 { |
3990 NoGCScope no_gc; | 3989 NoGCScope no_gc; |
3991 RawObject* raw_obj = obj.raw(); | 3990 RawObject* raw_obj = obj.raw(); |
3992 isolate->heap()->SetPeer(raw_obj, peer); | 3991 isolate->heap()->SetPeer(raw_obj, peer); |
3993 } | 3992 } |
3994 return Api::Success(); | 3993 return Api::Success(); |
3995 } | 3994 } |
3996 | 3995 |
3997 } // namespace dart | 3996 } // namespace dart |
OLD | NEW |