OLD | NEW |
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 244 matching lines...) Loading... |
255 void LogMessageBuilder::AppendDetailed(String* str, bool show_impl_info) { | 255 void LogMessageBuilder::AppendDetailed(String* str, bool show_impl_info) { |
256 if (str == NULL) return; | 256 if (str == NULL) return; |
257 AssertNoAllocation no_heap_allocation; // Ensure string stay valid. | 257 AssertNoAllocation no_heap_allocation; // Ensure string stay valid. |
258 int len = str->length(); | 258 int len = str->length(); |
259 if (len > 0x1000) | 259 if (len > 0x1000) |
260 len = 0x1000; | 260 len = 0x1000; |
261 if (show_impl_info) { | 261 if (show_impl_info) { |
262 Append(str->IsOneByteRepresentation() ? 'a' : '2'); | 262 Append(str->IsOneByteRepresentation() ? 'a' : '2'); |
263 if (StringShape(str).IsExternal()) | 263 if (StringShape(str).IsExternal()) |
264 Append('e'); | 264 Append('e'); |
265 if (StringShape(str).IsSymbol()) | 265 if (StringShape(str).IsInternalized()) |
266 Append('#'); | 266 Append('#'); |
267 Append(":%i:", str->length()); | 267 Append(":%i:", str->length()); |
268 } | 268 } |
269 for (int i = 0; i < len; i++) { | 269 for (int i = 0; i < len; i++) { |
270 uc32 c = str->Get(i); | 270 uc32 c = str->Get(i); |
271 if (c > 0xff) { | 271 if (c > 0xff) { |
272 Append("\\u%04x", c); | 272 Append("\\u%04x", c); |
273 } else if (c < 32 || c > 126) { | 273 } else if (c < 32 || c > 126) { |
274 Append("\\x%02x", c); | 274 Append("\\x%02x", c); |
275 } else if (c == ',') { | 275 } else if (c == ',') { |
(...skipping 27 matching lines...) Loading... |
303 ASSERT(pos_ <= Log::kMessageBufferSize); | 303 ASSERT(pos_ <= Log::kMessageBufferSize); |
304 const int written = log_->WriteToFile(log_->message_buffer_, pos_); | 304 const int written = log_->WriteToFile(log_->message_buffer_, pos_); |
305 if (written != pos_) { | 305 if (written != pos_) { |
306 log_->stop(); | 306 log_->stop(); |
307 log_->logger_->LogFailure(); | 307 log_->logger_->LogFailure(); |
308 } | 308 } |
309 } | 309 } |
310 | 310 |
311 | 311 |
312 } } // namespace v8::internal | 312 } } // namespace v8::internal |
OLD | NEW |