| 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/v8.h" | 5 #include "src/v8.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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 case LO_SPACE: | 502 case LO_SPACE: |
| 503 return "large_object_space"; | 503 return "large_object_space"; |
| 504 default: | 504 default: |
| 505 UNREACHABLE(); | 505 UNREACHABLE(); |
| 506 } | 506 } |
| 507 return nullptr; | 507 return nullptr; |
| 508 } | 508 } |
| 509 | 509 |
| 510 | 510 |
| 511 void Heap::ClearAllICsByKind(Code::Kind kind) { | 511 void Heap::ClearAllICsByKind(Code::Kind kind) { |
| 512 // If concurrent sweeping is in progress, we have to wait for the sweeper | |
| 513 // threads before we iterate the heap. | |
| 514 if (mark_compact_collector()->sweeping_in_progress()) { | |
| 515 mark_compact_collector()->EnsureSweepingCompleted(); | |
| 516 } | |
| 517 // TODO(mvstanton): Do not iterate the heap. | |
| 518 HeapObjectIterator it(code_space()); | 512 HeapObjectIterator it(code_space()); |
| 519 | 513 |
| 520 for (Object* object = it.Next(); object != NULL; object = it.Next()) { | 514 for (Object* object = it.Next(); object != NULL; object = it.Next()) { |
| 521 Code* code = Code::cast(object); | 515 Code* code = Code::cast(object); |
| 522 Code::Kind current_kind = code->kind(); | 516 Code::Kind current_kind = code->kind(); |
| 523 if (current_kind == Code::FUNCTION || | 517 if (current_kind == Code::FUNCTION || |
| 524 current_kind == Code::OPTIMIZED_FUNCTION) { | 518 current_kind == Code::OPTIMIZED_FUNCTION) { |
| 525 code->ClearInlineCaches(kind); | 519 code->ClearInlineCaches(kind); |
| 526 } | 520 } |
| 527 } | 521 } |
| (...skipping 4628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5156 | 5150 |
| 5157 new_space_.Verify(); | 5151 new_space_.Verify(); |
| 5158 | 5152 |
| 5159 old_space_->Verify(&visitor); | 5153 old_space_->Verify(&visitor); |
| 5160 map_space_->Verify(&visitor); | 5154 map_space_->Verify(&visitor); |
| 5161 | 5155 |
| 5162 VerifyPointersVisitor no_dirty_regions_visitor; | 5156 VerifyPointersVisitor no_dirty_regions_visitor; |
| 5163 code_space_->Verify(&no_dirty_regions_visitor); | 5157 code_space_->Verify(&no_dirty_regions_visitor); |
| 5164 | 5158 |
| 5165 lo_space_->Verify(); | 5159 lo_space_->Verify(); |
| 5166 | |
| 5167 mark_compact_collector_.VerifyWeakEmbeddedObjectsInCode(); | |
| 5168 if (FLAG_omit_map_checks_for_leaf_maps) { | |
| 5169 mark_compact_collector_.VerifyOmittedMapChecks(); | |
| 5170 } | |
| 5171 } | 5160 } |
| 5172 #endif | 5161 #endif |
| 5173 | 5162 |
| 5174 | 5163 |
| 5175 void Heap::ZapFromSpace() { | 5164 void Heap::ZapFromSpace() { |
| 5176 if (!new_space_.IsFromSpaceCommitted()) return; | 5165 if (!new_space_.IsFromSpaceCommitted()) return; |
| 5177 NewSpacePageIterator it(new_space_.FromSpaceStart(), | 5166 NewSpacePageIterator it(new_space_.FromSpaceStart(), |
| 5178 new_space_.FromSpaceEnd()); | 5167 new_space_.FromSpaceEnd()); |
| 5179 while (it.has_next()) { | 5168 while (it.has_next()) { |
| 5180 NewSpacePage* page = it.next(); | 5169 NewSpacePage* page = it.next(); |
| (...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6898 *object_type = "CODE_TYPE"; \ | 6887 *object_type = "CODE_TYPE"; \ |
| 6899 *object_sub_type = "CODE_AGE/" #name; \ | 6888 *object_sub_type = "CODE_AGE/" #name; \ |
| 6900 return true; | 6889 return true; |
| 6901 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6890 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6902 #undef COMPARE_AND_RETURN_NAME | 6891 #undef COMPARE_AND_RETURN_NAME |
| 6903 } | 6892 } |
| 6904 return false; | 6893 return false; |
| 6905 } | 6894 } |
| 6906 } // namespace internal | 6895 } // namespace internal |
| 6907 } // namespace v8 | 6896 } // namespace v8 |
| OLD | NEW |