Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
object_graph_copy.h
Go to the documentation of this file.
1// Copyright (c) 2021, 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#ifndef RUNTIME_VM_OBJECT_GRAPH_COPY_H_
6#define RUNTIME_VM_OBJECT_GRAPH_COPY_H_
7
8namespace dart {
9
10class Isolate;
11class Object;
12class ObjectPtr;
13class Zone;
14
15// Whether the object can safely be shared across isolates due to it being
16// deeply immutable.
17bool CanShareObjectAcrossIsolates(ObjectPtr obj);
18
19// Makes a transitive copy of the object graph referenced by [object]. Will not
20// copy objects that can be safely shared - due to being immutable.
21//
22// The result will be an array of length 3 of the format
23//
24// [
25// <message>,
26// <collection-lib-objects-to-rehash>,
27// <core-lib-objects-to-rehash>,
28// ]
29//
30// If the array of objects to rehash is not `null` the receiver should re-hash
31// those objects.
32ObjectPtr CopyMutableObjectGraph(const Object& root);
33
38
39// Returns a string representation of a retaining path from `from` to `to`,
40// blank string if `to` is not reachable from `from`.
41// Traversal doesn't follow all the object graph links, only those
42// that makes sense isolate message passing.
43const char* FindRetainingPath(Zone* zone,
44 Isolate* isolate,
45 const Object& from,
46 const Object& to,
47 TraversalRules traversal_rules);
48
49} // namespace dart
50
51#endif // RUNTIME_VM_OBJECT_GRAPH_COPY_H_
@ kInternalToIsolateGroup
@ kExternalBetweenIsolateGroups
bool CanShareObjectAcrossIsolates(ObjectPtr obj)
const char * FindRetainingPath(Zone *zone_, Isolate *isolate, const Object &from, const Object &to, TraversalRules traversal_rules)
ObjectPtr CopyMutableObjectGraph(const Object &object)