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

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: Cosmetic change (in comment). 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 6526 matching lines...) Expand 10 before | Expand all | Expand 10 after
6537 } 6537 }
6538 6538
6539 6539
6540 static uword ZoneAllocator(intptr_t size) { 6540 static uword ZoneAllocator(intptr_t size) {
6541 Zone* zone = Isolate::Current()->current_zone(); 6541 Zone* zone = Isolate::Current()->current_zone();
6542 return zone->Allocate(size); 6542 return zone->Allocate(size);
6543 } 6543 }
6544 6544
6545 6545
6546 const char* Bigint::ToCString() const { 6546 const char* Bigint::ToCString() const {
6547 // TODO(florian): Add a BigintOperations::ToDecCString method and use that 6547 return BigintOperations::ToDecimalCString(*this, &ZoneAllocator);
6548 // here.
6549 return BigintOperations::ToHexCString(*this, &ZoneAllocator);
6550 } 6548 }
6551 6549
6552 6550
6553 class StringHasher : ValueObject { 6551 class StringHasher : ValueObject {
6554 public: 6552 public:
6555 StringHasher() : hash_(0) {} 6553 StringHasher() : hash_(0) {}
6556 void Add(int32_t ch) { 6554 void Add(int32_t ch) {
6557 hash_ += ch; 6555 hash_ += ch;
6558 hash_ += hash_ << 10; 6556 hash_ += hash_ << 10;
6559 hash_ ^= hash_ >> 6; 6557 hash_ ^= hash_ >> 6;
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
8505 result.set_num_args_tested(num_args_tested); 8503 result.set_num_args_tested(num_args_tested);
8506 // Number of array elements in one test entry (num_args_tested + 1) 8504 // Number of array elements in one test entry (num_args_tested + 1)
8507 intptr_t len = num_args_tested + 1; 8505 intptr_t len = num_args_tested + 1;
8508 // IC data array must be null terminated (sentinel entry). 8506 // IC data array must be null terminated (sentinel entry).
8509 Array& ic_data = Array::Handle(Array::New(len, Heap::kOld)); 8507 Array& ic_data = Array::Handle(Array::New(len, Heap::kOld));
8510 result.set_ic_data(ic_data); 8508 result.set_ic_data(ic_data);
8511 return result.raw(); 8509 return result.raw();
8512 } 8510 }
8513 8511
8514 } // namespace dart 8512 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698