Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Unified Diff: src/type-feedback-vector.cc

Issue 1029093002: v8:3539 - hold constructor feedback in weak cells (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix in test-heap.cc Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/type-feedback-vector.cc
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc
index 6653bea0eeecd71e31b8fbc4f5e1cd474a91916a..47f89782b006c281e5341941303385df4cf91f4e 100644
--- a/src/type-feedback-vector.cc
+++ b/src/type-feedback-vector.cc
@@ -139,18 +139,21 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::Copy(
// This logic is copied from
// StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget.
-static bool ClearLogic(Heap* heap, int ic_age) {
+static bool ClearLogic(Heap* heap) {
return FLAG_cleanup_code_caches_at_gc &&
heap->isolate()->serializer_enabled();
}
-void TypeFeedbackVector::ClearSlots(SharedFunctionInfo* shared) {
+void TypeFeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared,
+ bool force_clear) {
int slots = Slots();
- Isolate* isolate = GetIsolate();
- Object* uninitialized_sentinel =
- TypeFeedbackVector::RawUninitializedSentinel(isolate->heap());
+ Heap* heap = GetIsolate()->heap();
+
+ if (!force_clear && !ClearLogic(heap)) return;
+ Object* uninitialized_sentinel =
+ TypeFeedbackVector::RawUninitializedSentinel(heap);
for (int i = 0; i < slots; i++) {
FeedbackVectorSlot slot(i);
Object* obj = Get(slot);
@@ -161,7 +164,9 @@ void TypeFeedbackVector::ClearSlots(SharedFunctionInfo* shared) {
// or Code pointers which can cause memory leaks if not cleared
// regularly.
if (instance_type != ALLOCATION_SITE_TYPE) {
+ // if (instance_type != WEAK_CELL_TYPE || force_clear) {
Toon Verwaest 2015/03/25 15:25:51 Remove debugging-comment
mvstanton 2015/03/26 15:28:53 Done.
Set(slot, uninitialized_sentinel, SKIP_WRITE_BARRIER);
+ // }
}
}
}
@@ -172,10 +177,7 @@ void TypeFeedbackVector::ClearICSlotsImpl(SharedFunctionInfo* shared,
bool force_clear) {
Heap* heap = GetIsolate()->heap();
- // I'm not sure yet if this ic age is the correct one.
- int ic_age = shared->ic_age();
-
- if (!force_clear && !ClearLogic(heap, ic_age)) return;
+ if (!force_clear && !ClearLogic(heap)) return;
int slots = ICSlots();
Code* host = shared->code();
« src/arm/code-stubs-arm.cc ('K') | « src/type-feedback-vector.h ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698