Index: src/mark-compact.cc |
=================================================================== |
--- src/mark-compact.cc (revision 2940) |
+++ src/mark-compact.cc (working copy) |
@@ -265,18 +265,6 @@ |
for (Object** p = start; p < end; p++) MarkObjectByPointer(p); |
} |
- void BeginCodeIteration(Code* code) { |
- // When iterating over a code object during marking |
- // ic targets are derived pointers. |
- ASSERT(code->ic_flag() == Code::IC_TARGET_IS_ADDRESS); |
- } |
- |
- void EndCodeIteration(Code* code) { |
- // If this is a compacting collection, set ic targets |
- // are pointing to object headers. |
- if (IsCompacting()) code->set_ic_flag(Code::IC_TARGET_IS_OBJECT); |
- } |
- |
void VisitCodeTarget(RelocInfo* rinfo) { |
ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
Code* code = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
@@ -287,11 +275,6 @@ |
} else { |
MarkCompactCollector::MarkObject(code); |
} |
- if (IsCompacting()) { |
- // When compacting we convert the target to a real object pointer. |
- code = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
- rinfo->set_target_object(code); |
- } |
} |
void VisitDebugTarget(RelocInfo* rinfo) { |
@@ -1187,12 +1170,6 @@ |
if (object->IsMarked()) { |
object->ClearMark(); |
MarkCompactCollector::tracer()->decrement_marked_count(); |
- if (MarkCompactCollector::IsCompacting() && object->IsCode()) { |
- // If this is compacting collection marked code objects have had |
- // their IC targets converted to objects. |
- // They need to be converted back to addresses. |
- Code::cast(object)->ConvertICTargetsFromObjectToAddress(); |
- } |
if (!is_previous_alive) { // Transition from free to live. |
dealloc(free_start, current - free_start); |
is_previous_alive = true; |
@@ -1398,6 +1375,14 @@ |
for (Object** p = start; p < end; p++) UpdatePointer(p); |
} |
+ void VisitCodeTarget(RelocInfo* rinfo) { |
+ ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
+ Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
+ VisitPointer(&target); |
+ rinfo->set_target_address( |
+ reinterpret_cast<Code*>(target)->instruction_start()); |
+ } |
+ |
private: |
void UpdatePointer(Object** p) { |
if (!(*p)->IsHeapObject()) return; |
@@ -1631,11 +1616,6 @@ |
ASSERT(live_cells == live_cell_objects_); |
ASSERT(live_news == live_young_objects_); |
- // Notify code object in LO to convert IC target to address |
- // This must happen after lo_space_->Compact |
- LargeObjectIterator it(Heap::lo_space()); |
- while (it.has_next()) { ConvertCodeICTargetToAddress(it.next()); } |
- |
// Flip from and to spaces |
Heap::new_space()->Flip(); |
@@ -1654,14 +1634,6 @@ |
} |
-int MarkCompactCollector::ConvertCodeICTargetToAddress(HeapObject* obj) { |
- if (obj->IsCode()) { |
- Code::cast(obj)->ConvertICTargetsFromObjectToAddress(); |
- } |
- return obj->Size(); |
-} |
- |
- |
int MarkCompactCollector::RelocateMapObject(HeapObject* obj) { |
// Recover map pointer. |
MapWord encoding = obj->map_word(); |
@@ -1770,11 +1742,6 @@ |
// Reset the map pointer. |
int obj_size = RestoreMap(obj, Heap::code_space(), new_addr, map_addr); |
- // Convert inline cache target to address using old address. |
- if (obj->IsCode()) { |
- Code::cast(obj)->ConvertICTargetsFromObjectToAddress(); |
- } |
- |
Address old_addr = obj->address(); |
if (new_addr != old_addr) { |