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

Side by Side Diff: src/log.cc

Issue 100249: When strings can change from an ASCII representation to a... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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/jsregexp.cc ('k') | src/objects.h » ('j') | src/objects-inl.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 Append(static_cast<char>(str->Get(i))); 359 Append(static_cast<char>(str->Get(i)));
360 } 360 }
361 } 361 }
362 362
363 void LogMessageBuilder::AppendDetailed(String* str, bool show_impl_info) { 363 void LogMessageBuilder::AppendDetailed(String* str, bool show_impl_info) {
364 AssertNoAllocation no_heap_allocation; // Ensure string stay valid. 364 AssertNoAllocation no_heap_allocation; // Ensure string stay valid.
365 int len = str->length(); 365 int len = str->length();
366 if (len > 0x1000) 366 if (len > 0x1000)
367 len = 0x1000; 367 len = 0x1000;
368 if (show_impl_info) { 368 if (show_impl_info) {
369 Append(StringShape(str).IsAsciiRepresentation() ? 'a' : '2'); 369 Append(str->IsAsciiRepresentation() ? 'a' : '2');
370 if (StringShape(str).IsExternal()) 370 if (StringShape(str).IsExternal())
371 Append('e'); 371 Append('e');
372 if (StringShape(str).IsSymbol()) 372 if (StringShape(str).IsSymbol())
373 Append('#'); 373 Append('#');
374 Append(":%i:", str->length()); 374 Append(":%i:", str->length());
375 } 375 }
376 for (int i = 0; i < len; i++) { 376 for (int i = 0; i < len; i++) {
377 uc32 c = str->Get(i); 377 uc32 c = str->Get(i);
378 if (c > 0xff) { 378 if (c > 0xff) {
379 Append("\\u%04x", c); 379 Append("\\u%04x", c);
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 } else if (previous_->state_ == EXTERNAL) { 1155 } else if (previous_->state_ == EXTERNAL) {
1156 // We are leaving V8. 1156 // We are leaving V8.
1157 Heap::Protect(); 1157 Heap::Protect();
1158 } 1158 }
1159 } 1159 }
1160 #endif 1160 #endif
1161 } 1161 }
1162 #endif 1162 #endif
1163 1163
1164 } } // namespace v8::internal 1164 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/jsregexp.cc ('k') | src/objects.h » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698