Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
runtime
vm
heap
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
15
namespace
dart
{
16
17
void
GCLinkedLists::Release
() {
18
#define FOREACH(type, var) var.Release();
19
GC_LINKED_LIST
(
FOREACH
)
20
#undef FOREACH
21
}
22
23
bool
GCLinkedLists::IsEmpty
() {
24
#define FOREACH(type, var) \
25
if (!var.IsEmpty()) { \
26
return false; \
27
}
28
GC_LINKED_LIST
(
FOREACH
)
29
return
true
;
30
#undef FOREACH
31
}
32
33
// clang-format off
34
void
GCLinkedLists::FlushInto
(
GCLinkedLists
* to) {
35
#define FOREACH(type, var) var.FlushInto(&to->var);
36
GC_LINKED_LIST
(
FOREACH
)
37
#undef FOREACH
38
}
39
40
// clang-format on
41
42
Heap::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
dart::Heap::Space
Space
Definition
heap.h:37
dart::Heap::kNew
@ kNew
Definition
heap.h:38
dart::Heap::kOld
@ kOld
Definition
heap.h:39
log.h
dart_api_state.h
FOREACH
#define FOREACH(type, var)
gc_shared.h
GC_LINKED_LIST
#define GC_LINKED_LIST(V)
Definition
gc_shared.h:31
message_handler.h
dart
Definition
dart_vm.cc:33
dart::SpaceForExternal
Heap::Space SpaceForExternal(FinalizerEntryPtr raw_entry)
Definition
gc_shared.cc:42
object.h
scavenger.h
dart::GCLinkedLists
Definition
gc_shared.h:79
dart::GCLinkedLists::FlushInto
void FlushInto(GCLinkedLists *to)
Definition
gc_shared.cc:34
dart::GCLinkedLists::IsEmpty
bool IsEmpty()
Definition
gc_shared.cc:23
dart::GCLinkedLists::Release
void Release()
Definition
gc_shared.cc:17
Generated on Fri Apr 26 2024 06:15:07 for Flutter Engine by
1.9.8