| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 char save = buffer_[next]; | 283 char save = buffer_[next]; |
| 284 buffer_[next] = '\0'; | 284 buffer_[next] = '\0'; |
| 285 internal::PrintF(out, "%s", &buffer_[position]); | 285 internal::PrintF(out, "%s", &buffer_[position]); |
| 286 buffer_[next] = save; | 286 buffer_[next] = save; |
| 287 } | 287 } |
| 288 internal::PrintF(out, "%s", &buffer_[position]); | 288 internal::PrintF(out, "%s", &buffer_[position]); |
| 289 } | 289 } |
| 290 | 290 |
| 291 | 291 |
| 292 Handle<String> StringStream::ToString() { | 292 Handle<String> StringStream::ToString() { |
| 293 return FACTORY->NewStringFromUtf8(Vector<const char>(buffer_, length_)); | 293 Factory* factory = Isolate::Current()->factory(); |
| 294 return factory->NewStringFromUtf8(Vector<const char>(buffer_, length_)); |
| 294 } | 295 } |
| 295 | 296 |
| 296 | 297 |
| 297 void StringStream::ClearMentionedObjectCache() { | 298 void StringStream::ClearMentionedObjectCache() { |
| 298 Isolate* isolate = Isolate::Current(); | 299 Isolate* isolate = Isolate::Current(); |
| 299 isolate->set_string_stream_current_security_token(NULL); | 300 isolate->set_string_stream_current_security_token(NULL); |
| 300 if (isolate->string_stream_debug_object_cache() == NULL) { | 301 if (isolate->string_stream_debug_object_cache() == NULL) { |
| 301 isolate->set_string_stream_debug_object_cache( | 302 isolate->set_string_stream_debug_object_cache( |
| 302 new List<HeapObject*, PreallocatedStorageAllocationPolicy>(0)); | 303 new List<HeapObject*, PreallocatedStorageAllocationPolicy>(0)); |
| 303 } | 304 } |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 | 593 |
| 593 // Only grow once to the maximum allowable size. | 594 // Only grow once to the maximum allowable size. |
| 594 char* NoAllocationStringAllocator::grow(unsigned* bytes) { | 595 char* NoAllocationStringAllocator::grow(unsigned* bytes) { |
| 595 ASSERT(size_ >= *bytes); | 596 ASSERT(size_ >= *bytes); |
| 596 *bytes = size_; | 597 *bytes = size_; |
| 597 return space_; | 598 return space_; |
| 598 } | 599 } |
| 599 | 600 |
| 600 | 601 |
| 601 } } // namespace v8::internal | 602 } } // namespace v8::internal |
| OLD | NEW |