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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 278 } |
279 internal::PrintF(out, "%s", &buffer_[position]); | 279 internal::PrintF(out, "%s", &buffer_[position]); |
280 } | 280 } |
281 | 281 |
282 | 282 |
283 Handle<String> StringStream::ToString() { | 283 Handle<String> StringStream::ToString() { |
284 return Factory::NewStringFromUtf8(Vector<const char>(buffer_, length_)); | 284 return Factory::NewStringFromUtf8(Vector<const char>(buffer_, length_)); |
285 } | 285 } |
286 | 286 |
287 | 287 |
| 288 Handle<String> StringStream::ToSymbol() { |
| 289 return Factory::LookupAsciiSymbol(Vector<const char>(buffer_, length_)); |
| 290 } |
| 291 |
| 292 |
288 void StringStream::ClearMentionedObjectCache() { | 293 void StringStream::ClearMentionedObjectCache() { |
289 current_security_token = NULL; | 294 current_security_token = NULL; |
290 if (debug_object_cache == NULL) { | 295 if (debug_object_cache == NULL) { |
291 debug_object_cache = new List<HeapObject*, PreallocatedStorage>(0); | 296 debug_object_cache = new List<HeapObject*, PreallocatedStorage>(0); |
292 } | 297 } |
293 debug_object_cache->Clear(); | 298 debug_object_cache->Clear(); |
294 } | 299 } |
295 | 300 |
296 | 301 |
297 #ifdef DEBUG | 302 #ifdef DEBUG |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 | 580 |
576 // Only grow once to the maximum allowable size. | 581 // Only grow once to the maximum allowable size. |
577 char* NoAllocationStringAllocator::grow(unsigned* bytes) { | 582 char* NoAllocationStringAllocator::grow(unsigned* bytes) { |
578 ASSERT(size_ >= *bytes); | 583 ASSERT(size_ >= *bytes); |
579 *bytes = size_; | 584 *bytes = size_; |
580 return space_; | 585 return space_; |
581 } | 586 } |
582 | 587 |
583 | 588 |
584 } } // namespace v8::internal | 589 } } // namespace v8::internal |
OLD | NEW |