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

Unified Diff: runtime/vm/object.h

Issue 2983823002: Improve hashCode for closures (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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 719af78f7a40113544473225756f22213f1bfee9..49fce57792ca7df757245ea09b350743540b6245 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -2402,7 +2402,7 @@ class Function : public Object {
RawInstance* ImplicitInstanceClosure(const Instance& receiver) const;
- RawSmi* GetClosureHashCode() const;
+ intptr_t GetClosureHashCode() const;
// Redirection information for a redirecting factory.
bool IsRedirectingFactory() const;
@@ -3072,9 +3072,6 @@ class ClosureData : public Object {
RawInstance* implicit_static_closure() const { return raw_ptr()->closure_; }
void set_implicit_static_closure(const Instance& closure) const;
- RawObject* hash() const { return raw_ptr()->hash_; }
- void set_hash(intptr_t value) const;
-
static RawClosureData* New();
FINAL_HEAP_OBJECT_IMPLEMENTATION(ClosureData, Object);
@@ -5532,6 +5529,9 @@ class Instance : public Object {
// Equivalent to invoking hashCode on this instance.
virtual RawObject* HashCode() const;
+ // Equivalent to invoking identityHashCode on this instance.
rmacnak 2017/07/19 01:00:24 with this instance.
alexmarkov 2017/07/19 17:54:19 Done.
+ RawObject* IdentityHashCode() const;
+
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(RawInstance));
}
@@ -8340,6 +8340,11 @@ class Closure : public Instance {
RawContext* context() const { return raw_ptr()->context_; }
static intptr_t context_offset() { return OFFSET_OF(RawClosure, context_); }
+ RawInteger* cached_hash_code() const { return raw_ptr()->cached_hash_code_; }
rmacnak 2017/07/19 01:00:24 RawSmi*
alexmarkov 2017/07/19 17:54:19 Done.
+ static intptr_t cached_hash_code_offset() {
+ return OFFSET_OF(RawClosure, cached_hash_code_);
+ }
+
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(RawClosure));
}

Powered by Google App Engine
This is Rietveld 408576698