Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: runtime/vm/object.cc

Issue 559203003: Fix wrong conversion from double to bigint in overriden operators of new bigint. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/integers.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16810 matching lines...) Expand 10 before | Expand all | Expand 10 after
16821 UNREACHABLE(); 16821 UNREACHABLE();
16822 } 16822 }
16823 const int64_t bit_len = used * kBitsPerDigit; 16823 const int64_t bit_len = used * kBitsPerDigit;
16824 const int64_t dec_len = (bit_len * kLog2Dividend / kLog2Divisor) + 1; 16824 const int64_t dec_len = (bit_len * kLog2Dividend / kLog2Divisor) + 1;
16825 // Add one byte for the minus sign and for the trailing \0 character. 16825 // Add one byte for the minus sign and for the trailing \0 character.
16826 const int64_t len = (Neg() ? 1 : 0) + dec_len + 1; 16826 const int64_t len = (Neg() ? 1 : 0) + dec_len + 1;
16827 char* chars = reinterpret_cast<char*>(allocator(len)); 16827 char* chars = reinterpret_cast<char*>(allocator(len));
16828 intptr_t pos = 0; 16828 intptr_t pos = 0;
16829 const intptr_t kDivisor = 100000000; 16829 const intptr_t kDivisor = 100000000;
16830 const intptr_t kDigits = 8; 16830 const intptr_t kDigits = 8;
16831 // TODO(regis): Fix Windows error reported for ambiguous call to 'pow'. 16831 ASSERT(pow(10.0, 1.0 * kDigits) == kDivisor);
16832 // ASSERT(pow(10.0, kDigits) == kDivisor);
16833 ASSERT(kDivisor < kDigitBase); 16832 ASSERT(kDivisor < kDigitBase);
16834 ASSERT(Smi::IsValid(kDivisor)); 16833 ASSERT(Smi::IsValid(kDivisor));
16835 // Allocate a copy of the digits. 16834 // Allocate a copy of the digits.
16836 const TypedData& rest_digits = TypedData::Handle( 16835 const TypedData& rest_digits = TypedData::Handle(
16837 TypedData::New(kTypedDataUint32ArrayCid, used)); 16836 TypedData::New(kTypedDataUint32ArrayCid, used));
16838 for (intptr_t i = 0; i < used; i++) { 16837 for (intptr_t i = 0; i < used; i++) {
16839 rest_digits.SetUint32(i << 2, DigitAt(i)); 16838 rest_digits.SetUint32(i << 2, DigitAt(i));
16840 } 16839 }
16841 if (used == 0) { 16840 if (used == 0) {
16842 chars[pos++] = '0'; 16841 chars[pos++] = '0';
(...skipping 3520 matching lines...) Expand 10 before | Expand all | Expand 10 after
20363 return tag_label.ToCString(); 20362 return tag_label.ToCString();
20364 } 20363 }
20365 20364
20366 20365
20367 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20366 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20368 Instance::PrintJSONImpl(stream, ref); 20367 Instance::PrintJSONImpl(stream, ref);
20369 } 20368 }
20370 20369
20371 20370
20372 } // namespace dart 20371 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/integers.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698