OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/snapshot/serializer.h" | 5 #include "src/snapshot/serializer.h" |
6 | 6 |
7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
10 #include "src/snapshot/natives.h" | 10 #include "src/snapshot/natives.h" |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 // and wipe all pointers in the copy, which we then serialize. | 740 // and wipe all pointers in the copy, which we then serialize. |
741 code = serializer_->CopyCode(code); | 741 code = serializer_->CopyCode(code); |
742 int mode_mask = RelocInfo::kCodeTargetMask | | 742 int mode_mask = RelocInfo::kCodeTargetMask | |
743 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 743 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
744 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | | 744 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | |
745 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) | | 745 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) | |
746 RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) | | 746 RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) | |
747 RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE_ENCODED); | 747 RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE_ENCODED); |
748 for (RelocIterator it(code, mode_mask); !it.done(); it.next()) { | 748 for (RelocIterator it(code, mode_mask); !it.done(); it.next()) { |
749 RelocInfo* rinfo = it.rinfo(); | 749 RelocInfo* rinfo = it.rinfo(); |
750 rinfo->WipeOut(); | 750 rinfo->WipeOut(serializer_->isolate()); |
751 } | 751 } |
752 // We need to wipe out the header fields *after* wiping out the | 752 // We need to wipe out the header fields *after* wiping out the |
753 // relocations, because some of these fields are needed for the latter. | 753 // relocations, because some of these fields are needed for the latter. |
754 code->WipeOutHeader(); | 754 code->WipeOutHeader(); |
755 } | 755 } |
756 // Code age headers are not serializable. | 756 // Code age headers are not serializable. |
757 code->MakeYoung(serializer_->isolate()); | 757 code->MakeYoung(serializer_->isolate()); |
758 return code->address(); | 758 return code->address(); |
759 } | 759 } |
760 | 760 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 if (to_skip != 0 && return_skip == kIgnoringReturn) { | 798 if (to_skip != 0 && return_skip == kIgnoringReturn) { |
799 sink_->Put(kSkip, "Skip"); | 799 sink_->Put(kSkip, "Skip"); |
800 sink_->PutInt(to_skip, "SkipDistance"); | 800 sink_->PutInt(to_skip, "SkipDistance"); |
801 to_skip = 0; | 801 to_skip = 0; |
802 } | 802 } |
803 return to_skip; | 803 return to_skip; |
804 } | 804 } |
805 | 805 |
806 } // namespace internal | 806 } // namespace internal |
807 } // namespace v8 | 807 } // namespace v8 |
OLD | NEW |