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 // TODO(mvstanton): Do not iterate the heap. |
512 HeapObjectIterator it(code_space()); | 513 HeapObjectIterator it(code_space()); |
513 | 514 |
514 for (Object* object = it.Next(); object != NULL; object = it.Next()) { | 515 for (Object* object = it.Next(); object != NULL; object = it.Next()) { |
515 Code* code = Code::cast(object); | 516 Code* code = Code::cast(object); |
516 Code::Kind current_kind = code->kind(); | 517 Code::Kind current_kind = code->kind(); |
517 if (current_kind == Code::FUNCTION || | 518 if (current_kind == Code::FUNCTION || |
518 current_kind == Code::OPTIMIZED_FUNCTION) { | 519 current_kind == Code::OPTIMIZED_FUNCTION) { |
519 code->ClearInlineCaches(kind); | 520 code->ClearInlineCaches(kind); |
520 } | 521 } |
521 } | 522 } |
(...skipping 4721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5243 | 5244 |
5244 new_space_.Verify(); | 5245 new_space_.Verify(); |
5245 | 5246 |
5246 old_space_->Verify(&visitor); | 5247 old_space_->Verify(&visitor); |
5247 map_space_->Verify(&visitor); | 5248 map_space_->Verify(&visitor); |
5248 | 5249 |
5249 VerifyPointersVisitor no_dirty_regions_visitor; | 5250 VerifyPointersVisitor no_dirty_regions_visitor; |
5250 code_space_->Verify(&no_dirty_regions_visitor); | 5251 code_space_->Verify(&no_dirty_regions_visitor); |
5251 | 5252 |
5252 lo_space_->Verify(); | 5253 lo_space_->Verify(); |
| 5254 |
| 5255 mark_compact_collector_.VerifyWeakEmbeddedObjectsInCode(); |
| 5256 if (FLAG_omit_map_checks_for_leaf_maps) { |
| 5257 mark_compact_collector_.VerifyOmittedMapChecks(); |
| 5258 } |
5253 } | 5259 } |
5254 #endif | 5260 #endif |
5255 | 5261 |
5256 | 5262 |
5257 void Heap::ZapFromSpace() { | 5263 void Heap::ZapFromSpace() { |
5258 if (!new_space_.IsFromSpaceCommitted()) return; | 5264 if (!new_space_.IsFromSpaceCommitted()) return; |
5259 NewSpacePageIterator it(new_space_.FromSpaceStart(), | 5265 NewSpacePageIterator it(new_space_.FromSpaceStart(), |
5260 new_space_.FromSpaceEnd()); | 5266 new_space_.FromSpaceEnd()); |
5261 while (it.has_next()) { | 5267 while (it.has_next()) { |
5262 NewSpacePage* page = it.next(); | 5268 NewSpacePage* page = it.next(); |
(...skipping 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6989 *object_type = "CODE_TYPE"; \ | 6995 *object_type = "CODE_TYPE"; \ |
6990 *object_sub_type = "CODE_AGE/" #name; \ | 6996 *object_sub_type = "CODE_AGE/" #name; \ |
6991 return true; | 6997 return true; |
6992 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6998 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6993 #undef COMPARE_AND_RETURN_NAME | 6999 #undef COMPARE_AND_RETURN_NAME |
6994 } | 7000 } |
6995 return false; | 7001 return false; |
6996 } | 7002 } |
6997 } // namespace internal | 7003 } // namespace internal |
6998 } // namespace v8 | 7004 } // namespace v8 |
OLD | NEW |