OLD | NEW |
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 class Object { | 5 @patch class Object { |
6 | 6 |
7 // The VM has its own implementation of equals. | 7 // The VM has its own implementation of equals. |
8 @patch bool operator ==(other) native "Object_equals"; | 8 @patch bool operator ==(other) native "Object_equals"; |
9 | 9 |
10 // Helpers used to implement hashCode. If a hashCode is used, we remember it | 10 // Helpers used to implement hashCode. If a hashCode is used, we remember it |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 invocation.positionalArguments, | 50 invocation.positionalArguments, |
51 _symbolMapToStringMap(invocation.namedArguments)); | 51 _symbolMapToStringMap(invocation.namedArguments)); |
52 } | 52 } |
53 | 53 |
54 @patch Type get runtimeType native "Object_runtimeType"; | 54 @patch Type get runtimeType native "Object_runtimeType"; |
55 | 55 |
56 static bool _haveSameRuntimeType(a, b) native "Object_haveSameRuntimeType"; | 56 static bool _haveSameRuntimeType(a, b) native "Object_haveSameRuntimeType"; |
57 | 57 |
58 // Call this function instead of inlining instanceof, thus collecting | 58 // Call this function instead of inlining instanceof, thus collecting |
59 // type feedback and reducing code size of unoptimized code. | 59 // type feedback and reducing code size of unoptimized code. |
60 bool _instanceOf(instantiator_type_arguments, type) | 60 bool _instanceOf(instantiator_type_arguments, type, bool negate) |
61 native "Object_instanceOf"; | 61 native "Object_instanceOf"; |
62 | 62 |
63 // Group of functions for implementing fast simple instance of. | 63 // Group of functions for implementing fast simple instance of. |
64 bool _simpleInstanceOf(type) native "Object_simpleInstanceOf"; | 64 bool _simpleInstanceOf(type) native "Object_simpleInstanceOf"; |
65 bool _simpleInstanceOfTrue(type) => true; | 65 bool _simpleInstanceOfTrue(type) => true; |
66 bool _simpleInstanceOfFalse(type) => false; | 66 bool _simpleInstanceOfFalse(type) => false; |
67 | 67 |
| 68 bool _instanceOfDouble(bool negate) native "Object_instanceOfDouble"; |
| 69 bool _instanceOfNum(bool negate) native "Object_instanceOfNum"; |
| 70 bool _instanceOfInt(bool negate) native "Object_instanceOfInt"; |
| 71 bool _instanceOfSmi(bool negate) native "Object_instanceOfSmi"; |
| 72 bool _instanceOfString(bool negate) native "Object_instanceOfString"; |
| 73 |
68 // Call this function instead of inlining 'as', thus collecting type | 74 // Call this function instead of inlining 'as', thus collecting type |
69 // feedback. Returns receiver. | 75 // feedback. Returns receiver. |
70 _as(instantiator_type_arguments, type) native "Object_as"; | 76 _as(instantiator_type_arguments, type) native "Object_as"; |
71 | 77 |
72 static _symbolMapToStringMap(Map<Symbol, dynamic> map) { | 78 static _symbolMapToStringMap(Map<Symbol, dynamic> map) { |
73 var result = new Map<String, dynamic>(); | 79 var result = new Map<String, dynamic>(); |
74 map.forEach((Symbol key, value) { | 80 map.forEach((Symbol key, value) { |
75 result[internal.Symbol.getName(key)] = value; | 81 result[internal.Symbol.getName(key)] = value; |
76 }); | 82 }); |
77 return result; | 83 return result; |
78 } | 84 } |
79 } | 85 } |
OLD | NEW |