Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: runtime/lib/object.cc

Issue 3007603002: [VM generic function reification] Support generic functions in Invocation class. (Closed)
Patch Set: address review comment Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/lib/invocation_mirror_patch.dart ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « runtime/lib/invocation_mirror_patch.dart ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698