| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 | 159 |
| 160 // The following functions are marked as invisible, meaning they will be hidden | 160 // The following functions are marked as invisible, meaning they will be hidden |
| 161 // in the stack trace and will be hidden from reflective access. | 161 // in the stack trace and will be hidden from reflective access. |
| 162 // (Library, class name, method name) | 162 // (Library, class name, method name) |
| 163 // Additionally, private functions in dart:* that are native or constructors are | 163 // Additionally, private functions in dart:* that are native or constructors are |
| 164 // marked as invisible by the parser. | 164 // marked as invisible by the parser. |
| 165 #define INVISIBLE_CLASS_FUNCTIONS(V) \ | 165 #define INVISIBLE_CLASS_FUNCTIONS(V) \ |
| 166 V(CoreLibrary, int, _throwFormatException) \ | 166 V(CoreLibrary, int, _throwFormatException) \ |
| 167 V(CoreLibrary, int, _parse) \ | 167 V(CoreLibrary, int, _parse) \ |
| 168 V(CoreLibrary, _Bigint, _add) \ | 168 V(CoreLibrary, _Bigint, _absAdd) \ |
| 169 V(CoreLibrary, _Bigint, _sub) \ | 169 V(CoreLibrary, _Bigint, _absSub) \ |
| 170 V(CoreLibrary, _Bigint, _mulAdd) \ | 170 V(CoreLibrary, _Bigint, _mulAdd) \ |
| 171 V(CoreLibrary, _Bigint, _sqrAdd) \ | 171 V(CoreLibrary, _Bigint, _sqrAdd) \ |
| 172 V(CoreLibrary, _Bigint, _estQuotientDigit) \ | 172 V(CoreLibrary, _Bigint, _estQuotientDigit) \ |
| 173 V(CoreLibrary, _Montgomery, _mulMod) \ | 173 V(CoreLibrary, _Montgomery, _mulMod) \ |
| 174 | 174 |
| 175 #define INVISIBLE_LIBRARY_FUNCTIONS(V) \ | 175 #define INVISIBLE_LIBRARY_FUNCTIONS(V) \ |
| 176 V(TypedDataLibrary, _toInt8) \ | 176 V(TypedDataLibrary, _toInt8) \ |
| 177 V(TypedDataLibrary, _toInt16) \ | 177 V(TypedDataLibrary, _toInt16) \ |
| 178 V(TypedDataLibrary, _toInt32) \ | 178 V(TypedDataLibrary, _toInt32) \ |
| 179 V(TypedDataLibrary, _toInt64) \ | 179 V(TypedDataLibrary, _toInt64) \ |
| (...skipping 16548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16728 } | 16728 } |
| 16729 | 16729 |
| 16730 | 16730 |
| 16731 uint32_t Bigint::AsTruncatedUint32Value() const { | 16731 uint32_t Bigint::AsTruncatedUint32Value() const { |
| 16732 // Note: the previous implementation of Bigint returned the absolute value | 16732 // Note: the previous implementation of Bigint returned the absolute value |
| 16733 // truncated to 32 bits, which is not consistent with Smi and Mint behavior. | 16733 // truncated to 32 bits, which is not consistent with Smi and Mint behavior. |
| 16734 ASSERT(Bigint::kBitsPerDigit == 32); | 16734 ASSERT(Bigint::kBitsPerDigit == 32); |
| 16735 const intptr_t used = Used(); | 16735 const intptr_t used = Used(); |
| 16736 if (used == 0) return 0; | 16736 if (used == 0) return 0; |
| 16737 const uint32_t digit0 = DigitAt(0); | 16737 const uint32_t digit0 = DigitAt(0); |
| 16738 return Neg() ? -digit0 : digit0; | 16738 return Neg() ? static_cast<uint32_t>(-digit0) : digit0; |
| 16739 } | 16739 } |
| 16740 | 16740 |
| 16741 | 16741 |
| 16742 // For positive values: Smi < Mint < Bigint. | 16742 // For positive values: Smi < Mint < Bigint. |
| 16743 int Bigint::CompareWith(const Integer& other) const { | 16743 int Bigint::CompareWith(const Integer& other) const { |
| 16744 ASSERT(!FitsIntoSmi()); | 16744 ASSERT(!FitsIntoSmi()); |
| 16745 ASSERT(!FitsIntoInt64()); | 16745 ASSERT(!FitsIntoInt64()); |
| 16746 if (other.IsBigint() && (IsNegative() == other.IsNegative())) { | 16746 if (other.IsBigint() && (IsNegative() == other.IsNegative())) { |
| 16747 const Bigint& other_bgi = Bigint::Cast(other); | 16747 const Bigint& other_bgi = Bigint::Cast(other); |
| 16748 int64_t result = Used() - other_bgi.Used(); | 16748 int64_t result = Used() - other_bgi.Used(); |
| (...skipping 3546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20295 return tag_label.ToCString(); | 20295 return tag_label.ToCString(); |
| 20296 } | 20296 } |
| 20297 | 20297 |
| 20298 | 20298 |
| 20299 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20299 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 20300 Instance::PrintJSONImpl(stream, ref); | 20300 Instance::PrintJSONImpl(stream, ref); |
| 20301 } | 20301 } |
| 20302 | 20302 |
| 20303 | 20303 |
| 20304 } // namespace dart | 20304 } // namespace dart |
| OLD | NEW |