| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/bigint_operations.h" | 5 #include "vm/bigint_operations.h" |
| 6 | 6 |
| 7 #include <openssl/crypto.h> | 7 #include <openssl/crypto.h> |
| 8 | 8 |
| 9 #include "platform/utils.h" |
| 9 #include "vm/bigint_store.h" | 10 #include "vm/bigint_store.h" |
| 10 #include "vm/double_internals.h" | 11 #include "vm/double_internals.h" |
| 11 #include "vm/exceptions.h" | 12 #include "vm/exceptions.h" |
| 12 #include "vm/utils.h" | |
| 13 #include "vm/zone.h" | 13 #include "vm/zone.h" |
| 14 | 14 |
| 15 namespace dart { | 15 namespace dart { |
| 16 | 16 |
| 17 bool Bigint::IsZero() const { return BN_is_zero(BNAddr()); } | 17 bool Bigint::IsZero() const { return BN_is_zero(BNAddr()); } |
| 18 bool Bigint::IsNegative() const { return !!BNAddr()->neg; } | 18 bool Bigint::IsNegative() const { return !!BNAddr()->neg; } |
| 19 | 19 |
| 20 | 20 |
| 21 void Bigint::SetSign(bool is_negative) const { | 21 void Bigint::SetSign(bool is_negative) const { |
| 22 BIGNUM* bn = MutableBNAddr(); | 22 BIGNUM* bn = MutableBNAddr(); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 result.ToggleSign(); | 590 result.ToggleSign(); |
| 591 return result.raw(); | 591 return result.raw(); |
| 592 } | 592 } |
| 593 | 593 |
| 594 | 594 |
| 595 int BigintOperations::Compare(const Bigint& a, const Bigint& b) { | 595 int BigintOperations::Compare(const Bigint& a, const Bigint& b) { |
| 596 return BN_cmp(a.BNAddr(), b.BNAddr()); | 596 return BN_cmp(a.BNAddr(), b.BNAddr()); |
| 597 } | 597 } |
| 598 | 598 |
| 599 } // namespace dart | 599 } // namespace dart |
| OLD | NEW |