| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 Handle<String> StringStream::ToString() { | 284 Handle<String> StringStream::ToString() { |
| 285 return FACTORY->NewStringFromUtf8(Vector<const char>(buffer_, length_)); | 285 return FACTORY->NewStringFromUtf8(Vector<const char>(buffer_, length_)); |
| 286 } | 286 } |
| 287 | 287 |
| 288 | 288 |
| 289 void StringStream::ClearMentionedObjectCache() { | 289 void StringStream::ClearMentionedObjectCache() { |
| 290 Isolate* isolate = Isolate::Current(); | 290 Isolate* isolate = Isolate::Current(); |
| 291 isolate->set_string_stream_current_security_token(NULL); | 291 isolate->set_string_stream_current_security_token(NULL); |
| 292 if (isolate->string_stream_debug_object_cache() == NULL) { | 292 if (isolate->string_stream_debug_object_cache() == NULL) { |
| 293 isolate->set_string_stream_debug_object_cache( | 293 isolate->set_string_stream_debug_object_cache( |
| 294 new List<HeapObject*, PreallocatedStorage>(0)); | 294 new List<HeapObject*, PreallocatedStorageAllocationPolicy>(0)); |
| 295 } | 295 } |
| 296 isolate->string_stream_debug_object_cache()->Clear(); | 296 isolate->string_stream_debug_object_cache()->Clear(); |
| 297 } | 297 } |
| 298 | 298 |
| 299 | 299 |
| 300 #ifdef DEBUG | 300 #ifdef DEBUG |
| 301 bool StringStream::IsMentionedObjectCacheClear() { | 301 bool StringStream::IsMentionedObjectCacheClear() { |
| 302 return ( | 302 return ( |
| 303 Isolate::Current()->string_stream_debug_object_cache()->length() == 0); | 303 Isolate::Current()->string_stream_debug_object_cache()->length() == 0); |
| 304 } | 304 } |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 | 580 |
| 581 // Only grow once to the maximum allowable size. | 581 // Only grow once to the maximum allowable size. |
| 582 char* NoAllocationStringAllocator::grow(unsigned* bytes) { | 582 char* NoAllocationStringAllocator::grow(unsigned* bytes) { |
| 583 ASSERT(size_ >= *bytes); | 583 ASSERT(size_ >= *bytes); |
| 584 *bytes = size_; | 584 *bytes = size_; |
| 585 return space_; | 585 return space_; |
| 586 } | 586 } |
| 587 | 587 |
| 588 | 588 |
| 589 } } // namespace v8::internal | 589 } } // namespace v8::internal |
| OLD | NEW |