summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/heap/blink_gc.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/heap/blink_gc.h')
-rw-r--r--chromium/third_party/blink/renderer/platform/heap/blink_gc.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/chromium/third_party/blink/renderer/platform/heap/blink_gc.h b/chromium/third_party/blink/renderer/platform/heap/blink_gc.h
index a1ba0e53a23..ccc1bfb0443 100644
--- a/chromium/third_party/blink/renderer/platform/heap/blink_gc.h
+++ b/chromium/third_party/blink/renderer/platform/heap/blink_gc.h
@@ -19,17 +19,18 @@ class MarkingVisitor;
class Visitor;
using Address = uint8_t*;
+using ConstAddress = const uint8_t*;
using FinalizationCallback = void (*)(void*);
-using VisitorCallback = void (*)(Visitor*, void*);
-using MarkingVisitorCallback = void (*)(MarkingVisitor*, void*);
+using VisitorCallback = void (*)(Visitor*, const void*);
+using MarkingVisitorCallback = void (*)(MarkingVisitor*, const void*);
using TraceCallback = VisitorCallback;
-using WeakCallback = void (*)(const WeakCallbackInfo&, void*);
+using WeakCallback = void (*)(const WeakCallbackInfo&, const void*);
using EphemeronCallback = VisitorCallback;
// Simple alias to avoid heap compaction type signatures turning into
// a sea of generic |void*|s.
-using MovableReference = void*;
+using MovableReference = const void*;
// Heap compaction supports registering callbacks that are to be invoked
// when an object is moved during compaction. This is to support internal
@@ -64,6 +65,11 @@ class PLATFORM_EXPORT BlinkGC final {
STATIC_ONLY(BlinkGC);
public:
+ // CollectionType represents generational collection. kMinor collects objects
+ // in the young generation (i.e. allocated since the previous collection
+ // cycle, since we use sticky bits), kMajor collects the entire heap.
+ enum class CollectionType { kMinor, kMajor };
+
// When garbage collecting we need to know whether or not there
// can be pointers to Blink GC managed objects on the stack for
// each thread. When threads reach a safe point they record