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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 250 } |
251 | 251 |
252 | 252 |
253 void LogMessageBuilder::AppendDetailed(String* str, bool show_impl_info) { | 253 void LogMessageBuilder::AppendDetailed(String* str, bool show_impl_info) { |
254 if (str == NULL) return; | 254 if (str == NULL) return; |
255 AssertNoAllocation no_heap_allocation; // Ensure string stay valid. | 255 AssertNoAllocation no_heap_allocation; // Ensure string stay valid. |
256 int len = str->length(); | 256 int len = str->length(); |
257 if (len > 0x1000) | 257 if (len > 0x1000) |
258 len = 0x1000; | 258 len = 0x1000; |
259 if (show_impl_info) { | 259 if (show_impl_info) { |
260 Append(str->IsAsciiRepresentation() ? 'a' : '2'); | 260 Append(str->IsOneByteRepresentation() ? 'a' : '2'); |
261 if (StringShape(str).IsExternal()) | 261 if (StringShape(str).IsExternal()) |
262 Append('e'); | 262 Append('e'); |
263 if (StringShape(str).IsSymbol()) | 263 if (StringShape(str).IsSymbol()) |
264 Append('#'); | 264 Append('#'); |
265 Append(":%i:", str->length()); | 265 Append(":%i:", str->length()); |
266 } | 266 } |
267 for (int i = 0; i < len; i++) { | 267 for (int i = 0; i < len; i++) { |
268 uc32 c = str->Get(i); | 268 uc32 c = str->Get(i); |
269 if (c > 0xff) { | 269 if (c > 0xff) { |
270 Append("\\u%04x", c); | 270 Append("\\u%04x", c); |
(...skipping 30 matching lines...) Expand all Loading... |
301 ASSERT(pos_ <= Log::kMessageBufferSize); | 301 ASSERT(pos_ <= Log::kMessageBufferSize); |
302 const int written = log_->WriteToFile(log_->message_buffer_, pos_); | 302 const int written = log_->WriteToFile(log_->message_buffer_, pos_); |
303 if (written != pos_) { | 303 if (written != pos_) { |
304 log_->stop(); | 304 log_->stop(); |
305 log_->logger_->LogFailure(); | 305 log_->logger_->LogFailure(); |
306 } | 306 } |
307 } | 307 } |
308 | 308 |
309 | 309 |
310 } } // namespace v8::internal | 310 } } // namespace v8::internal |
OLD | NEW |