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

Side by Side Diff: src/string-stream.cc

Issue 328343003: Remove dependency on Vector from platform files (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 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 | « src/snapshot-common.cc ('k') | src/utils.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/string-stream.h" 5 #include "src/string-stream.h"
6 6
7 #include "src/handles-inl.h" 7 #include "src/handles-inl.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } else if (value <= 0xff) { 122 } else if (value <= 0xff) {
123 Add("\\x%02x", value); 123 Add("\\x%02x", value);
124 } else { 124 } else {
125 Add("\\u%04x", value); 125 Add("\\u%04x", value);
126 } 126 }
127 break; 127 break;
128 } 128 }
129 case 'i': case 'd': case 'u': case 'x': case 'c': case 'X': { 129 case 'i': case 'd': case 'u': case 'x': case 'c': case 'X': {
130 int value = current.data_.u_int_; 130 int value = current.data_.u_int_;
131 EmbeddedVector<char, 24> formatted; 131 EmbeddedVector<char, 24> formatted;
132 int length = OS::SNPrintF(formatted, temp.start(), value); 132 int length = SNPrintF(formatted, temp.start(), value);
133 Add(Vector<const char>(formatted.start(), length)); 133 Add(Vector<const char>(formatted.start(), length));
134 break; 134 break;
135 } 135 }
136 case 'f': case 'g': case 'G': case 'e': case 'E': { 136 case 'f': case 'g': case 'G': case 'e': case 'E': {
137 double value = current.data_.u_double_; 137 double value = current.data_.u_double_;
138 EmbeddedVector<char, 28> formatted; 138 EmbeddedVector<char, 28> formatted;
139 OS::SNPrintF(formatted, temp.start(), value); 139 SNPrintF(formatted, temp.start(), value);
140 Add(formatted.start()); 140 Add(formatted.start());
141 break; 141 break;
142 } 142 }
143 case 'p': { 143 case 'p': {
144 void* value = current.data_.u_pointer_; 144 void* value = current.data_.u_pointer_;
145 EmbeddedVector<char, 20> formatted; 145 EmbeddedVector<char, 20> formatted;
146 OS::SNPrintF(formatted, temp.start(), value); 146 SNPrintF(formatted, temp.start(), value);
147 Add(formatted.start()); 147 Add(formatted.start());
148 break; 148 break;
149 } 149 }
150 default: 150 default:
151 UNREACHABLE(); 151 UNREACHABLE();
152 break; 152 break;
153 } 153 }
154 } 154 }
155 155
156 // Verify that the buffer is 0-terminated 156 // Verify that the buffer is 0-terminated
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 557
558 // Only grow once to the maximum allowable size. 558 // Only grow once to the maximum allowable size.
559 char* NoAllocationStringAllocator::grow(unsigned* bytes) { 559 char* NoAllocationStringAllocator::grow(unsigned* bytes) {
560 ASSERT(size_ >= *bytes); 560 ASSERT(size_ >= *bytes);
561 *bytes = size_; 561 *bytes = size_;
562 return space_; 562 return space_;
563 } 563 }
564 564
565 565
566 } } // namespace v8::internal 566 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/snapshot-common.cc ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698