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

Side by Side Diff: runtime/lib/object_patch.dart

Issue 2941643002: Check for a passed-in type argument vector in the prolog of generic functions. (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
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 @patch 5 @patch
6 class Object { 6 class Object {
7 // The VM has its own implementation of equals. 7 // The VM has its own implementation of equals.
8 @patch 8 @patch
9 bool operator ==(other) native "Object_equals"; 9 bool operator ==(other) native "Object_equals";
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 invocation._type, 50 invocation._type,
51 invocation.positionalArguments, 51 invocation.positionalArguments,
52 _symbolMapToStringMap(invocation.namedArguments)); 52 _symbolMapToStringMap(invocation.namedArguments));
53 } 53 }
54 54
55 @patch 55 @patch
56 Type get runtimeType native "Object_runtimeType"; 56 Type get runtimeType native "Object_runtimeType";
57 57
58 static bool _haveSameRuntimeType(a, b) native "Object_haveSameRuntimeType"; 58 static bool _haveSameRuntimeType(a, b) native "Object_haveSameRuntimeType";
59 59
60 // Prepend the parent type arguments (maybe null) to the function type
61 // arguments (may be null). The result is null if both input vectors are null
62 // or is a newly allocated and canonicalized vector of length 'len'.
63 static _prependTypeArguments(functionTypeArguments, parentTypeArguments, len)
Vyacheslav Egorov (Google) 2017/06/15 14:05:44 Is it possible to put this into dart:_internal ins
regis 2017/06/15 21:38:26 Yes, definitely. I did not know of the existence o
64 native "Object_prependTypeArguments";
65
60 // Call this function instead of inlining instanceof, thus collecting 66 // Call this function instead of inlining instanceof, thus collecting
61 // type feedback and reducing code size of unoptimized code. 67 // type feedback and reducing code size of unoptimized code.
62 bool _instanceOf(instantiator_type_arguments, function_type_arguments, type) 68 bool _instanceOf(instantiatorTypeArguments, functionTypeArguments, type)
63 native "Object_instanceOf"; 69 native "Object_instanceOf";
64 70
65 // Group of functions for implementing fast simple instance of. 71 // Group of functions for implementing fast simple instance of.
66 bool _simpleInstanceOf(type) native "Object_simpleInstanceOf"; 72 bool _simpleInstanceOf(type) native "Object_simpleInstanceOf";
67 bool _simpleInstanceOfTrue(type) => true; 73 bool _simpleInstanceOfTrue(type) => true;
68 bool _simpleInstanceOfFalse(type) => false; 74 bool _simpleInstanceOfFalse(type) => false;
69 75
70 // Call this function instead of inlining 'as', thus collecting type 76 // Call this function instead of inlining 'as', thus collecting type
71 // feedback. Returns receiver. 77 // feedback. Returns receiver.
72 _as(instantiator_type_arguments, function_type_arguments, type) 78 _as(instantiatorTypeArguments, functionTypeArguments, type)
73 native "Object_as"; 79 native "Object_as";
74 80
75 static _symbolMapToStringMap(Map<Symbol, dynamic> map) { 81 static _symbolMapToStringMap(Map<Symbol, dynamic> map) {
76 var result = new Map<String, dynamic>(); 82 var result = new Map<String, dynamic>();
77 map.forEach((Symbol key, value) { 83 map.forEach((Symbol key, value) {
78 result[internal.Symbol.getName(key)] = value; 84 result[internal.Symbol.getName(key)] = value;
79 }); 85 });
80 return result; 86 return result;
81 } 87 }
82 } 88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698