OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 } | 834 } |
835 | 835 |
836 static void VisitGlobalPropertyCell(Heap* heap, RelocInfo* rinfo) { | 836 static void VisitGlobalPropertyCell(Heap* heap, RelocInfo* rinfo) { |
837 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); | 837 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); |
838 JSGlobalPropertyCell* cell = | 838 JSGlobalPropertyCell* cell = |
839 JSGlobalPropertyCell::cast(rinfo->target_cell()); | 839 JSGlobalPropertyCell::cast(rinfo->target_cell()); |
840 MarkBit mark = Marking::MarkBitFrom(cell); | 840 MarkBit mark = Marking::MarkBitFrom(cell); |
841 heap->mark_compact_collector()->MarkObject(cell, mark); | 841 heap->mark_compact_collector()->MarkObject(cell, mark); |
842 } | 842 } |
843 | 843 |
| 844 static inline void VisitEmbeddedPointer(Heap* heap, Code* host, Object** p) { |
| 845 MarkObjectByPointer(heap->mark_compact_collector(), |
| 846 reinterpret_cast<Object**>(host), |
| 847 p); |
| 848 } |
| 849 |
844 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { | 850 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { |
845 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 851 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
846 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 852 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
847 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()) { | 853 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()) { |
848 IC::Clear(rinfo->pc()); | 854 IC::Clear(rinfo->pc()); |
849 // Please note targets for cleared inline cached do not have to be | 855 // Please note targets for cleared inline cached do not have to be |
850 // marked since they are contained in HEAP->non_monomorphic_cache(). | 856 // marked since they are contained in HEAP->non_monomorphic_cache(). |
851 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 857 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
852 } else { | 858 } else { |
853 if (FLAG_cleanup_code_caches_at_gc && | 859 if (FLAG_cleanup_code_caches_at_gc && |
(...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2434 explicit PointersUpdatingVisitor(Heap* heap) : heap_(heap) { } | 2440 explicit PointersUpdatingVisitor(Heap* heap) : heap_(heap) { } |
2435 | 2441 |
2436 void VisitPointer(Object** p) { | 2442 void VisitPointer(Object** p) { |
2437 UpdatePointer(p); | 2443 UpdatePointer(p); |
2438 } | 2444 } |
2439 | 2445 |
2440 void VisitPointers(Object** start, Object** end) { | 2446 void VisitPointers(Object** start, Object** end) { |
2441 for (Object** p = start; p < end; p++) UpdatePointer(p); | 2447 for (Object** p = start; p < end; p++) UpdatePointer(p); |
2442 } | 2448 } |
2443 | 2449 |
| 2450 void VisitEmbeddedPointer(Code* host, Object** p) { |
| 2451 UpdatePointer(p); |
| 2452 } |
| 2453 |
2444 void VisitCodeTarget(RelocInfo* rinfo) { | 2454 void VisitCodeTarget(RelocInfo* rinfo) { |
2445 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 2455 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
2446 Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 2456 Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
2447 VisitPointer(&target); | 2457 VisitPointer(&target); |
2448 rinfo->set_target_address(Code::cast(target)->instruction_start()); | 2458 rinfo->set_target_address(Code::cast(target)->instruction_start()); |
2449 } | 2459 } |
2450 | 2460 |
2451 void VisitDebugTarget(RelocInfo* rinfo) { | 2461 void VisitDebugTarget(RelocInfo* rinfo) { |
2452 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 2462 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
2453 rinfo->IsPatchedReturnSequence()) || | 2463 rinfo->IsPatchedReturnSequence()) || |
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3844 while (buffer != NULL) { | 3854 while (buffer != NULL) { |
3845 SlotsBuffer* next_buffer = buffer->next(); | 3855 SlotsBuffer* next_buffer = buffer->next(); |
3846 DeallocateBuffer(buffer); | 3856 DeallocateBuffer(buffer); |
3847 buffer = next_buffer; | 3857 buffer = next_buffer; |
3848 } | 3858 } |
3849 *buffer_address = NULL; | 3859 *buffer_address = NULL; |
3850 } | 3860 } |
3851 | 3861 |
3852 | 3862 |
3853 } } // namespace v8::internal | 3863 } } // namespace v8::internal |
OLD | NEW |