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 bool operator ==(other) native "Object_equals"; | 8 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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 _noSuchMethod(bool isMethod, | 37 _noSuchMethod(bool isMethod, |
38 String memberName, | 38 String memberName, |
39 int type, | 39 int type, |
40 List arguments, | 40 List arguments, |
41 Map<String, dynamic> namedArguments) | 41 Map<String, dynamic> namedArguments) |
42 native "Object_noSuchMethod"; | 42 native "Object_noSuchMethod"; |
43 | 43 |
44 /* patch */ noSuchMethod(Invocation invocation) { | 44 /* patch */ noSuchMethod(Invocation invocation) { |
45 return _noSuchMethod(invocation.isMethod, | 45 return _noSuchMethod(invocation.isMethod, |
46 _collection_dev.Symbol.getName(invocation.memberName), | 46 internal.Symbol.getName(invocation.memberName), |
47 invocation._type, | 47 invocation._type, |
48 invocation.positionalArguments, | 48 invocation.positionalArguments, |
49 _symbolMapToStringMap(invocation.namedArguments)); | 49 _symbolMapToStringMap(invocation.namedArguments)); |
50 } | 50 } |
51 | 51 |
52 /* patch */ Type get runtimeType native "Object_runtimeType"; | 52 /* patch */ Type get runtimeType native "Object_runtimeType"; |
53 | 53 |
54 // Call this function instead of inlining instanceof, thus collecting | 54 // Call this function instead of inlining instanceof, thus collecting |
55 // type feedback and reducing code size of unoptimized code. | 55 // type feedback and reducing code size of unoptimized code. |
56 bool _instanceOf(instantiator, | 56 bool _instanceOf(instantiator, |
57 instantiator_type_arguments, | 57 instantiator_type_arguments, |
58 type, | 58 type, |
59 bool negate) | 59 bool negate) |
60 native "Object_instanceOf"; | 60 native "Object_instanceOf"; |
61 | 61 |
62 // Call this function instead of inlining 'as', thus collecting type | 62 // Call this function instead of inlining 'as', thus collecting type |
63 // feedback. Returns receiver. | 63 // feedback. Returns receiver. |
64 _as(instantiator, instantiator_type_arguments, type) native "Object_as"; | 64 _as(instantiator, instantiator_type_arguments, type) native "Object_as"; |
65 | 65 |
66 static _symbolMapToStringMap(Map<Symbol, dynamic> map) { | 66 static _symbolMapToStringMap(Map<Symbol, dynamic> map) { |
67 var result = new Map<String, dynamic>(); | 67 var result = new Map<String, dynamic>(); |
68 map.forEach((Symbol key, value) { | 68 map.forEach((Symbol key, value) { |
69 result[_collection_dev.Symbol.getName(key)] = value; | 69 result[internal.Symbol.getName(key)] = value; |
70 }); | 70 }); |
71 return result; | 71 return result; |
72 } | 72 } |
73 | 73 |
74 int get _cid native "Object_cid"; | 74 int get _cid native "Object_cid"; |
75 | 75 |
76 _leftShiftWithMask32(count, mask) { | 76 _leftShiftWithMask32(count, mask) { |
77 return (this << count) & mask; | 77 return (this << count) & mask; |
78 } | 78 } |
79 } | 79 } |
OLD | NEW |