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

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

Issue 27307005: Change == into an instance call to allow polymorphic inlining of ==. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased, addressed comments Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « runtime/lib/object.cc ('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) 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 it's own implemention of equals.
8 bool operator ==(other) native "Object_equals";
9
7 // 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
8 // in a weak table in the VM. A new hashCode value is calculated using a 11 // in a weak table in the VM. A new hashCode value is calculated using a
9 // number generator. 12 // number generator.
10 static final _hashCodeRnd = new Random(); 13 static final _hashCodeRnd = new Random();
11 14
12 static _getHash(obj) native "Object_getHash"; 15 static _getHash(obj) native "Object_getHash";
13 static _setHash(obj, hash) native "Object_setHash"; 16 static _setHash(obj, hash) native "Object_setHash";
14 17
15 /* patch */ int get hashCode => _identityHashCode; 18 /* patch */ int get hashCode => _identityHashCode;
16 19
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 }); 70 });
68 return result; 71 return result;
69 } 72 }
70 73
71 int get _cid native "Object_cid"; 74 int get _cid native "Object_cid";
72 75
73 _leftShiftWithMask32(count, mask) { 76 _leftShiftWithMask32(count, mask) {
74 return (this << count) & mask; 77 return (this << count) & mask;
75 } 78 }
76 } 79 }
OLDNEW
« no previous file with comments | « runtime/lib/object.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698