| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/exceptions.h" | 9 #include "vm/exceptions.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 } | 372 } |
| 373 for (intptr_t i = split; i < len; i++) { | 373 for (intptr_t i = split; i < len; i++) { |
| 374 type = function_type_arguments.IsNull() | 374 type = function_type_arguments.IsNull() |
| 375 ? Type::DynamicType() | 375 ? Type::DynamicType() |
| 376 : function_type_arguments.TypeAt(i - split); | 376 : function_type_arguments.TypeAt(i - split); |
| 377 result.SetTypeAt(i, type); | 377 result.SetTypeAt(i, type); |
| 378 } | 378 } |
| 379 return result.Canonicalize(); | 379 return result.Canonicalize(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 DEFINE_NATIVE_ENTRY(InvocationMirror_unpackTypeArguments, 1) { |
| 383 const TypeArguments& type_arguments = |
| 384 TypeArguments::CheckedHandle(zone, arguments->NativeArgAt(0)); |
| 385 const intptr_t len = type_arguments.Length(); |
| 386 ASSERT(len > 0); |
| 387 const Array& type_list = Array::Handle(zone, Array::New(len)); |
| 388 AbstractType& type = AbstractType::Handle(zone); |
| 389 for (intptr_t i = 0; i < len; i++) { |
| 390 type = type_arguments.TypeAt(i); |
| 391 type_list.SetAt(i, type); |
| 392 } |
| 393 type_list.MakeImmutable(); |
| 394 return type_list.raw(); |
| 395 } |
| 396 |
| 382 } // namespace dart | 397 } // namespace dart |
| OLD | NEW |