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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 INLINE(static bool ShouldSkipEvacuationSlotRecording(Object* host)) { | 656 INLINE(static bool ShouldSkipEvacuationSlotRecording(Object* host)) { |
657 return Page::FromAddress(reinterpret_cast<Address>(host))-> | 657 return Page::FromAddress(reinterpret_cast<Address>(host))-> |
658 ShouldSkipEvacuationSlotRecording(); | 658 ShouldSkipEvacuationSlotRecording(); |
659 } | 659 } |
660 | 660 |
661 INLINE(static bool IsOnEvacuationCandidate(Object* obj)) { | 661 INLINE(static bool IsOnEvacuationCandidate(Object* obj)) { |
662 return Page::FromAddress(reinterpret_cast<Address>(obj))-> | 662 return Page::FromAddress(reinterpret_cast<Address>(obj))-> |
663 IsEvacuationCandidate(); | 663 IsEvacuationCandidate(); |
664 } | 664 } |
665 | 665 |
| 666 INLINE(static bool IsCodeEntry(Address addr, Object* value)) { |
| 667 HeapObject* obj = HeapObject::FromAddress(addr); |
| 668 return obj->IsJSFunction() && |
| 669 (Code::GetCodeFromTargetAddress((Address)value) == |
| 670 JSFunction::cast(obj)->code()); |
| 671 } |
| 672 |
666 INLINE(void EvictEvacuationCandidate(Page* page)) { | 673 INLINE(void EvictEvacuationCandidate(Page* page)) { |
667 if (FLAG_trace_fragmentation) { | 674 if (FLAG_trace_fragmentation) { |
668 PrintF("Page %p is too popular. Disabling evacuation.\n", | 675 PrintF("Page %p is too popular. Disabling evacuation.\n", |
669 reinterpret_cast<void*>(page)); | 676 reinterpret_cast<void*>(page)); |
670 } | 677 } |
671 | 678 |
672 // TODO(gc) If all evacuation candidates are too popular we | 679 // TODO(gc) If all evacuation candidates are too popular we |
673 // should stop slots recording entirely. | 680 // should stop slots recording entirely. |
674 page->ClearEvacuationCandidate(); | 681 page->ClearEvacuationCandidate(); |
675 | 682 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 private: | 1023 private: |
1017 MarkCompactCollector* collector_; | 1024 MarkCompactCollector* collector_; |
1018 }; | 1025 }; |
1019 | 1026 |
1020 | 1027 |
1021 const char* AllocationSpaceName(AllocationSpace space); | 1028 const char* AllocationSpaceName(AllocationSpace space); |
1022 | 1029 |
1023 } } // namespace v8::internal | 1030 } } // namespace v8::internal |
1024 | 1031 |
1025 #endif // V8_MARK_COMPACT_H_ | 1032 #endif // V8_MARK_COMPACT_H_ |
OLD | NEW |