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

Unified Diff: runtime/vm/object.cc

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.cc
===================================================================
--- runtime/vm/object.cc (revision 23032)
+++ runtime/vm/object.cc (working copy)
@@ -10398,6 +10398,12 @@
}
+bool Integer::FitsIn53Bits() const {
+ UNIMPLEMENTED();
+ return false;
+}
+
+
int Integer::CompareWith(const Integer& other) const {
UNIMPLEMENTED();
return 0;
@@ -10772,6 +10778,12 @@
}
+bool Mint::FitsIn53Bits() const {
+ int64_t v = AsInt64Value();
+ return Utils::IsInt(53, v);
+}
+
+
int Mint::CompareWith(const Integer& other) const {
ASSERT(!FitsIntoSmi(*this));
if (other.IsMint() || other.IsSmi()) {
« runtime/lib/typed_data.cc ('K') | « runtime/vm/object.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698