| 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 // Helpers used to implement hashCode. If a hashCode is used we remember it | 7 // Helpers used to implement hashCode. If a hashCode is used we remember it |
| 8 // using an Expando object. A new hashCode value is calculated using a Random | 8 // using an Expando object. A new hashCode value is calculated using a Random |
| 9 // number generator. | 9 // number generator. |
| 10 static Expando _hashCodeExp = new Expando("Object.hashCode"); | 10 static Expando _hashCodeExp = new Expando("Object.hashCode"); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 return result; | 22 return result; |
| 23 } | 23 } |
| 24 | 24 |
| 25 /* patch */ String toString() native "Object_toString"; | 25 /* patch */ String toString() native "Object_toString"; |
| 26 // A statically dispatched version of Object.toString. | 26 // A statically dispatched version of Object.toString. |
| 27 static String _toString(obj) native "Object_toString"; | 27 static String _toString(obj) native "Object_toString"; |
| 28 | 28 |
| 29 _noSuchMethod(bool isMethod, | 29 _noSuchMethod(bool isMethod, |
| 30 String memberName, | 30 String memberName, |
| 31 int type, |
| 31 List arguments, | 32 List arguments, |
| 32 Map<String, dynamic> namedArguments) | 33 Map<String, dynamic> namedArguments) |
| 33 native "Object_noSuchMethod"; | 34 native "Object_noSuchMethod"; |
| 34 | 35 |
| 35 /* patch */ noSuchMethod(InvocationMirror invocation) { | 36 /* patch */ noSuchMethod(InvocationMirror invocation) { |
| 36 return _noSuchMethod(invocation.isMethod, | 37 return _noSuchMethod(invocation.isMethod, |
| 37 invocation.memberName, | 38 invocation.memberName, |
| 39 invocation._type, |
| 38 invocation.positionalArguments, | 40 invocation.positionalArguments, |
| 39 invocation.namedArguments); | 41 invocation.namedArguments); |
| 40 } | 42 } |
| 41 | 43 |
| 42 // Call this function instead of inlining instanceof, thus collecting | 44 // Call this function instead of inlining instanceof, thus collecting |
| 43 // type feedback and reducing code size of unoptimized code. | 45 // type feedback and reducing code size of unoptimized code. |
| 44 _instanceOf(instantiator, | 46 _instanceOf(instantiator, |
| 45 instantiator_type_arguments, | 47 instantiator_type_arguments, |
| 46 type, | 48 type, |
| 47 bool negate) | 49 bool negate) |
| 48 native "Object_instanceOf"; | 50 native "Object_instanceOf"; |
| 49 | 51 |
| 50 /* patch */ Type get runtimeType native "Object_runtimeType"; | 52 /* patch */ Type get runtimeType native "Object_runtimeType"; |
| 51 } | 53 } |
| OLD | NEW |