Index: src/mark-compact.cc |
=================================================================== |
--- src/mark-compact.cc (revision 5500) |
+++ src/mark-compact.cc (working copy) |
@@ -282,10 +282,7 @@ |
FixedArray::BodyDescriptor, |
void>::Visit); |
- table_.Register(kVisitSharedFunctionInfo, |
- &FixedBodyVisitor<StaticMarkingVisitor, |
- SharedFunctionInfo::BodyDescriptor, |
- void>::Visit); |
+ table_.Register(kVisitSharedFunctionInfo, &VisitSharedFunctionInfo); |
table_.Register(kVisitByteArray, &DataObjectVisitor::Visit); |
table_.Register(kVisitSeqAsciiString, &DataObjectVisitor::Visit); |
@@ -537,6 +534,17 @@ |
} |
+ static void VisitSharedFunctionInfo(Map* map, HeapObject* object) { |
+ SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); |
+ if (shared->IsInobjectSlackTrackingInProgress()) { |
+ shared->DetachInitialMap(); |
+ } |
+ FixedBodyVisitor<StaticMarkingVisitor, |
+ SharedFunctionInfo::BodyDescriptor, |
+ void>::Visit(map, object); |
+ } |
+ |
+ |
static void VisitCodeEntry(Address entry_address) { |
Object* code = Code::GetObjectFromEntryAddress(entry_address); |
Object* old_code = code; |
@@ -1139,6 +1147,12 @@ |
// Only JSObject and subtypes have map transitions and back pointers. |
if (map->instance_type() < FIRST_JS_OBJECT_TYPE) continue; |
if (map->instance_type() > JS_FUNCTION_TYPE) continue; |
+ |
+ if (map->IsMarked() && map->attached_to_shared_function_info()) { |
Vitaly Repeshko
2010/09/22 14:40:25
This needs a short comment.
Vladislav Kaznacheev
2010/09/23 08:38:16
Done.
|
+ map->unchecked_constructor()->unchecked_shared()-> |
+ AttachInitialMap(map); |
+ } |
+ |
// Follow the chain of back pointers to find the prototype. |
Map* current = map; |
while (SafeIsMap(current)) { |