| Index: runtime/vm/object.cc
|
| ===================================================================
|
| --- runtime/vm/object.cc (revision 23032)
|
| +++ runtime/vm/object.cc (working copy)
|
| @@ -10386,6 +10386,17 @@
|
| }
|
|
|
|
|
| +// Throw kFiftyThreeBitOverflow if the result of an operation overflows
|
| +// 53 bits.
|
| +void Integer::CheckForFiftyThreeBitOverflow(const Integer& i, const char* msg) {
|
| + if (i.FitsIn53Bits()) return;
|
| + const Array& exc_args = Array::Handle(Array::New(1));
|
| + exc_args.SetAt(0, Object::Handle(String::New(msg)));
|
| + Exceptions::ThrowByType(Exceptions::kFiftyThreeBitOverflowError, exc_args);
|
| + return;
|
| +}
|
| +
|
| +
|
| double Integer::AsDoubleValue() const {
|
| UNIMPLEMENTED();
|
| return 0.0;
|
| @@ -10398,6 +10409,12 @@
|
| }
|
|
|
|
|
| +bool Integer::FitsIn53Bits() const {
|
| + UNIMPLEMENTED();
|
| + return false;
|
| +}
|
| +
|
| +
|
| int Integer::CompareWith(const Integer& other) const {
|
| UNIMPLEMENTED();
|
| return 0;
|
| @@ -10772,6 +10789,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()) {
|
|
|