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

Unified Diff: runtime/vm/raw_object.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.h
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 4362f59279bc2ca6c707c84182e0d413a3a80a40..b23014cf1d2fb32296db2a661eac0e69ee0be88b 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -919,8 +919,7 @@ class RawClosureData : public RawObject {
RawObject** to_snapshot() {
return reinterpret_cast<RawObject**>(&ptr()->closure_);
}
- RawObject* hash_;
- RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->hash_); }
+ RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->closure_); }
friend class Function;
};
@@ -1799,16 +1798,18 @@ class RawClosure : public RawInstance {
return reinterpret_cast<RawObject**>(&ptr()->instantiator_type_arguments_);
}
- // No instance fields should be declared before the following 4 fields whose
+ // No instance fields should be declared before the following fields whose
// offsets must be identical in Dart and C++.
- // These 4 fields are also declared in the Dart source of class _Closure.
+ // The following fields are also declared in the Dart source of class
+ // _Closure.
RawTypeArguments* instantiator_type_arguments_;
RawTypeArguments* function_type_arguments_;
RawFunction* function_;
RawContext* context_;
+ RawSmi* hash_;
- RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->context_); }
+ RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->hash_); }
// Note that instantiator_type_arguments_ and function_type_arguments_ are
// used to instantiate the signature of function_ when this closure is
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698