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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |