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

Unified Diff: runtime/vm/object.h

Issue 2992013002: [vm] Change TypedData_getUint64 native method to silently cast values (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 ed2c2c13ce9c63bf2b246838ef52332f122e69b2..105de78e6e086fe44e4a960c186c3c9238e800f7 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -6422,6 +6422,10 @@ class Number : public Instance {
class Integer : public Number {
public:
static RawInteger* New(const String& str, Heap::Space space = Heap::kNew);
+
+ // Creates a new Integer by given uint64_t value.
+ // In the --limit-ints-to-64-bits mode silently casts value to int64_t
+ // (with wrap-around if it is greater than kMaxInt64).
static RawInteger* NewFromUint64(uint64_t value,
Heap::Space space = Heap::kNew);
@@ -6431,6 +6435,9 @@ class Integer : public Number {
static RawInteger* New(int64_t value, Heap::Space space = Heap::kNew);
+ // Returns true iff the given uint64_t value is representable as Dart integer.
+ static bool IsValidUint64(uint64_t value);
+
virtual bool OperatorEquals(const Instance& other) const {
return Equals(other);
}

Powered by Google App Engine
This is Rietveld 408576698