OLD | NEW |
1 // Copyright (c) 2012, 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 result.ToggleSign(); | 627 result.ToggleSign(); |
628 return result.raw(); | 628 return result.raw(); |
629 } | 629 } |
630 | 630 |
631 | 631 |
632 int BigintOperations::Compare(const Bigint& a, const Bigint& b) { | 632 int BigintOperations::Compare(const Bigint& a, const Bigint& b) { |
633 return BN_cmp(a.BNAddr(), b.BNAddr()); | 633 return BN_cmp(a.BNAddr(), b.BNAddr()); |
634 } | 634 } |
635 | 635 |
636 } // namespace dart | 636 } // namespace dart |
OLD | NEW |