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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
470 return "code_space"; | 470 return "code_space"; |
471 case LO_SPACE: | 471 case LO_SPACE: |
472 return "large_object_space"; | 472 return "large_object_space"; |
473 default: | 473 default: |
474 UNREACHABLE(); | 474 UNREACHABLE(); |
475 } | 475 } |
476 return nullptr; | 476 return nullptr; |
477 } | 477 } |
478 | 478 |
479 | 479 |
480 void Heap::ClearAllICsByKind(Code::Kind kind) { | 480 void Heap::ClearAllKeyedStoreICs() { |
Hannes Payer (out of office)
2015/08/26 21:46:33
I do not like that heap owns this method. It has n
mvstanton
2015/08/27 08:17:33
Okay, I've taken the new code and moved it. The ca
| |
481 // TODO(mvstanton): Do not iterate the heap. | 481 if (FLAG_vector_stores) { |
482 HeapObjectIterator it(code_space()); | 482 SharedFunctionInfo::Iterator iterator(isolate_); |
483 SharedFunctionInfo* shared; | |
484 while ((shared = iterator.Next())) { | |
485 TypeFeedbackVector* vector = shared->feedback_vector(); | |
486 vector->ClearKeyedStoreICs(shared); | |
487 } | |
488 } else { | |
489 // TODO(mvstanton): Remove this branch when FLAG_vector_stores is turned on | |
490 // permanently. | |
491 HeapObjectIterator it(code_space()); | |
483 | 492 |
484 for (Object* object = it.Next(); object != NULL; object = it.Next()) { | 493 for (Object* object = it.Next(); object != NULL; object = it.Next()) { |
485 Code* code = Code::cast(object); | 494 Code* code = Code::cast(object); |
486 Code::Kind current_kind = code->kind(); | 495 Code::Kind current_kind = code->kind(); |
487 if (current_kind == Code::FUNCTION || | 496 if (current_kind == Code::FUNCTION || |
488 current_kind == Code::OPTIMIZED_FUNCTION) { | 497 current_kind == Code::OPTIMIZED_FUNCTION) { |
489 code->ClearInlineCaches(kind); | 498 code->ClearInlineCaches(Code::KEYED_STORE_IC); |
499 } | |
490 } | 500 } |
491 } | 501 } |
492 } | 502 } |
493 | 503 |
494 | 504 |
495 void Heap::RepairFreeListsAfterDeserialization() { | 505 void Heap::RepairFreeListsAfterDeserialization() { |
496 PagedSpaces spaces(this); | 506 PagedSpaces spaces(this); |
497 for (PagedSpace* space = spaces.next(); space != NULL; | 507 for (PagedSpace* space = spaces.next(); space != NULL; |
498 space = spaces.next()) { | 508 space = spaces.next()) { |
499 space->RepairFreeListsAfterDeserialization(); | 509 space->RepairFreeListsAfterDeserialization(); |
(...skipping 6272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6772 *object_type = "CODE_TYPE"; \ | 6782 *object_type = "CODE_TYPE"; \ |
6773 *object_sub_type = "CODE_AGE/" #name; \ | 6783 *object_sub_type = "CODE_AGE/" #name; \ |
6774 return true; | 6784 return true; |
6775 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6785 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6776 #undef COMPARE_AND_RETURN_NAME | 6786 #undef COMPARE_AND_RETURN_NAME |
6777 } | 6787 } |
6778 return false; | 6788 return false; |
6779 } | 6789 } |
6780 } // namespace internal | 6790 } // namespace internal |
6781 } // namespace v8 | 6791 } // namespace v8 |
OLD | NEW |