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

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

Issue 9536016: Implement BigintOperations::ToDecimalCString. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 9 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
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 "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 6619 matching lines...) Expand 10 before | Expand all | Expand 10 after
6630 } 6630 }
6631 6631
6632 6632
6633 static uword ZoneAllocator(intptr_t size) { 6633 static uword ZoneAllocator(intptr_t size) {
6634 Zone* zone = Isolate::Current()->current_zone(); 6634 Zone* zone = Isolate::Current()->current_zone();
6635 return zone->Allocate(size); 6635 return zone->Allocate(size);
6636 } 6636 }
6637 6637
6638 6638
6639 const char* Bigint::ToCString() const { 6639 const char* Bigint::ToCString() const {
6640 // TODO(florian): Add a BigintOperations::ToDecCString method and use that 6640 return BigintOperations::ToDecimalCString(*this, &ZoneAllocator);
6641 // here.
6642 return BigintOperations::ToHexCString(*this, &ZoneAllocator);
6643 } 6641 }
6644 6642
6645 6643
6646 class StringHasher : ValueObject { 6644 class StringHasher : ValueObject {
6647 public: 6645 public:
6648 StringHasher() : hash_(0) {} 6646 StringHasher() : hash_(0) {}
6649 void Add(int32_t ch) { 6647 void Add(int32_t ch) {
6650 hash_ += ch; 6648 hash_ += ch;
6651 hash_ += hash_ << 10; 6649 hash_ += hash_ << 10;
6652 hash_ ^= hash_ >> 6; 6650 hash_ ^= hash_ >> 6;
(...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after
8606 result.set_num_args_tested(num_args_tested); 8604 result.set_num_args_tested(num_args_tested);
8607 // Number of array elements in one test entry (num_args_tested + 1) 8605 // Number of array elements in one test entry (num_args_tested + 1)
8608 intptr_t len = result.TestEntryLength(); 8606 intptr_t len = result.TestEntryLength();
8609 // IC data array must be null terminated (sentinel entry). 8607 // IC data array must be null terminated (sentinel entry).
8610 Array& ic_data = Array::Handle(Array::New(len, Heap::kOld)); 8608 Array& ic_data = Array::Handle(Array::New(len, Heap::kOld));
8611 result.set_ic_data(ic_data); 8609 result.set_ic_data(ic_data);
8612 return result.raw(); 8610 return result.raw();
8613 } 8611 }
8614 8612
8615 } // namespace dart 8613 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698