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

Unified Diff: src/mark-compact.cc

Issue 203070: Stop "cooking" targets of jumps and calls in code objects. Do not convert ju... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 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
« no previous file with comments | « src/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698