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

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

Issue 8351050: Print Bigints in decimal format. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/assert.h" 8 #include "vm/assert.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 5204 matching lines...) Expand 10 before | Expand all | Expand 10 after
5215 } 5215 }
5216 5216
5217 5217
5218 static uword ZoneAllocator(intptr_t size) { 5218 static uword ZoneAllocator(intptr_t size) {
5219 Zone* zone = Isolate::Current()->current_zone(); 5219 Zone* zone = Isolate::Current()->current_zone();
5220 return zone->Allocate(size); 5220 return zone->Allocate(size);
5221 } 5221 }
5222 5222
5223 5223
5224 const char* Bigint::ToCString() const { 5224 const char* Bigint::ToCString() const {
5225 return BigintOperations::ToHexCString(*this, &ZoneAllocator); 5225 return BigintOperations::ToDecCString(*this, &ZoneAllocator);
5226 } 5226 }
5227 5227
5228 5228
5229 class StringHasher : ValueObject { 5229 class StringHasher : ValueObject {
5230 public: 5230 public:
5231 StringHasher() : hash_(0) {} 5231 StringHasher() : hash_(0) {}
5232 void Add(int32_t ch) { 5232 void Add(int32_t ch) {
5233 hash_ += ch; 5233 hash_ += ch;
5234 hash_ += hash_ << 10; 5234 hash_ += hash_ << 10;
5235 hash_ ^= hash_ >> 6; 5235 hash_ ^= hash_ >> 6;
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after
6810 const String& str = String::Handle(pattern()); 6810 const String& str = String::Handle(pattern());
6811 const char* format = "JSRegExp: pattern=%s flags=%s"; 6811 const char* format = "JSRegExp: pattern=%s flags=%s";
6812 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 6812 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
6813 char* chars = reinterpret_cast<char*>( 6813 char* chars = reinterpret_cast<char*>(
6814 Isolate::Current()->current_zone()->Allocate(len + 1)); 6814 Isolate::Current()->current_zone()->Allocate(len + 1));
6815 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 6815 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
6816 return chars; 6816 return chars;
6817 } 6817 }
6818 6818
6819 } // namespace dart 6819 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698