Reviewers: mvstanton,

Message:
PTAL. Since v8:3629 is fixed, ICs and handlers do not retain objects.

Description:
Remove IC age from Code.

BUG=

Please review this at https://codereview.chromium.org/879693004/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+2, -13 lines):
  M src/factory.cc
  M src/heap/heap.cc
  M src/heap/objects-visiting-inl.h
  M src/objects.h
  M src/objects.cc
  M src/objects-inl.h


Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index ef695cf337d0acfddda343be09407b9df19f43b4..b3779f291af96bf7cefd769c838fc1534aa9a665 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1457,7 +1457,6 @@ Handle<Code> Factory::NewCode(const CodeDesc& desc,
   // fact that no allocation will happen from this point on.
   DisallowHeapAllocation no_gc;
   code->set_gc_metadata(Smi::FromInt(0));
-  code->set_ic_age(isolate()->heap()->global_ic_age());
   code->set_instruction_size(desc.instr_size);
   code->set_relocation_info(*reloc_info);
   code->set_flags(flags);
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 0742aafc83913c1c3e4a46792ca6da2e415c2ebe..9f07bda35b1ed744a116b6960603ae3838958816 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3653,7 +3653,6 @@ AllocationResult Heap::AllocateCode(int object_size, bool immovable) { DCHECK(isolate_->code_range() == NULL | | !isolate_->code_range()->valid() ||
          isolate_->code_range()->contains(code->address()));
   code->set_gc_metadata(Smi::FromInt(0));
-  code->set_ic_age(global_ic_age_);
   return code;
 }

Index: src/heap/objects-visiting-inl.h
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h index abdccc2ebd20de4582032f091b9bfc88dc5f4651..810b38b61edfb89010259fb796950028c2c0d09a 100644
--- a/src/heap/objects-visiting-inl.h
+++ b/src/heap/objects-visiting-inl.h
@@ -262,8 +262,7 @@ void StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget(Heap* heap,
   // when they might be keeping a Context alive, or when the heap is about
   // to be serialized.
   if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() &&
-      !target->is_call_stub() && (heap->isolate()->serializer_enabled() ||
- target->ic_age() != heap->global_ic_age())) {
+      !target->is_call_stub() && heap->isolate()->serializer_enabled()) {
     ICUtility::Clear(heap->isolate(), rinfo->pc(),
                      rinfo->host()->constant_pool());
     target = Code::GetCodeFromTargetAddress(rinfo->target_address());
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 9e9bd591b112a3cee24c911cc8ec50bca0f21ec1..13f8427c3e3ea86b7c2ad232d9a53a6f5899776f 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -6451,7 +6451,6 @@ void Code::set_stub_key(uint32_t key) {


 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset)
-INT_ACCESSORS(Code, ic_age, kICAgeOffset)


 byte* Code::instruction_start()  {
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index e8a945407733b880a26aa75bd76ad83fe5646d0d..23adc2eea21067bfe7264735ddc38af12df2bb05 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -10342,7 +10342,6 @@ void JSFunction::StartInobjectSlackTracking() {


 void SharedFunctionInfo::ResetForNewContext(int new_ic_age) {
-  code()->ClearInlineCaches();
   // If we clear ICs, we need to clear the type feedback vector too, since
   // CallICs are synced with a feedback vector slot.
   ClearTypeFeedbackInfo();
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index b49efaa1feb9eb6eb18d01870813954a9c919434..ba0c2123567017cffe6668531044918e729173f6 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5051,11 +5051,6 @@ class Code: public HeapObject {
   // it is only used by the garbage collector itself.
   DECL_ACCESSORS(gc_metadata, Object)

-  // [ic_age]: Inline caching age: the value of the Heap::global_ic_age
-  // at the moment when this object was created.
-  inline void set_ic_age(int count);
-  inline int ic_age() const;
-
   // [prologue_offset]: Offset of the function prologue, used for aging
   // FUNCTIONs and OPTIMIZED_FUNCTIONs.
   inline int prologue_offset() const;
@@ -5412,8 +5407,7 @@ class Code: public HeapObject {
static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize;
   static const int kGCMetadataOffset = kNextCodeLinkOffset + kPointerSize;
static const int kInstructionSizeOffset = kGCMetadataOffset + kPointerSize;
-  static const int kICAgeOffset = kInstructionSizeOffset + kIntSize;
-  static const int kFlagsOffset = kICAgeOffset + kIntSize;
+  static const int kFlagsOffset = kInstructionSizeOffset + kIntSize;
   static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize;
   static const int kKindSpecificFlags2Offset =
       kKindSpecificFlags1Offset + kIntSize;


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to