Files
sdk/runtime/vm/object_graph_copy.h
T
Alexander Aprelev 65d0d8581a [vm/shared] Move forward_table from Isolate to Thread.
Having forwarding tables on the Thread allows for those tables to be used in dart mutator thread running in IsolateGroup-shared context. On 32-bit platforms(arm) the forwarding tables are used during [SendPort.send] message verification.

Fixes https://github.com/dart-lang/sdk/issues/60817
TEST=isolate_group_shared_send_test

Change-Id: I58b33c14026584330b594776e812fe1d48bc2fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431942
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-06-02 10:04:39 -07:00

52 lines
1.6 KiB
C++

// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef RUNTIME_VM_OBJECT_GRAPH_COPY_H_
#define RUNTIME_VM_OBJECT_GRAPH_COPY_H_
namespace dart {
class Thread;
class Object;
class ObjectPtr;
class Zone;
// Whether the object can safely be shared across isolates due to it being
// deeply immutable.
bool CanShareObjectAcrossIsolates(ObjectPtr obj);
// Makes a transitive copy of the object graph referenced by [object]. Will not
// copy objects that can be safely shared - due to being immutable.
//
// The result will be an array of length 3 of the format
//
// [
// <message>,
// <collection-lib-objects-to-rehash>,
// <core-lib-objects-to-rehash>,
// ]
//
// If the array of objects to rehash is not `null` the receiver should re-hash
// those objects.
ObjectPtr CopyMutableObjectGraph(const Object& root);
typedef enum {
kInternalToIsolateGroup,
kExternalBetweenIsolateGroups,
} TraversalRules;
// Returns a string representation of a retaining path from `from` to `to`,
// blank string if `to` is not reachable from `from`.
// Traversal doesn't follow all the object graph links, only those
// that makes sense isolate message passing.
const char* FindRetainingPath(Zone* zone,
Thread* thread,
const Object& from,
const Object& to,
TraversalRules traversal_rules);
} // namespace dart
#endif // RUNTIME_VM_OBJECT_GRAPH_COPY_H_