| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 | 227 |
| 228 void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1, | 228 void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1, |
| 229 FmtElm arg2) { | 229 FmtElm arg2) { |
| 230 const char argc = 3; | 230 const char argc = 3; |
| 231 FmtElm argv[argc] = { arg0, arg1, arg2 }; | 231 FmtElm argv[argc] = { arg0, arg1, arg2 }; |
| 232 Add(CStrVector(format), Vector<FmtElm>(argv, argc)); | 232 Add(CStrVector(format), Vector<FmtElm>(argv, argc)); |
| 233 } | 233 } |
| 234 | 234 |
| 235 | 235 |
| 236 void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1, |
| 237 FmtElm arg2, FmtElm arg3) { |
| 238 const char argc = 4; |
| 239 FmtElm argv[argc] = { arg0, arg1, arg2, arg3 }; |
| 240 Add(CStrVector(format), Vector<FmtElm>(argv, argc)); |
| 241 } |
| 242 |
| 243 |
| 236 SmartPointer<const char> StringStream::ToCString() { | 244 SmartPointer<const char> StringStream::ToCString() { |
| 237 char* str = NewArray<char>(length_ + 1); | 245 char* str = NewArray<char>(length_ + 1); |
| 238 memcpy(str, buffer_, length_); | 246 memcpy(str, buffer_, length_); |
| 239 str[length_] = '\0'; | 247 str[length_] = '\0'; |
| 240 return SmartPointer<const char>(str); | 248 return SmartPointer<const char>(str); |
| 241 } | 249 } |
| 242 | 250 |
| 243 | 251 |
| 244 void StringStream::Log() { | 252 void StringStream::Log() { |
| 245 LOG(StringEvent("StackDump", buffer_)); | 253 LOG(StringEvent("StackDump", buffer_)); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 unsigned new_bytes = *bytes * 2; | 566 unsigned new_bytes = *bytes * 2; |
| 559 if (new_bytes > size_) { | 567 if (new_bytes > size_) { |
| 560 new_bytes = size_; | 568 new_bytes = size_; |
| 561 } | 569 } |
| 562 *bytes = new_bytes; | 570 *bytes = new_bytes; |
| 563 return space_; | 571 return space_; |
| 564 } | 572 } |
| 565 | 573 |
| 566 | 574 |
| 567 } } // namespace v8::internal | 575 } } // namespace v8::internal |
| OLD | NEW |