| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #ifndef VM_BIGINT_OPERATIONS_H_ | 5 #ifndef VM_BIGINT_OPERATIONS_H_ |
| 6 #define VM_BIGINT_OPERATIONS_H_ | 6 #define VM_BIGINT_OPERATIONS_H_ |
| 7 | 7 |
| 8 #include "vm/heap.h" | 8 #include "vm/heap.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/token.h" | 10 #include "vm/token.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // zeroes are ignored. | 36 // zeroes are ignored. |
| 37 static RawBigint* FromDecimalCString(const char* str, | 37 static RawBigint* FromDecimalCString(const char* str, |
| 38 Heap::Space space = Heap::kNew); | 38 Heap::Space space = Heap::kNew); |
| 39 // Converts the bigint to a string. The returned string is prepended by | 39 // Converts the bigint to a string. The returned string is prepended by |
| 40 // a "0x" (after the optional minus-sign). | 40 // a "0x" (after the optional minus-sign). |
| 41 static const char* ToHexCString(const BIGNUM* bn, | 41 static const char* ToHexCString(const BIGNUM* bn, |
| 42 uword (*allocator)(intptr_t size)); | 42 uword (*allocator)(intptr_t size)); |
| 43 static const char* ToHexCString(const Bigint& bigint, | 43 static const char* ToHexCString(const Bigint& bigint, |
| 44 uword (*allocator)(intptr_t size)); | 44 uword (*allocator)(intptr_t size)); |
| 45 | 45 |
| 46 // Converts the bigint to a string. |
| 47 static const char* ToDecCString(const BIGNUM* bn, |
| 48 uword (*allocator)(intptr_t size)); |
| 49 static const char* ToDecCString(const Bigint& bigint, |
| 50 uword (*allocator)(intptr_t size)); |
| 51 |
| 46 static bool FitsIntoSmi(const Bigint& bigint); | 52 static bool FitsIntoSmi(const Bigint& bigint); |
| 47 static RawSmi* ToSmi(const Bigint& bigint); | 53 static RawSmi* ToSmi(const Bigint& bigint); |
| 48 | 54 |
| 49 static bool FitsIntoInt64(const Bigint& bigint); | 55 static bool FitsIntoInt64(const Bigint& bigint); |
| 50 static int64_t ToInt64(const Bigint& bigint); | 56 static int64_t ToInt64(const Bigint& bigint); |
| 51 | 57 |
| 52 static RawDouble* ToDouble(const Bigint& bigint); | 58 static RawDouble* ToDouble(const Bigint& bigint); |
| 53 | 59 |
| 54 static RawBigint* Add(const Bigint& a, const Bigint& b); | 60 static RawBigint* Add(const Bigint& a, const Bigint& b); |
| 55 static RawBigint* Subtract(const Bigint& a, const Bigint& b); | 61 static RawBigint* Subtract(const Bigint& a, const Bigint& b); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 85 static RawSmi* BitOpWithSmi(Token::Kind kind, | 91 static RawSmi* BitOpWithSmi(Token::Kind kind, |
| 86 const Bigint& bigint, | 92 const Bigint& bigint, |
| 87 const Smi& smi); | 93 const Smi& smi); |
| 88 | 94 |
| 89 DISALLOW_IMPLICIT_CONSTRUCTORS(BigintOperations); | 95 DISALLOW_IMPLICIT_CONSTRUCTORS(BigintOperations); |
| 90 }; | 96 }; |
| 91 | 97 |
| 92 } // namespace dart | 98 } // namespace dart |
| 93 | 99 |
| 94 #endif // VM_BIGINT_OPERATIONS_H_ | 100 #endif // VM_BIGINT_OPERATIONS_H_ |
| OLD | NEW |