[vm] Remove the VM isolate.

The former contents of the VM isolate are now included into each isolate group. This makes each isolate group's heap independent, and in particular allows each heap to be allocated to a separate pointer cage (not done in this CL).

The duplicated stubs that allowed PC relative calls are removed, since the originals can now be the target of PC relative calls.

The bootstrapping needing to load an AppJIT or AppAOT snapshot is reduced to allocating the oddballs. The code is entirely dropped in the AOT runtime, but the JIT runtime still has it to allow for flags to affect the compilation of the stub code. Further refactoring might be able to remove this for the JIT runtime too, with only gen_snapshot knowing how to bootstrap.

Class serialization no longer distinguishes predefined classes.

The page containing null is marked as never-evacuate. null, false and true must not move because the compiler relies on their low bits having certain patterns for some optimizations. (Previously, the entire VM isolate heap never moved.)

Compaction is disabled for IA32. Due to register pressure, some stub calls must not use a scratch register and embed the address of Code.

The page containing the call-through-safepoint stub is frozen when running with --write-protect-code and the stub is created at runtime (instead of loaded from an AppJIT or AppAOT snapshot). This stub must remain executable even during a safepoint, as a foreign call might during return during a safepoint and only block after the stub directs it to the runtime.

The snapshot symbols are renamed to kDartSnapshotData and kDartSnapshotText. There is no need to distinguish the VM isolate's snapshot, and snaphots are per isolate group not per isolate. Aliases with the old names are added to ease migration.

Some global flags that were automatically set based on the VM isolate's snapshot are now isolate group flags and automatically set by the isolate group's snapshot.

TEST=ci
Change-Id: Iee82016057d609112e9b021d178fc3d4d18b5044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500621
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2026-05-18 11:35:03 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent ca9c12f1b6
commit d36adbacaf
137 changed files with 2442 additions and 4372 deletions
-4
View File
@@ -258,10 +258,6 @@ void find(ArgResults options) {
}
vmStart = address;
}
if (vmStart == null) {
return usageError('no VM start address found, one must be specified '
'with --vm_start');
}
var isolateStart = dwarf.isolateStartAddress();
if (options['isolate_start'] != null) {
+1 -6
View File
@@ -2,12 +2,7 @@
// 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.
export 'src/constants.dart'
show
isolateDataSymbolName,
isolateSymbolName,
vmDataSymbolName,
vmSymbolName;
export 'src/constants.dart' show dataSymbolName, textSymbolName;
export 'src/elf.dart'
show
DynamicTable,
+14 -8
View File
@@ -9,17 +9,23 @@ const int buildIdNoteType = 3;
// The name of a build ID note.
const String buildIdNoteName = 'GNU';
// The dynamic symbol name for the VM instructions section.
const String vmSymbolName = '_kDartVmSnapshotInstructions';
// The dynamic symbol name for the VM data section.
const String vmDataSymbolName = '_kDartVmSnapshotData';
// The dynamic symbol name for the isolate instructions section.
const String isolateSymbolName = '_kDartIsolateSnapshotInstructions';
const String textSymbolName = '_kDartSnapshotText';
// The dynamic symbol name for the isolate data section.
const String isolateDataSymbolName = '_kDartIsolateSnapshotData';
const String dataSymbolName = '_kDartSnapshotData';
// The ID for the root loading unit.
const int rootLoadingUnitId = 1;
// The dynamic symbol name for the VM instructions section.
const String oldVmSymbolName = '_kDartVmSnapshotInstructions';
// The dynamic symbol name for the VM data section.
const String oldVmDataSymbolName = '_kDartVmSnapshotData';
// The dynamic symbol name for the isolate instructions section.
const String oldIsolateSymbolName = '_kDartIsolateSnapshotInstructions';
// The dynamic symbol name for the isolate data section.
const String oldIsolateDataSymbolName = '_kDartIsolateSnapshotData';
+9 -5
View File
@@ -119,7 +119,7 @@ class StackTraceHeader {
int? get isolateStart => _isolateStart;
int? get isolateDsoBase => _isolateDsoBase;
static StackTraceHeader fromStarts(int isolateStart, int vmStart,
static StackTraceHeader fromStarts(int isolateStart, int? vmStart,
{String? architecture}) =>
StackTraceHeader()
.._isolateStart = isolateStart
@@ -375,9 +375,11 @@ class StackTraceHeader {
}
if (offset == null) return null;
switch (symbolString) {
case constants.vmSymbolName:
case constants.oldVmSymbolName:
return (InstructionsSection.vm, offset);
case constants.isolateSymbolName:
case constants.oldIsolateSymbolName:
return (InstructionsSection.isolate, offset);
case constants.dataSymbolName:
return (InstructionsSection.isolate, offset);
default:
break;
@@ -420,9 +422,11 @@ PCOffset? tryParseSymbolOffset(String s,
/// - The path to the snapshot, if it was loaded as a dynamic library,
/// otherwise the string `"<unknown>"`.
const _symbolOffsetREString = r'(?<symbol>' +
constants.vmSymbolName +
constants.textSymbolName +
r'|' +
constants.isolateSymbolName +
constants.oldVmSymbolName +
r'|' +
constants.oldIsolateSymbolName +
r')\+(?<offset>(?:0x)?[\da-f]+)';
final _symbolOffsetRE = RegExp(_symbolOffsetREString);
final _traceLineRE = RegExp(r'\s*#(\d+) abs (?<absolute>[\da-f]+)'
+3 -2
View File
@@ -1283,11 +1283,12 @@ class Elf extends DwarfContainer {
}
@override
int? get vmStartAddress => dynamicSymbolFor(constants.vmSymbolName)?.value;
int? get vmStartAddress => dynamicSymbolFor(constants.oldVmSymbolName)?.value;
@override
int? get isolateStartAddress =>
dynamicSymbolFor(constants.isolateSymbolName)?.value;
dynamicSymbolFor(constants.textSymbolName)?.value ??
dynamicSymbolFor(constants.oldIsolateSymbolName)?.value;
@override
String? get buildId {
+3 -2
View File
@@ -835,11 +835,12 @@ class MachO extends DwarfContainer {
_dwarfSegment?.sections['__debug_info']?.shrink(containerReader);
@override
int? get vmStartAddress => _symbolTable[constants.vmSymbolName]?.value;
int? get vmStartAddress => _symbolTable[constants.oldVmSymbolName]?.value;
@override
int? get isolateStartAddress =>
_symbolTable[constants.isolateSymbolName]?.value;
_symbolTable[constants.textSymbolName]?.value ??
_symbolTable[constants.oldIsolateSymbolName]?.value;
@override
String? get buildId =>