OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 SmartPointer<const char> StringStream::ToCString() const { | 253 SmartPointer<const char> StringStream::ToCString() const { |
254 char* str = NewArray<char>(length_ + 1); | 254 char* str = NewArray<char>(length_ + 1); |
255 memcpy(str, buffer_, length_); | 255 memcpy(str, buffer_, length_); |
256 str[length_] = '\0'; | 256 str[length_] = '\0'; |
257 return SmartPointer<const char>(str); | 257 return SmartPointer<const char>(str); |
258 } | 258 } |
259 | 259 |
260 | 260 |
261 void StringStream::Log() { | 261 void StringStream::Log() { |
262 LOG(StringEvent("StackDump", buffer_)); | 262 LOG(ISOLATE, StringEvent("StackDump", buffer_)); |
263 } | 263 } |
264 | 264 |
265 | 265 |
266 void StringStream::OutputToFile(FILE* out) { | 266 void StringStream::OutputToFile(FILE* out) { |
267 // Dump the output to stdout, but make sure to break it up into | 267 // Dump the output to stdout, but make sure to break it up into |
268 // manageable chunks to avoid losing parts of the output in the OS | 268 // manageable chunks to avoid losing parts of the output in the OS |
269 // printing code. This is a problem on Windows in particular; see | 269 // printing code. This is a problem on Windows in particular; see |
270 // the VPrint() function implementations in platform-win32.cc. | 270 // the VPrint() function implementations in platform-win32.cc. |
271 unsigned position = 0; | 271 unsigned position = 0; |
272 for (unsigned next; (next = position + 2048) < length_; position = next) { | 272 for (unsigned next; (next = position + 2048) < length_; position = next) { |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 | 583 |
584 // Only grow once to the maximum allowable size. | 584 // Only grow once to the maximum allowable size. |
585 char* NoAllocationStringAllocator::grow(unsigned* bytes) { | 585 char* NoAllocationStringAllocator::grow(unsigned* bytes) { |
586 ASSERT(size_ >= *bytes); | 586 ASSERT(size_ >= *bytes); |
587 *bytes = size_; | 587 *bytes = size_; |
588 return space_; | 588 return space_; |
589 } | 589 } |
590 | 590 |
591 | 591 |
592 } } // namespace v8::internal | 592 } } // namespace v8::internal |
OLD | NEW |