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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 | 246 |
247 void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1, | 247 void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1, |
248 FmtElm arg2, FmtElm arg3) { | 248 FmtElm arg2, FmtElm arg3) { |
249 const char argc = 4; | 249 const char argc = 4; |
250 FmtElm argv[argc] = { arg0, arg1, arg2, arg3 }; | 250 FmtElm argv[argc] = { arg0, arg1, arg2, arg3 }; |
251 Add(CStrVector(format), Vector<FmtElm>(argv, argc)); | 251 Add(CStrVector(format), Vector<FmtElm>(argv, argc)); |
252 } | 252 } |
253 | 253 |
254 | 254 |
| 255 void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1, |
| 256 FmtElm arg2, FmtElm arg3, FmtElm arg4) { |
| 257 const char argc = 5; |
| 258 FmtElm argv[argc] = { arg0, arg1, arg2, arg3, arg4 }; |
| 259 Add(CStrVector(format), Vector<FmtElm>(argv, argc)); |
| 260 } |
| 261 |
| 262 |
255 SmartArrayPointer<const char> StringStream::ToCString() const { | 263 SmartArrayPointer<const char> StringStream::ToCString() const { |
256 char* str = NewArray<char>(length_ + 1); | 264 char* str = NewArray<char>(length_ + 1); |
257 OS::MemCopy(str, buffer_, length_); | 265 OS::MemCopy(str, buffer_, length_); |
258 str[length_] = '\0'; | 266 str[length_] = '\0'; |
259 return SmartArrayPointer<const char>(str); | 267 return SmartArrayPointer<const char>(str); |
260 } | 268 } |
261 | 269 |
262 | 270 |
263 void StringStream::Log() { | 271 void StringStream::Log() { |
264 LOG(ISOLATE, StringEvent("StackDump", buffer_)); | 272 LOG(ISOLATE, StringEvent("StackDump", buffer_)); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 | 592 |
585 // Only grow once to the maximum allowable size. | 593 // Only grow once to the maximum allowable size. |
586 char* NoAllocationStringAllocator::grow(unsigned* bytes) { | 594 char* NoAllocationStringAllocator::grow(unsigned* bytes) { |
587 ASSERT(size_ >= *bytes); | 595 ASSERT(size_ >= *bytes); |
588 *bytes = size_; | 596 *bytes = size_; |
589 return space_; | 597 return space_; |
590 } | 598 } |
591 | 599 |
592 | 600 |
593 } } // namespace v8::internal | 601 } } // namespace v8::internal |
OLD | NEW |