| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/heap/heap.h" | 5 #include "src/heap/heap.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 6442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6453 void KeyedLookupCache::Clear() { | 6453 void KeyedLookupCache::Clear() { |
| 6454 for (int index = 0; index < kLength; index++) keys_[index].map = NULL; | 6454 for (int index = 0; index < kLength; index++) keys_[index].map = NULL; |
| 6455 } | 6455 } |
| 6456 | 6456 |
| 6457 | 6457 |
| 6458 void DescriptorLookupCache::Clear() { | 6458 void DescriptorLookupCache::Clear() { |
| 6459 for (int index = 0; index < kLength; index++) keys_[index].source = NULL; | 6459 for (int index = 0; index < kLength; index++) keys_[index].source = NULL; |
| 6460 } | 6460 } |
| 6461 | 6461 |
| 6462 | 6462 |
| 6463 void ExternalStringTable::CleanUp() { | 6463 void Heap::ExternalStringTable::CleanUp() { |
| 6464 int last = 0; | 6464 int last = 0; |
| 6465 for (int i = 0; i < new_space_strings_.length(); ++i) { | 6465 for (int i = 0; i < new_space_strings_.length(); ++i) { |
| 6466 if (new_space_strings_[i] == heap_->the_hole_value()) { | 6466 if (new_space_strings_[i] == heap_->the_hole_value()) { |
| 6467 continue; | 6467 continue; |
| 6468 } | 6468 } |
| 6469 DCHECK(new_space_strings_[i]->IsExternalString()); | 6469 DCHECK(new_space_strings_[i]->IsExternalString()); |
| 6470 if (heap_->InNewSpace(new_space_strings_[i])) { | 6470 if (heap_->InNewSpace(new_space_strings_[i])) { |
| 6471 new_space_strings_[last++] = new_space_strings_[i]; | 6471 new_space_strings_[last++] = new_space_strings_[i]; |
| 6472 } else { | 6472 } else { |
| 6473 old_space_strings_.Add(new_space_strings_[i]); | 6473 old_space_strings_.Add(new_space_strings_[i]); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 6488 old_space_strings_.Rewind(last); | 6488 old_space_strings_.Rewind(last); |
| 6489 old_space_strings_.Trim(); | 6489 old_space_strings_.Trim(); |
| 6490 #ifdef VERIFY_HEAP | 6490 #ifdef VERIFY_HEAP |
| 6491 if (FLAG_verify_heap) { | 6491 if (FLAG_verify_heap) { |
| 6492 Verify(); | 6492 Verify(); |
| 6493 } | 6493 } |
| 6494 #endif | 6494 #endif |
| 6495 } | 6495 } |
| 6496 | 6496 |
| 6497 | 6497 |
| 6498 void ExternalStringTable::TearDown() { | 6498 void Heap::ExternalStringTable::TearDown() { |
| 6499 for (int i = 0; i < new_space_strings_.length(); ++i) { | 6499 for (int i = 0; i < new_space_strings_.length(); ++i) { |
| 6500 heap_->FinalizeExternalString(ExternalString::cast(new_space_strings_[i])); | 6500 heap_->FinalizeExternalString(ExternalString::cast(new_space_strings_[i])); |
| 6501 } | 6501 } |
| 6502 new_space_strings_.Free(); | 6502 new_space_strings_.Free(); |
| 6503 for (int i = 0; i < old_space_strings_.length(); ++i) { | 6503 for (int i = 0; i < old_space_strings_.length(); ++i) { |
| 6504 heap_->FinalizeExternalString(ExternalString::cast(old_space_strings_[i])); | 6504 heap_->FinalizeExternalString(ExternalString::cast(old_space_strings_[i])); |
| 6505 } | 6505 } |
| 6506 old_space_strings_.Free(); | 6506 old_space_strings_.Free(); |
| 6507 } | 6507 } |
| 6508 | 6508 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6775 *object_type = "CODE_TYPE"; \ | 6775 *object_type = "CODE_TYPE"; \ |
| 6776 *object_sub_type = "CODE_AGE/" #name; \ | 6776 *object_sub_type = "CODE_AGE/" #name; \ |
| 6777 return true; | 6777 return true; |
| 6778 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6778 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6779 #undef COMPARE_AND_RETURN_NAME | 6779 #undef COMPARE_AND_RETURN_NAME |
| 6780 } | 6780 } |
| 6781 return false; | 6781 return false; |
| 6782 } | 6782 } |
| 6783 } // namespace internal | 6783 } // namespace internal |
| 6784 } // namespace v8 | 6784 } // namespace v8 |
| OLD | NEW |