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

Side by Side Diff: runtime/vm/isolate_reload.cc

Issue 2988493002: Reapply "Improve hashCode for closure objects" with fixes. (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « runtime/vm/dart_entry.cc ('k') | runtime/vm/object.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 #include "vm/isolate_reload.h" 5 #include "vm/isolate_reload.h"
6 6
7 #include "vm/become.h" 7 #include "vm/become.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 if (obj.IsLibrary()) { 350 if (obj.IsLibrary()) {
351 return Library::Cast(obj).UrlHash(); 351 return Library::Cast(obj).UrlHash();
352 } else if (obj.IsClass()) { 352 } else if (obj.IsClass()) {
353 if (Class::Cast(obj).id() == kFreeListElement) { 353 if (Class::Cast(obj).id() == kFreeListElement) {
354 return 0; 354 return 0;
355 } 355 }
356 return String::HashRawSymbol(Class::Cast(obj).Name()); 356 return String::HashRawSymbol(Class::Cast(obj).Name());
357 } else if (obj.IsField()) { 357 } else if (obj.IsField()) {
358 return String::HashRawSymbol(Field::Cast(obj).name()); 358 return String::HashRawSymbol(Field::Cast(obj).name());
359 } else if (obj.IsInstance()) { 359 } else if (obj.IsInstance()) {
360 return Smi::Handle(Smi::RawCast(Instance::Cast(obj).HashCode())).Value(); 360 Object& hashObj = Object::Handle(Instance::Cast(obj).HashCode());
361 if (hashObj.IsError()) {
362 Exceptions::PropagateError(Error::Cast(hashObj));
363 }
364 return Smi::Cast(hashObj).Value();
361 } 365 }
362 return 0; 366 return 0;
363 } 367 }
364 }; 368 };
365 369
366 bool IsolateReloadContext::IsSameField(const Field& a, const Field& b) { 370 bool IsolateReloadContext::IsSameField(const Field& a, const Field& b) {
367 if (a.is_static() != b.is_static()) { 371 if (a.is_static() != b.is_static()) {
368 return false; 372 return false;
369 } 373 }
370 const Class& a_cls = Class::Handle(a.Owner()); 374 const Class& a_cls = Class::Handle(a.Owner());
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 ASSERT(!super_cls.IsNull()); 1822 ASSERT(!super_cls.IsNull());
1819 super_cls.AddDirectSubclass(cls); 1823 super_cls.AddDirectSubclass(cls);
1820 } 1824 }
1821 } 1825 }
1822 } 1826 }
1823 } 1827 }
1824 1828
1825 #endif // !PRODUCT 1829 #endif // !PRODUCT
1826 1830
1827 } // namespace dart 1831 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_entry.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698