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

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

Issue 12033007: Hide addresses in traced code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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/flag-definitions.h ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 break; 160 break;
161 } 161 }
162 case 'f': case 'g': case 'G': case 'e': case 'E': { 162 case 'f': case 'g': case 'G': case 'e': case 'E': {
163 double value = current.data_.u_double_; 163 double value = current.data_.u_double_;
164 EmbeddedVector<char, 28> formatted; 164 EmbeddedVector<char, 28> formatted;
165 OS::SNPrintF(formatted, temp.start(), value); 165 OS::SNPrintF(formatted, temp.start(), value);
166 Add(formatted.start()); 166 Add(formatted.start());
167 break; 167 break;
168 } 168 }
169 case 'p': { 169 case 'p': {
170 void* value = current.data_.u_pointer_; 170 if (FLAG_trace_code_addresses) {
171 EmbeddedVector<char, 20> formatted; 171 void* value = current.data_.u_pointer_;
Sven Panne 2013/01/21 09:51:05 I would prefer just a ternary ?: to calculate valu
Massi 2013/01/21 15:27:49 The code would be more "linear" but the output wou
172 OS::SNPrintF(formatted, temp.start(), value); 172 EmbeddedVector<char, 20> formatted;
173 Add(formatted.start()); 173 OS::SNPrintF(formatted, temp.start(), value);
174 Add(formatted.start());
175 } else {
176 Add("0xXXXXXXXX");
177 }
174 break; 178 break;
175 } 179 }
176 default: 180 default:
177 UNREACHABLE(); 181 UNREACHABLE();
178 break; 182 break;
179 } 183 }
180 } 184 }
181 185
182 // Verify that the buffer is 0-terminated 186 // Verify that the buffer is 0-terminated
183 ASSERT(buffer_[length_] == '\0'); 187 ASSERT(buffer_[length_] == '\0');
(...skipping 15 matching lines...) Expand all
199 for (int i = 0; i < debug_object_cache->length(); i++) { 203 for (int i = 0; i < debug_object_cache->length(); i++) {
200 if ((*debug_object_cache)[i] == o) { 204 if ((*debug_object_cache)[i] == o) {
201 Add("#%d#", i); 205 Add("#%d#", i);
202 return; 206 return;
203 } 207 }
204 } 208 }
205 if (debug_object_cache->length() < kMentionedObjectCacheMaxSize) { 209 if (debug_object_cache->length() < kMentionedObjectCacheMaxSize) {
206 Add("#%d#", debug_object_cache->length()); 210 Add("#%d#", debug_object_cache->length());
207 debug_object_cache->Add(HeapObject::cast(o)); 211 debug_object_cache->Add(HeapObject::cast(o));
208 } else { 212 } else {
209 Add("@%p", o); 213 if (FLAG_trace_code_addresses) {
Sven Panne 2013/01/21 09:51:05 Do we really need this if we have the change above
Massi 2013/01/21 15:27:49 Done.
214 Add("@%p", o);
215 } else {
216 Add("0xXXXXXXXX");
217 }
210 } 218 }
211 } 219 }
212 } 220 }
213 221
214 222
215 void StringStream::Add(const char* format) { 223 void StringStream::Add(const char* format) {
216 Add(CStrVector(format)); 224 Add(CStrVector(format));
217 } 225 }
218 226
219 227
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 591
584 // Only grow once to the maximum allowable size. 592 // Only grow once to the maximum allowable size.
585 char* NoAllocationStringAllocator::grow(unsigned* bytes) { 593 char* NoAllocationStringAllocator::grow(unsigned* bytes) {
586 ASSERT(size_ >= *bytes); 594 ASSERT(size_ >= *bytes);
587 *bytes = size_; 595 *bytes = size_;
588 return space_; 596 return space_;
589 } 597 }
590 598
591 599
592 } } // namespace v8::internal 600 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698