Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Side by Side Diff: src/heap/objects-visiting-inl.h

Issue 1005183006: Serializer: serialize internal references via object visitor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix compilation Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/ia32/assembler-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef V8_OBJECTS_VISITING_INL_H_ 5 #ifndef V8_OBJECTS_VISITING_INL_H_
6 #define V8_OBJECTS_VISITING_INL_H_ 6 #define V8_OBJECTS_VISITING_INL_H_
7 7
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 end_slot = HeapObject::RawField(object, JSFunction::kNonWeakFieldsEndOffset); 835 end_slot = HeapObject::RawField(object, JSFunction::kNonWeakFieldsEndOffset);
836 StaticVisitor::VisitPointers(heap, start_slot, end_slot); 836 StaticVisitor::VisitPointers(heap, start_slot, end_slot);
837 } 837 }
838 838
839 839
840 void Code::CodeIterateBody(ObjectVisitor* v) { 840 void Code::CodeIterateBody(ObjectVisitor* v) {
841 int mode_mask = RelocInfo::kCodeTargetMask | 841 int mode_mask = RelocInfo::kCodeTargetMask |
842 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | 842 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
843 RelocInfo::ModeMask(RelocInfo::CELL) | 843 RelocInfo::ModeMask(RelocInfo::CELL) |
844 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | 844 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
845 RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
846 RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE_ENCODED) |
845 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | 847 RelocInfo::ModeMask(RelocInfo::JS_RETURN) |
846 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | 848 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) |
847 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); 849 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
848 850
849 // There are two places where we iterate code bodies: here and the 851 // There are two places where we iterate code bodies: here and the
850 // templated CodeIterateBody (below). They should be kept in sync. 852 // templated CodeIterateBody (below). They should be kept in sync.
851 IteratePointer(v, kRelocationInfoOffset); 853 IteratePointer(v, kRelocationInfoOffset);
852 IteratePointer(v, kHandlerTableOffset); 854 IteratePointer(v, kHandlerTableOffset);
853 IteratePointer(v, kDeoptimizationDataOffset); 855 IteratePointer(v, kDeoptimizationDataOffset);
854 IteratePointer(v, kTypeFeedbackInfoOffset); 856 IteratePointer(v, kTypeFeedbackInfoOffset);
855 IterateNextCodeLink(v, kNextCodeLinkOffset); 857 IterateNextCodeLink(v, kNextCodeLinkOffset);
856 IteratePointer(v, kConstantPoolOffset); 858 IteratePointer(v, kConstantPoolOffset);
857 859
858 RelocIterator it(this, mode_mask); 860 RelocIterator it(this, mode_mask);
859 Isolate* isolate = this->GetIsolate(); 861 Isolate* isolate = this->GetIsolate();
860 for (; !it.done(); it.next()) { 862 for (; !it.done(); it.next()) {
861 it.rinfo()->Visit(isolate, v); 863 it.rinfo()->Visit(isolate, v);
862 } 864 }
863 } 865 }
864 866
865 867
866 template <typename StaticVisitor> 868 template <typename StaticVisitor>
867 void Code::CodeIterateBody(Heap* heap) { 869 void Code::CodeIterateBody(Heap* heap) {
868 int mode_mask = RelocInfo::kCodeTargetMask | 870 int mode_mask = RelocInfo::kCodeTargetMask |
869 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | 871 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
870 RelocInfo::ModeMask(RelocInfo::CELL) | 872 RelocInfo::ModeMask(RelocInfo::CELL) |
871 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | 873 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
874 RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
875 RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE_ENCODED) |
872 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | 876 RelocInfo::ModeMask(RelocInfo::JS_RETURN) |
873 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | 877 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) |
874 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); 878 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
875 879
876 // There are two places where we iterate code bodies: here and the non- 880 // There are two places where we iterate code bodies: here and the non-
877 // templated CodeIterateBody (above). They should be kept in sync. 881 // templated CodeIterateBody (above). They should be kept in sync.
878 StaticVisitor::VisitPointer( 882 StaticVisitor::VisitPointer(
879 heap, 883 heap,
880 reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset)); 884 reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset));
881 StaticVisitor::VisitPointer( 885 StaticVisitor::VisitPointer(
(...skipping 12 matching lines...) Expand all
894 898
895 RelocIterator it(this, mode_mask); 899 RelocIterator it(this, mode_mask);
896 for (; !it.done(); it.next()) { 900 for (; !it.done(); it.next()) {
897 it.rinfo()->template Visit<StaticVisitor>(heap); 901 it.rinfo()->template Visit<StaticVisitor>(heap);
898 } 902 }
899 } 903 }
900 } 904 }
901 } // namespace v8::internal 905 } // namespace v8::internal
902 906
903 #endif // V8_OBJECTS_VISITING_INL_H_ 907 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/ia32/assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698