mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
13ec07415b
More details about the design: https://docs.google.com/document/d/1QDjyY_6wOTOgURwpeYMKU9qEz0gKxx2MUrdruC6Kp6c/edit?usp=sharing Change-Id: Ie3985d86dca7f5010044ca46c33ca177588c0f69 Bug: #37022 CoreLibraryReviewExempt: Reviewed by vm and api groups. web and wasm groups not affected because FFI isn't on those platforms. TEST=async_void_function_callbacks_test.dart, ffi_callback_metadata_test.cc, other front end tests Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305900 Commit-Queue: Liam Appelbe <liama@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Lasse Nielsen <lrn@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
50 lines
1.7 KiB
C++
50 lines
1.7 KiB
C++
// Copyright (c) 2019, 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_BSS_RELOCS_H_
|
|
#define RUNTIME_VM_BSS_RELOCS_H_
|
|
|
|
#include "platform/allocation.h"
|
|
|
|
namespace dart {
|
|
class Thread;
|
|
|
|
class BSS : public AllStatic {
|
|
public:
|
|
// Entries found in both the VM and isolate BSS come first. Each has its own
|
|
// portion of the BSS segment, so just the indices are shared, not the values
|
|
// stored at the index.
|
|
enum class Relocation : intptr_t {
|
|
InstructionsRelocatedAddress,
|
|
DRT_GetFfiCallbackMetadata, // TODO(https://dartbug.com/52579): Remove.
|
|
DRT_ExitTemporaryIsolate, // TODO(https://dartbug.com/52579): Remove.
|
|
EndOfVmEntries,
|
|
|
|
// We don't have any isolate group specific entries at the moment.
|
|
EndOfIsolateGroupEntries = EndOfVmEntries,
|
|
};
|
|
|
|
static constexpr intptr_t kVmEntryCount =
|
|
static_cast<intptr_t>(Relocation::EndOfVmEntries);
|
|
|
|
static constexpr intptr_t kIsolateGroupEntryCount =
|
|
static_cast<intptr_t>(Relocation::EndOfIsolateGroupEntries);
|
|
|
|
static constexpr intptr_t RelocationIndex(Relocation reloc) {
|
|
return static_cast<intptr_t>(reloc);
|
|
}
|
|
|
|
static void Initialize(Thread* current, uword* bss, bool vm);
|
|
|
|
// Currently only used externally by LoadedElf::ResolveSymbols() to set the
|
|
// relocated address without changing the embedder interface.
|
|
static void InitializeBSSEntry(BSS::Relocation relocation,
|
|
uword new_value,
|
|
uword* bss_start);
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // RUNTIME_VM_BSS_RELOCS_H_
|