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 17611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
17622 Bigint::InstanceSize(), | 17622 Bigint::InstanceSize(), |
17623 space); | 17623 space); |
17624 NoSafepointScope no_safepoint; | 17624 NoSafepointScope no_safepoint; |
17625 result ^= raw; | 17625 result ^= raw; |
17626 } | 17626 } |
17627 // Clamp the digits array. | 17627 // Clamp the digits array. |
17628 while ((used > 0) && (digits.GetUint32((used - 1) << 2) == 0)) { | 17628 while ((used > 0) && (digits.GetUint32((used - 1) << 2) == 0)) { |
17629 --used; | 17629 --used; |
17630 } | 17630 } |
17631 if (used > 0) { | 17631 if (used > 0) { |
17632 if ((used & 1) != 0) { | 17632 if (((used & 1) != 0) && (digits.GetUint32(used << 2) != 0)) { |
17633 // Set leading zero for 64-bit processing of digit pairs. | 17633 // Set leading zero for 64-bit processing of digit pairs if not set. |
regis
2016/02/11 23:38:11
I would add a comment explaining that we avoid a w
siva
2016/02/11 23:57:24
Done.
| |
17634 digits.SetUint32(used << 2, 0); | 17634 digits.SetUint32(used << 2, 0); |
17635 } | 17635 } |
17636 result.set_digits(digits); | 17636 result.set_digits(digits); |
17637 } else { | 17637 } else { |
17638 neg = false; | 17638 neg = false; |
17639 result.set_digits( | 17639 result.set_digits( |
17640 TypedData::Handle(zone, TypedData::EmptyUint32Array(thread))); | 17640 TypedData::Handle(zone, TypedData::EmptyUint32Array(thread))); |
17641 } | 17641 } |
17642 result.SetNeg(neg); | 17642 result.SetNeg(neg); |
17643 result.SetUsed(used); | 17643 result.SetUsed(used); |
(...skipping 3762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
21406 return UserTag::null(); | 21406 return UserTag::null(); |
21407 } | 21407 } |
21408 | 21408 |
21409 | 21409 |
21410 const char* UserTag::ToCString() const { | 21410 const char* UserTag::ToCString() const { |
21411 const String& tag_label = String::Handle(label()); | 21411 const String& tag_label = String::Handle(label()); |
21412 return tag_label.ToCString(); | 21412 return tag_label.ToCString(); |
21413 } | 21413 } |
21414 | 21414 |
21415 } // namespace dart | 21415 } // namespace dart |
OLD | NEW |