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

Unified Diff: runtime/vm/object.h

Issue 1754813004: Add thread safe constant canonicalization. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Move allocation Created 4 years, 10 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/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index c9f98b7a2f751dd8ff3ecf6838ecc857767de659..3c2b7c20a13e2194fcb94969c143bc3a61492201 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -1201,6 +1201,21 @@ class Class : public Object {
RawLibraryPrefix* LookupLibraryPrefix(const String& name) const;
+ // Returns an instance of Double or Double::null().
+ // 'index' points to either:
+ // - constants_list_ position of found element, or
+ // - constants_list_ position where new canonical can be inserted.
+ RawDouble* LookupCanonicalDouble(Zone* zone,
+ double value, intptr_t* index) const;
+ RawMint* LookupCanonicalMint(Zone* zone,
+ int64_t value, intptr_t* index) const;
+ RawBigint* LookupCanonicalBigint(Zone* zone,
+ const Bigint& value, intptr_t* index) const;
+ // The methods above are more efficient than this generic one.
+ RawInstance* LookupCanonicalInstance(Zone* zone,
+ const Instance& value,
+ intptr_t* index) const;
+
void InsertCanonicalConstant(intptr_t index, const Instance& constant) const;
intptr_t FindCanonicalTypeIndex(const AbstractType& needle) const;
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698