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 |
11 // with the distribution. | 11 // with the distribution. |
12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
15 // | 15 // |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
| 30 #include "code-stubs.h" |
30 #include "compilation-cache.h" | 31 #include "compilation-cache.h" |
31 #include "deoptimizer.h" | 32 #include "deoptimizer.h" |
32 #include "execution.h" | 33 #include "execution.h" |
33 #include "gdb-jit.h" | 34 #include "gdb-jit.h" |
34 #include "global-handles.h" | 35 #include "global-handles.h" |
35 #include "heap-profiler.h" | 36 #include "heap-profiler.h" |
36 #include "ic-inl.h" | 37 #include "ic-inl.h" |
37 #include "incremental-marking.h" | 38 #include "incremental-marking.h" |
38 #include "liveobjectlist-inl.h" | 39 #include "liveobjectlist-inl.h" |
39 #include "mark-compact.h" | 40 #include "mark-compact.h" |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 | 838 |
838 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { | 839 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { |
839 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 840 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
840 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 841 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
841 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()) { | 842 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()) { |
842 IC::Clear(rinfo->pc()); | 843 IC::Clear(rinfo->pc()); |
843 // Please note targets for cleared inline cached do not have to be | 844 // Please note targets for cleared inline cached do not have to be |
844 // marked since they are contained in HEAP->non_monomorphic_cache(). | 845 // marked since they are contained in HEAP->non_monomorphic_cache(). |
845 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 846 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
846 } else { | 847 } else { |
| 848 if (FLAG_cleanup_code_caches_at_gc && |
| 849 target->kind() == Code::STUB && |
| 850 target->major_key() == CodeStub::CallFunction && |
| 851 target->has_function_cache()) { |
| 852 CallFunctionStub::Clear(heap, rinfo->pc()); |
| 853 } |
847 MarkBit code_mark = Marking::MarkBitFrom(target); | 854 MarkBit code_mark = Marking::MarkBitFrom(target); |
848 heap->mark_compact_collector()->MarkObject(target, code_mark); | 855 heap->mark_compact_collector()->MarkObject(target, code_mark); |
849 } | 856 } |
850 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 857 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
851 } | 858 } |
852 | 859 |
853 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { | 860 static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo) { |
854 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && | 861 ASSERT((RelocInfo::IsJSReturn(rinfo->rmode()) && |
855 rinfo->IsPatchedReturnSequence()) || | 862 rinfo->IsPatchedReturnSequence()) || |
856 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && | 863 (RelocInfo::IsDebugBreakSlot(rinfo->rmode()) && |
(...skipping 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3818 while (buffer != NULL) { | 3825 while (buffer != NULL) { |
3819 SlotsBuffer* next_buffer = buffer->next(); | 3826 SlotsBuffer* next_buffer = buffer->next(); |
3820 DeallocateBuffer(buffer); | 3827 DeallocateBuffer(buffer); |
3821 buffer = next_buffer; | 3828 buffer = next_buffer; |
3822 } | 3829 } |
3823 *buffer_address = NULL; | 3830 *buffer_address = NULL; |
3824 } | 3831 } |
3825 | 3832 |
3826 | 3833 |
3827 } } // namespace v8::internal | 3834 } } // namespace v8::internal |
OLD | NEW |