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 |
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-events.h" |
30 #include "code-stubs.h" | 31 #include "code-stubs.h" |
31 #include "compilation-cache.h" | 32 #include "compilation-cache.h" |
32 #include "deoptimizer.h" | 33 #include "deoptimizer.h" |
33 #include "execution.h" | 34 #include "execution.h" |
34 #include "gdb-jit.h" | |
35 #include "global-handles.h" | 35 #include "global-handles.h" |
36 #include "heap-profiler.h" | 36 #include "heap-profiler.h" |
37 #include "ic-inl.h" | 37 #include "ic-inl.h" |
38 #include "incremental-marking.h" | 38 #include "incremental-marking.h" |
39 #include "liveobjectlist-inl.h" | 39 #include "liveobjectlist-inl.h" |
40 #include "mark-compact.h" | 40 #include "mark-compact.h" |
41 #include "objects-visiting.h" | 41 #include "objects-visiting.h" |
42 #include "objects-visiting-inl.h" | 42 #include "objects-visiting-inl.h" |
43 #include "stub-cache.h" | 43 #include "stub-cache.h" |
44 | 44 |
(...skipping 2770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2815 if (Page::FromAddress(code_entry)->IsEvacuationCandidate()) { | 2815 if (Page::FromAddress(code_entry)->IsEvacuationCandidate()) { |
2816 SlotsBuffer::AddTo(&slots_buffer_allocator_, | 2816 SlotsBuffer::AddTo(&slots_buffer_allocator_, |
2817 &migration_slots_buffer_, | 2817 &migration_slots_buffer_, |
2818 SlotsBuffer::CODE_ENTRY_SLOT, | 2818 SlotsBuffer::CODE_ENTRY_SLOT, |
2819 code_entry_slot, | 2819 code_entry_slot, |
2820 SlotsBuffer::IGNORE_OVERFLOW); | 2820 SlotsBuffer::IGNORE_OVERFLOW); |
2821 } | 2821 } |
2822 } | 2822 } |
2823 } else if (dest == CODE_SPACE) { | 2823 } else if (dest == CODE_SPACE) { |
2824 PROFILE(heap()->isolate(), CodeMoveEvent(src, dst)); | 2824 PROFILE(heap()->isolate(), CodeMoveEvent(src, dst)); |
| 2825 JIT_CODE_EVENT(MoveCode(src, dst)); |
2825 heap()->MoveBlock(dst, src, size); | 2826 heap()->MoveBlock(dst, src, size); |
2826 SlotsBuffer::AddTo(&slots_buffer_allocator_, | 2827 SlotsBuffer::AddTo(&slots_buffer_allocator_, |
2827 &migration_slots_buffer_, | 2828 &migration_slots_buffer_, |
2828 SlotsBuffer::RELOCATED_CODE_OBJECT, | 2829 SlotsBuffer::RELOCATED_CODE_OBJECT, |
2829 dst, | 2830 dst, |
2830 SlotsBuffer::IGNORE_OVERFLOW); | 2831 SlotsBuffer::IGNORE_OVERFLOW); |
2831 Code::cast(HeapObject::FromAddress(dst))->Relocate(dst - src); | 2832 Code::cast(HeapObject::FromAddress(dst))->Relocate(dst - src); |
2832 } else { | 2833 } else { |
2833 ASSERT(dest == OLD_DATA_SPACE || dest == NEW_SPACE); | 2834 ASSERT(dest == OLD_DATA_SPACE || dest == NEW_SPACE); |
2834 heap()->MoveBlock(dst, src, size); | 2835 heap()->MoveBlock(dst, src, size); |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4122 code_flusher_ = NULL; | 4123 code_flusher_ = NULL; |
4123 } | 4124 } |
4124 } | 4125 } |
4125 | 4126 |
4126 | 4127 |
4127 // TODO(1466) ReportDeleteIfNeeded is not called currently. | 4128 // TODO(1466) ReportDeleteIfNeeded is not called currently. |
4128 // Our profiling tools do not expect intersections between | 4129 // Our profiling tools do not expect intersections between |
4129 // code objects. We should either reenable it or change our tools. | 4130 // code objects. We should either reenable it or change our tools. |
4130 void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj, | 4131 void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj, |
4131 Isolate* isolate) { | 4132 Isolate* isolate) { |
4132 #ifdef ENABLE_GDB_JIT_INTERFACE | |
4133 if (obj->IsCode()) { | |
4134 GDBJITInterface::RemoveCode(reinterpret_cast<Code*>(obj)); | |
4135 } | |
4136 #endif | |
4137 if (obj->IsCode()) { | 4133 if (obj->IsCode()) { |
4138 PROFILE(isolate, CodeDeleteEvent(obj->address())); | 4134 PROFILE(isolate, CodeDeleteEvent(obj->address())); |
| 4135 JIT_CODE_EVENT(RemoveCode(reinterpret_cast<Code*>(obj))); |
4139 } | 4136 } |
4140 } | 4137 } |
4141 | 4138 |
4142 | 4139 |
4143 void MarkCompactCollector::Initialize() { | 4140 void MarkCompactCollector::Initialize() { |
4144 StaticMarkingVisitor::Initialize(); | 4141 StaticMarkingVisitor::Initialize(); |
4145 } | 4142 } |
4146 | 4143 |
4147 | 4144 |
4148 bool SlotsBuffer::IsTypedSlot(ObjectSlot slot) { | 4145 bool SlotsBuffer::IsTypedSlot(ObjectSlot slot) { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4279 while (buffer != NULL) { | 4276 while (buffer != NULL) { |
4280 SlotsBuffer* next_buffer = buffer->next(); | 4277 SlotsBuffer* next_buffer = buffer->next(); |
4281 DeallocateBuffer(buffer); | 4278 DeallocateBuffer(buffer); |
4282 buffer = next_buffer; | 4279 buffer = next_buffer; |
4283 } | 4280 } |
4284 *buffer_address = NULL; | 4281 *buffer_address = NULL; |
4285 } | 4282 } |
4286 | 4283 |
4287 | 4284 |
4288 } } // namespace v8::internal | 4285 } } // namespace v8::internal |
OLD | NEW |