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 15 matching lines...) Expand all Loading... |
26 #include "src/heap/objects-visiting-inl.h" | 26 #include "src/heap/objects-visiting-inl.h" |
27 #include "src/heap/objects-visiting.h" | 27 #include "src/heap/objects-visiting.h" |
28 #include "src/heap/store-buffer.h" | 28 #include "src/heap/store-buffer.h" |
29 #include "src/heap-profiler.h" | 29 #include "src/heap-profiler.h" |
30 #include "src/interpreter/interpreter.h" | 30 #include "src/interpreter/interpreter.h" |
31 #include "src/runtime-profiler.h" | 31 #include "src/runtime-profiler.h" |
32 #include "src/scopeinfo.h" | 32 #include "src/scopeinfo.h" |
33 #include "src/snapshot/natives.h" | 33 #include "src/snapshot/natives.h" |
34 #include "src/snapshot/serialize.h" | 34 #include "src/snapshot/serialize.h" |
35 #include "src/snapshot/snapshot.h" | 35 #include "src/snapshot/snapshot.h" |
| 36 #include "src/type-feedback-vector.h" |
36 #include "src/utils.h" | 37 #include "src/utils.h" |
37 #include "src/v8.h" | 38 #include "src/v8.h" |
38 #include "src/v8threads.h" | 39 #include "src/v8threads.h" |
39 #include "src/vm-state-inl.h" | 40 #include "src/vm-state-inl.h" |
40 | 41 |
41 namespace v8 { | 42 namespace v8 { |
42 namespace internal { | 43 namespace internal { |
43 | 44 |
44 | 45 |
45 struct Heap::StrongRootsList { | 46 struct Heap::StrongRootsList { |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 return "code_space"; | 471 return "code_space"; |
471 case LO_SPACE: | 472 case LO_SPACE: |
472 return "large_object_space"; | 473 return "large_object_space"; |
473 default: | 474 default: |
474 UNREACHABLE(); | 475 UNREACHABLE(); |
475 } | 476 } |
476 return nullptr; | 477 return nullptr; |
477 } | 478 } |
478 | 479 |
479 | 480 |
480 void Heap::ClearAllICsByKind(Code::Kind kind) { | 481 void Heap::ClearAllKeyedStoreICs() { |
481 // TODO(mvstanton): Do not iterate the heap. | 482 if (FLAG_vector_stores) { |
| 483 TypeFeedbackVector::ClearAllKeyedStoreICs(isolate_); |
| 484 return; |
| 485 } |
| 486 |
| 487 // TODO(mvstanton): Remove this function when FLAG_vector_stores is turned on |
| 488 // permanently, and divert all callers to KeyedStoreIC::ClearAllKeyedStoreICs. |
482 HeapObjectIterator it(code_space()); | 489 HeapObjectIterator it(code_space()); |
483 | 490 |
484 for (Object* object = it.Next(); object != NULL; object = it.Next()) { | 491 for (Object* object = it.Next(); object != NULL; object = it.Next()) { |
485 Code* code = Code::cast(object); | 492 Code* code = Code::cast(object); |
486 Code::Kind current_kind = code->kind(); | 493 Code::Kind current_kind = code->kind(); |
487 if (current_kind == Code::FUNCTION || | 494 if (current_kind == Code::FUNCTION || |
488 current_kind == Code::OPTIMIZED_FUNCTION) { | 495 current_kind == Code::OPTIMIZED_FUNCTION) { |
489 code->ClearInlineCaches(kind); | 496 code->ClearInlineCaches(Code::KEYED_STORE_IC); |
490 } | 497 } |
491 } | 498 } |
492 } | 499 } |
493 | 500 |
494 | 501 |
495 void Heap::RepairFreeListsAfterDeserialization() { | 502 void Heap::RepairFreeListsAfterDeserialization() { |
496 PagedSpaces spaces(this); | 503 PagedSpaces spaces(this); |
497 for (PagedSpace* space = spaces.next(); space != NULL; | 504 for (PagedSpace* space = spaces.next(); space != NULL; |
498 space = spaces.next()) { | 505 space = spaces.next()) { |
499 space->RepairFreeListsAfterDeserialization(); | 506 space->RepairFreeListsAfterDeserialization(); |
(...skipping 6272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6772 *object_type = "CODE_TYPE"; \ | 6779 *object_type = "CODE_TYPE"; \ |
6773 *object_sub_type = "CODE_AGE/" #name; \ | 6780 *object_sub_type = "CODE_AGE/" #name; \ |
6774 return true; | 6781 return true; |
6775 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6782 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6776 #undef COMPARE_AND_RETURN_NAME | 6783 #undef COMPARE_AND_RETURN_NAME |
6777 } | 6784 } |
6778 return false; | 6785 return false; |
6779 } | 6786 } |
6780 } // namespace internal | 6787 } // namespace internal |
6781 } // namespace v8 | 6788 } // namespace v8 |
OLD | NEW |