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

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: REBASE. 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..145506334982db54c24b49434100a8b7a0dde3b1 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);
@@ -172,10 +175,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