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

Unified Diff: runtime/vm/object.h

Issue 15743017: Adds a flag to the standalone vm to throw an exception on 53-bit integer overflow. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
===================================================================
--- runtime/vm/object.h (revision 23032)
+++ runtime/vm/object.h (working copy)
@@ -3927,9 +3927,14 @@
static RawInteger* New(int64_t value, Heap::Space space = Heap::kNew);
+ // Check if an Integer exceeds 53 bits, and if so throw an exception.
+ static void CheckForFiftyThreeBitOverflow(const Integer& i, const char* msg);
+
virtual double AsDoubleValue() const;
virtual int64_t AsInt64Value() const;
+ virtual bool FitsIn53Bits() const;
+
// Returns 0, -1 or 1.
virtual int CompareWith(const Integer& other) const;
@@ -3969,6 +3974,8 @@
virtual double AsDoubleValue() const;
virtual int64_t AsInt64Value() const;
+ virtual bool FitsIn53Bits() const { return true; }
+
virtual int CompareWith(const Integer& other) const;
static intptr_t InstanceSize() { return 0; }
@@ -4050,6 +4057,8 @@
virtual double AsDoubleValue() const;
virtual int64_t AsInt64Value() const;
+ virtual bool FitsIn53Bits() const;
+
virtual int CompareWith(const Integer& other) const;
static intptr_t InstanceSize() {
@@ -4087,6 +4096,8 @@
virtual double AsDoubleValue() const;
virtual int64_t AsInt64Value() const;
+ virtual bool FitsIn53Bits() const { return false; }
+
virtual int CompareWith(const Integer& other) const;
static const intptr_t kBytesPerElement = kChunkSize;

Powered by Google App Engine
This is Rietveld 408576698