Flutter Engine
The Flutter Engine
gc_shared.cc
Go to the documentation of this file.
1// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5// Logic shared between the Scavenger and Marker.
6
7#include "vm/heap/gc_shared.h"
8
9#include "vm/dart_api_state.h"
10#include "vm/heap/scavenger.h"
11#include "vm/log.h"
12#include "vm/message_handler.h"
13#include "vm/object.h"
14
15namespace dart {
16
18#define FOREACH(type, var) var.Release();
20#undef FOREACH
21}
22
24#define FOREACH(type, var) \
25 if (!var.IsEmpty()) { \
26 return false; \
27 }
29 return true;
30#undef FOREACH
31}
32
33// clang-format off
35#define FOREACH(type, var) var.FlushInto(&to->var);
37#undef FOREACH
38}
39
40// clang-format on
41
42Heap::Space SpaceForExternal(FinalizerEntryPtr raw_entry) {
43 // As with WeakTables, Smis are "old".
44 return raw_entry->untag()->value()->IsImmediateOrOldObject() ? Heap::kOld
45 : Heap::kNew;
46}
47
48} // namespace dart
@ kNew
Definition: heap.h:38
@ kOld
Definition: heap.h:39
#define FOREACH(type, var)
#define GC_LINKED_LIST(V)
Definition: gc_shared.h:31
Definition: dart_vm.cc:33
Heap::Space SpaceForExternal(FinalizerEntryPtr raw_entry)
Definition: gc_shared.cc:42
void FlushInto(GCLinkedLists *to)
Definition: gc_shared.cc:34