OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1042 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); | 1042 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); |
1043 MarkBit mark = Marking::MarkBitFrom(object); | 1043 MarkBit mark = Marking::MarkBitFrom(object); |
1044 heap->mark_compact_collector()->MarkObject(object, mark); | 1044 heap->mark_compact_collector()->MarkObject(object, mark); |
1045 } | 1045 } |
1046 | 1046 |
1047 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { | 1047 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { |
1048 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 1048 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
1049 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 1049 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
1050 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() | 1050 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() |
1051 && (target->ic_state() == MEGAMORPHIC || | 1051 && (target->ic_state() == MEGAMORPHIC || |
1052 heap->mark_compact_collector()->flush_monomorphic_ics_)) { | 1052 heap->mark_compact_collector()->flush_monomorphic_ics_ || |
1053 target->context_disposed_count() != | |
1054 heap->global_context_disposed_count())) { | |
1053 IC::Clear(rinfo->pc()); | 1055 IC::Clear(rinfo->pc()); |
Vyacheslav Egorov (Chromium)
2012/03/22 14:47:05
I would expect we reset counter to be equal to hea
ulan
2012/03/23 10:47:13
As discussed offline, this should work because we
| |
1054 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 1056 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
1055 } | 1057 } |
1056 MarkBit code_mark = Marking::MarkBitFrom(target); | 1058 MarkBit code_mark = Marking::MarkBitFrom(target); |
1057 heap->mark_compact_collector()->MarkObject(target, code_mark); | 1059 heap->mark_compact_collector()->MarkObject(target, code_mark); |
1058 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 1060 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
1059 } | 1061 } |
1060 | 1062 |
1061 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { | 1063 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { |
1062 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 1064 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
1063 rinfo->IsPatchedReturnSequence()) || | 1065 rinfo->IsPatchedReturnSequence()) || |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1398 } | 1400 } |
1399 | 1401 |
1400 | 1402 |
1401 static void VisitSharedFunctionInfoAndFlushCodeGeneric( | 1403 static void VisitSharedFunctionInfoAndFlushCodeGeneric( |
1402 Map* map, HeapObject* object, bool known_flush_code_candidate) { | 1404 Map* map, HeapObject* object, bool known_flush_code_candidate) { |
1403 Heap* heap = map->GetHeap(); | 1405 Heap* heap = map->GetHeap(); |
1404 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); | 1406 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); |
1405 | 1407 |
1406 if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap(); | 1408 if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap(); |
1407 | 1409 |
1410 if (shared->context_disposed_count() != | |
1411 heap->global_context_disposed_count()) { | |
1412 shared->set_context_disposed_count(heap->global_context_disposed_count()); | |
Vyacheslav Egorov (Chromium)
2012/03/22 14:47:05
I suppose this piece of code is here to prevent op
ulan
2012/03/23 10:47:13
This is to prevent us from marking a function as n
| |
1413 shared->set_opt_count(0); | |
1414 } | |
1415 | |
1408 if (!known_flush_code_candidate) { | 1416 if (!known_flush_code_candidate) { |
1409 known_flush_code_candidate = IsFlushable(heap, shared); | 1417 known_flush_code_candidate = IsFlushable(heap, shared); |
1410 if (known_flush_code_candidate) { | 1418 if (known_flush_code_candidate) { |
1411 heap->mark_compact_collector()->code_flusher()->AddCandidate(shared); | 1419 heap->mark_compact_collector()->code_flusher()->AddCandidate(shared); |
1412 } | 1420 } |
1413 } | 1421 } |
1414 | 1422 |
1415 VisitSharedFunctionInfoFields(heap, object, known_flush_code_candidate); | 1423 VisitSharedFunctionInfoFields(heap, object, known_flush_code_candidate); |
1416 } | 1424 } |
1417 | 1425 |
(...skipping 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4130 while (buffer != NULL) { | 4138 while (buffer != NULL) { |
4131 SlotsBuffer* next_buffer = buffer->next(); | 4139 SlotsBuffer* next_buffer = buffer->next(); |
4132 DeallocateBuffer(buffer); | 4140 DeallocateBuffer(buffer); |
4133 buffer = next_buffer; | 4141 buffer = next_buffer; |
4134 } | 4142 } |
4135 *buffer_address = NULL; | 4143 *buffer_address = NULL; |
4136 } | 4144 } |
4137 | 4145 |
4138 | 4146 |
4139 } } // namespace v8::internal | 4147 } } // namespace v8::internal |
OLD | NEW |