| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 246 |
| 247 | 247 |
| 248 void Heap::FinalizeExternalString(String* string) { | 248 void Heap::FinalizeExternalString(String* string) { |
| 249 ASSERT(string->IsExternalString()); | 249 ASSERT(string->IsExternalString()); |
| 250 v8::String::ExternalStringResourceBase** resource_addr = | 250 v8::String::ExternalStringResourceBase** resource_addr = |
| 251 reinterpret_cast<v8::String::ExternalStringResourceBase**>( | 251 reinterpret_cast<v8::String::ExternalStringResourceBase**>( |
| 252 reinterpret_cast<byte*>(string) + | 252 reinterpret_cast<byte*>(string) + |
| 253 ExternalString::kResourceOffset - | 253 ExternalString::kResourceOffset - |
| 254 kHeapObjectTag); | 254 kHeapObjectTag); |
| 255 | 255 |
| 256 // Clear pointer cache. |
| 257 ExternalString::cast(string)->clear_data_cache(); |
| 258 |
| 256 // Dispose of the C++ object if it has not already been disposed. | 259 // Dispose of the C++ object if it has not already been disposed. |
| 257 if (*resource_addr != NULL) { | 260 if (*resource_addr != NULL) { |
| 258 (*resource_addr)->Dispose(); | 261 (*resource_addr)->Dispose(); |
| 259 } | 262 } |
| 260 | 263 |
| 261 // Clear the resource pointer in the string. | 264 // Clear the resource pointer in the string. |
| 262 *resource_addr = NULL; | 265 *resource_addr = NULL; |
| 263 } | 266 } |
| 264 | 267 |
| 265 | 268 |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 | 704 |
| 702 | 705 |
| 703 Heap* _inline_get_heap_() { | 706 Heap* _inline_get_heap_() { |
| 704 return HEAP; | 707 return HEAP; |
| 705 } | 708 } |
| 706 | 709 |
| 707 | 710 |
| 708 } } // namespace v8::internal | 711 } } // namespace v8::internal |
| 709 | 712 |
| 710 #endif // V8_HEAP_INL_H_ | 713 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |