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

Side by Side Diff: src/objects.h

Issue 8716009: Distinguish weak references in heap snapshots, group GC roots. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 7848 matching lines...) Expand 10 before | Expand all | Expand 10 after
7859 7859
7860 private: 7860 private:
7861 DISALLOW_IMPLICIT_CONSTRUCTORS(BreakPointInfo); 7861 DISALLOW_IMPLICIT_CONSTRUCTORS(BreakPointInfo);
7862 }; 7862 };
7863 #endif // ENABLE_DEBUGGER_SUPPORT 7863 #endif // ENABLE_DEBUGGER_SUPPORT
7864 7864
7865 7865
7866 #undef DECL_BOOLEAN_ACCESSORS 7866 #undef DECL_BOOLEAN_ACCESSORS
7867 #undef DECL_ACCESSORS 7867 #undef DECL_ACCESSORS
7868 7868
7869 #define VISITOR_SYNCHRONIZATION_TAGS_LIST(V) \
7870 V(kSymbolTable, "symbol_table", "(Symbols)") \
7871 V(kExternalStringsTable, "external_strings_table", "(External strings)") \
7872 V(kStrongRootList, "strong_root_list", "(Strong roots)") \
7873 V(kSymbol, "symbol", "(Symbol)") \
7874 V(kBootstrapper, "bootstrapper", "(Bootstrapper)") \
7875 V(kTop, "top", "(Isolate)") \
7876 V(kRelocatable, "relocatable", "(Relocatable)") \
7877 V(kDebug, "debug", "(Debugger)") \
7878 V(kCompilationCache, "compilationcache", "(Compilation cache)") \
7879 V(kHandleScope, "handlescope", "(Handle scope)") \
7880 V(kBuiltins, "builtins", "(Builtins)") \
7881 V(kGlobalHandles, "globalhandles", "(Global handles)") \
7882 V(kThreadManager, "threadmanager", "(Thread manager)") \
7883 V(kExtensions, "Extensions", "(Extensions)")
7884
7885 class VisitorSynchronization : public AllStatic {
7886 public:
7887 #define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item,
7888 enum SyncTag {
7889 VISITOR_SYNCHRONIZATION_TAGS_LIST(DECLARE_ENUM)
7890 kNumberOfSyncTags
7891 };
7892 #undef DECLARE_ENUM
7893
7894 static const char* kTags[kNumberOfSyncTags];
Vitaly Repeshko 2011/12/02 23:39:47 One more const.
mnaganov (inactive) 2011/12/05 12:55:25 Done.
7895 static const char* kTagNames[kNumberOfSyncTags];
Vitaly Repeshko 2011/12/02 23:39:47 Same here.
mnaganov (inactive) 2011/12/05 12:55:25 Done.
7896 };
7869 7897
7870 // Abstract base class for visiting, and optionally modifying, the 7898 // Abstract base class for visiting, and optionally modifying, the
7871 // pointers contained in Objects. Used in GC and serialization/deserialization. 7899 // pointers contained in Objects. Used in GC and serialization/deserialization.
7872 class ObjectVisitor BASE_EMBEDDED { 7900 class ObjectVisitor BASE_EMBEDDED {
7873 public: 7901 public:
7874 virtual ~ObjectVisitor() {} 7902 virtual ~ObjectVisitor() {}
7875 7903
7876 // Visits a contiguous arrays of pointers in the half-open range 7904 // Visits a contiguous arrays of pointers in the half-open range
7877 // [start, end). Any or all of the values may be modified on return. 7905 // [start, end). Any or all of the values may be modified on return.
7878 virtual void VisitPointers(Object** start, Object** end) = 0; 7906 virtual void VisitPointers(Object** start, Object** end) = 0;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
7914 7942
7915 virtual void VisitExternalReference(RelocInfo* rinfo); 7943 virtual void VisitExternalReference(RelocInfo* rinfo);
7916 7944
7917 inline void VisitExternalReference(Address* p) { 7945 inline void VisitExternalReference(Address* p) {
7918 VisitExternalReferences(p, p + 1); 7946 VisitExternalReferences(p, p + 1);
7919 } 7947 }
7920 7948
7921 // Visits a handle that has an embedder-assigned class ID. 7949 // Visits a handle that has an embedder-assigned class ID.
7922 virtual void VisitEmbedderReference(Object** p, uint16_t class_id) {} 7950 virtual void VisitEmbedderReference(Object** p, uint16_t class_id) {}
7923 7951
7924 #ifdef DEBUG
7925 // Intended for serialization/deserialization checking: insert, or 7952 // Intended for serialization/deserialization checking: insert, or
7926 // check for the presence of, a tag at this position in the stream. 7953 // check for the presence of, a tag at this position in the stream.
7927 virtual void Synchronize(const char* tag) {} 7954 // Also used for marking up GC roots in heap snapshots.
7928 #else 7955 virtual void Synchronize(VisitorSynchronization::SyncTag tag) {}
7929 inline void Synchronize(const char* tag) {}
7930 #endif
7931 }; 7956 };
7932 7957
7933 7958
7934 class StructBodyDescriptor : public 7959 class StructBodyDescriptor : public
7935 FlexibleBodyDescriptor<HeapObject::kHeaderSize> { 7960 FlexibleBodyDescriptor<HeapObject::kHeaderSize> {
7936 public: 7961 public:
7937 static inline int SizeOf(Map* map, HeapObject* object) { 7962 static inline int SizeOf(Map* map, HeapObject* object) {
7938 return map->instance_size(); 7963 return map->instance_size();
7939 } 7964 }
7940 }; 7965 };
(...skipping 21 matching lines...) Expand all
7962 } else { 7987 } else {
7963 value &= ~(1 << bit_position); 7988 value &= ~(1 << bit_position);
7964 } 7989 }
7965 return value; 7990 return value;
7966 } 7991 }
7967 }; 7992 };
7968 7993
7969 } } // namespace v8::internal 7994 } } // namespace v8::internal
7970 7995
7971 #endif // V8_OBJECTS_H_ 7996 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698