| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/heap/mark-compact.h" | 5 #include "src/heap/mark-compact.h" |
| 6 | 6 |
| 7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/base/sys-info.h" | 9 #include "src/base/sys-info.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 for (StackFrameIterator it(isolate, top); !it.done(); it.Advance()) { | 1453 for (StackFrameIterator it(isolate, top); !it.done(); it.Advance()) { |
| 1454 // Note: for the frame that has a pending lazy deoptimization | 1454 // Note: for the frame that has a pending lazy deoptimization |
| 1455 // StackFrame::unchecked_code will return a non-optimized code object for | 1455 // StackFrame::unchecked_code will return a non-optimized code object for |
| 1456 // the outermost function and StackFrame::LookupCode will return | 1456 // the outermost function and StackFrame::LookupCode will return |
| 1457 // actual optimized code object. | 1457 // actual optimized code object. |
| 1458 StackFrame* frame = it.frame(); | 1458 StackFrame* frame = it.frame(); |
| 1459 Code* code = frame->unchecked_code(); | 1459 Code* code = frame->unchecked_code(); |
| 1460 MarkBit code_mark = Marking::MarkBitFrom(code); | 1460 MarkBit code_mark = Marking::MarkBitFrom(code); |
| 1461 MarkObject(code, code_mark); | 1461 MarkObject(code, code_mark); |
| 1462 if (frame->is_optimized()) { | 1462 if (frame->is_optimized()) { |
| 1463 MarkCompactMarkingVisitor::MarkInlinedFunctionsCode(heap(), | 1463 Code* optimized_code = frame->LookupCode(); |
| 1464 frame->LookupCode()); | 1464 MarkBit optimized_code_mark = Marking::MarkBitFrom(optimized_code); |
| 1465 MarkObject(optimized_code, optimized_code_mark); |
| 1465 } | 1466 } |
| 1466 } | 1467 } |
| 1467 } | 1468 } |
| 1468 | 1469 |
| 1469 | 1470 |
| 1470 void MarkCompactCollector::PrepareForCodeFlushing() { | 1471 void MarkCompactCollector::PrepareForCodeFlushing() { |
| 1471 // If code flushing is disabled, there is no need to prepare for it. | 1472 // If code flushing is disabled, there is no need to prepare for it. |
| 1472 if (!is_code_flushing_enabled()) return; | 1473 if (!is_code_flushing_enabled()) return; |
| 1473 | 1474 |
| 1474 // Ensure that empty descriptor array is marked. Method MarkDescriptorArray | 1475 // Ensure that empty descriptor array is marked. Method MarkDescriptorArray |
| (...skipping 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4630 MarkBit mark_bit = Marking::MarkBitFrom(host); | 4631 MarkBit mark_bit = Marking::MarkBitFrom(host); |
| 4631 if (Marking::IsBlack(mark_bit)) { | 4632 if (Marking::IsBlack(mark_bit)) { |
| 4632 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); | 4633 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); |
| 4633 RecordRelocSlot(&rinfo, target); | 4634 RecordRelocSlot(&rinfo, target); |
| 4634 } | 4635 } |
| 4635 } | 4636 } |
| 4636 } | 4637 } |
| 4637 | 4638 |
| 4638 } // namespace internal | 4639 } // namespace internal |
| 4639 } // namespace v8 | 4640 } // namespace v8 |
| OLD | NEW |