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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 // the object. | 397 // the object. |
398 uint32_t type = map->instance_type(); | 398 uint32_t type = map->instance_type(); |
399 bool is_external = (type & kStringRepresentationMask) == | 399 bool is_external = (type & kStringRepresentationMask) == |
400 kExternalStringTag; | 400 kExternalStringTag; |
401 if (is_external) { | 401 if (is_external) { |
402 bool is_two_byte = (type & kStringEncodingMask) == kTwoByteStringTag; | 402 bool is_two_byte = (type & kStringEncodingMask) == kTwoByteStringTag; |
403 byte* resource_addr = reinterpret_cast<byte*>(*p) + | 403 byte* resource_addr = reinterpret_cast<byte*>(*p) + |
404 ExternalString::kResourceOffset - | 404 ExternalString::kResourceOffset - |
405 kHeapObjectTag; | 405 kHeapObjectTag; |
406 if (is_two_byte) { | 406 if (is_two_byte) { |
407 v8::String::ExternalStringResource* resource = | 407 v8::String::ExternalStringResource** resource = |
408 *reinterpret_cast<v8::String::ExternalStringResource**> | 408 reinterpret_cast<v8::String::ExternalStringResource**> |
409 (resource_addr); | 409 (resource_addr); |
410 delete resource; | 410 delete *resource; |
| 411 // Clear the resource pointer in the symbol. |
| 412 *resource = NULL; |
411 } else { | 413 } else { |
412 v8::String::ExternalAsciiStringResource* resource = | 414 v8::String::ExternalAsciiStringResource** resource = |
413 *reinterpret_cast<v8::String::ExternalAsciiStringResource**> | 415 reinterpret_cast<v8::String::ExternalAsciiStringResource**> |
414 (resource_addr); | 416 (resource_addr); |
415 delete resource; | 417 delete *resource; |
| 418 // Clear the resource pointer in the symbol. |
| 419 *resource = NULL; |
416 } | 420 } |
417 } | 421 } |
418 // Set the entry to null_value (as deleted). | 422 // Set the entry to null_value (as deleted). |
419 *p = Heap::null_value(); | 423 *p = Heap::null_value(); |
420 pointers_removed_++; | 424 pointers_removed_++; |
421 } | 425 } |
422 } | 426 } |
423 } | 427 } |
424 | 428 |
425 int PointersRemoved() { | 429 int PointersRemoved() { |
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 | 1756 |
1753 void MarkCompactCollector::RebuildRSets() { | 1757 void MarkCompactCollector::RebuildRSets() { |
1754 #ifdef DEBUG | 1758 #ifdef DEBUG |
1755 ASSERT(state_ == RELOCATE_OBJECTS); | 1759 ASSERT(state_ == RELOCATE_OBJECTS); |
1756 state_ = REBUILD_RSETS; | 1760 state_ = REBUILD_RSETS; |
1757 #endif | 1761 #endif |
1758 Heap::RebuildRSets(); | 1762 Heap::RebuildRSets(); |
1759 } | 1763 } |
1760 | 1764 |
1761 } } // namespace v8::internal | 1765 } } // namespace v8::internal |
OLD | NEW |