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

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

Issue 916153002: Improve _toInt64() and _toUint64() conversions in TypedData. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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/typed_data.dart ('k') | no next file » | 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 17095 matching lines...) Expand 10 before | Expand all | Expand 10 after
17106 chars[j] = tmp; 17106 chars[j] = tmp;
17107 i++; 17107 i++;
17108 j--; 17108 j--;
17109 } 17109 }
17110 chars[pos] = '\0'; 17110 chars[pos] = '\0';
17111 return chars; 17111 return chars;
17112 } 17112 }
17113 17113
17114 17114
17115 const char* Bigint::ToHexCString(uword (*allocator)(intptr_t size)) const { 17115 const char* Bigint::ToHexCString(uword (*allocator)(intptr_t size)) const {
17116 NoGCScope no_gc; // TODO(regis): Is this necessary?
17117
17118 const intptr_t used = Used(); 17116 const intptr_t used = Used();
17119 if (used == 0) { 17117 if (used == 0) {
17120 const char* zero = "0x0"; 17118 const char* zero = "0x0";
17121 const size_t len = strlen(zero) + 1; 17119 const size_t len = strlen(zero) + 1;
17122 char* chars = reinterpret_cast<char*>(allocator(len)); 17120 char* chars = reinterpret_cast<char*>(allocator(len));
17123 strncpy(chars, zero, len); 17121 strncpy(chars, zero, len);
17124 return chars; 17122 return chars;
17125 } 17123 }
17126 const int kBitsPerHexDigit = 4; 17124 const int kBitsPerHexDigit = 4;
17127 const int kHexDigitsPerDigit = 8; 17125 const int kHexDigitsPerDigit = 8;
(...skipping 3488 matching lines...) Expand 10 before | Expand all | Expand 10 after
20616 return tag_label.ToCString(); 20614 return tag_label.ToCString();
20617 } 20615 }
20618 20616
20619 20617
20620 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20618 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20621 Instance::PrintJSONImpl(stream, ref); 20619 Instance::PrintJSONImpl(stream, ref);
20622 } 20620 }
20623 20621
20624 20622
20625 } // namespace dart 20623 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/typed_data.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698