OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 262 |
263 | 263 |
264 SmartArrayPointer<const char> StringStream::ToCString() const { | 264 SmartArrayPointer<const char> StringStream::ToCString() const { |
265 char* str = NewArray<char>(length_ + 1); | 265 char* str = NewArray<char>(length_ + 1); |
266 OS::MemCopy(str, buffer_, length_); | 266 OS::MemCopy(str, buffer_, length_); |
267 str[length_] = '\0'; | 267 str[length_] = '\0'; |
268 return SmartArrayPointer<const char>(str); | 268 return SmartArrayPointer<const char>(str); |
269 } | 269 } |
270 | 270 |
271 | 271 |
272 void StringStream::Log() { | 272 void StringStream::Log(Isolate* isolate) { |
273 LOG(Isolate::Current(), StringEvent("StackDump", buffer_)); | 273 LOG(isolate, StringEvent("StackDump", buffer_)); |
274 } | 274 } |
275 | 275 |
276 | 276 |
277 void StringStream::OutputToFile(FILE* out) { | 277 void StringStream::OutputToFile(FILE* out) { |
278 // Dump the output to stdout, but make sure to break it up into | 278 // Dump the output to stdout, but make sure to break it up into |
279 // manageable chunks to avoid losing parts of the output in the OS | 279 // manageable chunks to avoid losing parts of the output in the OS |
280 // printing code. This is a problem on Windows in particular; see | 280 // printing code. This is a problem on Windows in particular; see |
281 // the VPrint() function implementations in platform-win32.cc. | 281 // the VPrint() function implementations in platform-win32.cc. |
282 unsigned position = 0; | 282 unsigned position = 0; |
283 for (unsigned next; (next = position + 2048) < length_; position = next) { | 283 for (unsigned next; (next = position + 2048) < length_; position = next) { |
(...skipping 299 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 |