| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 | 680 |
| 681 void HeapObjectsMap::RemoveDeadEntries() { | 681 void HeapObjectsMap::RemoveDeadEntries() { |
| 682 ASSERT(entries_.length() > 0 && | 682 ASSERT(entries_.length() > 0 && |
| 683 entries_.at(0).id == 0 && | 683 entries_.at(0).id == 0 && |
| 684 entries_.at(0).addr == NULL); | 684 entries_.at(0).addr == NULL); |
| 685 int first_free_entry = 1; | 685 int first_free_entry = 1; |
| 686 for (int i = 1; i < entries_.length(); ++i) { | 686 for (int i = 1; i < entries_.length(); ++i) { |
| 687 EntryInfo& entry_info = entries_.at(i); | 687 EntryInfo& entry_info = entries_.at(i); |
| 688 if (entry_info.accessed) { | 688 if (entry_info.accessed) { |
| 689 if (first_free_entry != i) { | 689 if (first_free_entry != i) { |
| 690 entries_.at(first_free_entry) = entry_info; | 690 entries_.Set(first_free_entry, entry_info); |
| 691 } | 691 } |
| 692 entries_.at(first_free_entry).accessed = false; | 692 entries_.at(first_free_entry).accessed = false; |
| 693 HashMap::Entry* entry = entries_map_.Lookup( | 693 HashMap::Entry* entry = entries_map_.Lookup( |
| 694 entry_info.addr, ComputePointerHash(entry_info.addr), false); | 694 entry_info.addr, ComputePointerHash(entry_info.addr), false); |
| 695 ASSERT(entry); | 695 ASSERT(entry); |
| 696 entry->value = reinterpret_cast<void*>(first_free_entry); | 696 entry->value = reinterpret_cast<void*>(first_free_entry); |
| 697 ++first_free_entry; | 697 ++first_free_entry; |
| 698 } else { | 698 } else { |
| 699 if (entry_info.addr) { | 699 if (entry_info.addr) { |
| 700 entries_map_.Remove(entry_info.addr, | 700 entries_map_.Remove(entry_info.addr, |
| (...skipping 2375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3076 writer_->AddString("\"<dummy>\""); | 3076 writer_->AddString("\"<dummy>\""); |
| 3077 for (int i = 1; i < sorted_strings.length(); ++i) { | 3077 for (int i = 1; i < sorted_strings.length(); ++i) { |
| 3078 writer_->AddCharacter(','); | 3078 writer_->AddCharacter(','); |
| 3079 SerializeString(sorted_strings[i]); | 3079 SerializeString(sorted_strings[i]); |
| 3080 if (writer_->aborted()) return; | 3080 if (writer_->aborted()) return; |
| 3081 } | 3081 } |
| 3082 } | 3082 } |
| 3083 | 3083 |
| 3084 | 3084 |
| 3085 } } // namespace v8::internal | 3085 } } // namespace v8::internal |
| OLD | NEW |