Skip to content

Supporting VM-required Object Semantics / Spaces #53

@qinsoon

Description

@qinsoon

In GitLab by @steveblackburn on Jan 22, 2020, 01:41

Spaces are principally an algorithm-specific (and thus VM-neutral) concept. Therefore the abstraction of spaces should be fully contained within MMTk.

On the other hand, VMs may demand special semantics which imply special spaces (and these demands are orthogonal to the chosen GC algorithm). For example:

  • Jikes RVM has a build-time-constructed 'boot image' which contains objects which although immortal, form part of the regular heap.
  • V8 demands a code space which offers particular semantics (principally that it resides on pages (only) execute and read permissions).
  • V8 demands a 'read only' space into which immutable objects can be written, and once a page is 'sealed' it becomes read only (OS protected). This is primarily for deduplication among isolates or processes. Graal(?) generalizes this further with a copy-on-write space.

These demands raise a few issues:

  • Ensuring that these requirements are supported independent of GC algorithm (the VM is explicitly unsupported for those algorithms for which this can't be done).
  • Ensuring that these requirements are supported without breaking abstractions (i.e. without exposing the concept of spaces to the VM).
  • Ensuring that the support is as general as possible (e.g. that a VM could provide a boot image at a specific address)

Possible solutions:

  • One approach to the Jikes RVM boot image is to keep the concept out of MMTk and instead simply treat the boot image as part of the (opaque) VM root set (and ask the VM to enumerate the pointers when needed). Jikes RVM already supports this, which suggests that we should seriously consider getting rid of all references to the boot image from within MMTk and switch to this just being part of the VM roots. The only issue here is how we treat write barriers. The boot image is different to other VM-specific sources of roots. For example, threads are highly mutated, statics are somewhat highly mutated and the heap (including the boot image) is even less frequently mutated, which influences the way we treat them. We probably would treat the boot image like an older generation of the heap rather than treating it like the stacks (we can't afford to walk the boot image every minor GC).
  • An approach to the other requirements is that we allow allocations to come with particular semantics that may include requirements (such as read only or code) and / or hints (such as 'mature', 'young', 'shared').

Metadata

Metadata

Labels

A-spaceArea: Space/PageResourceC-enhancementCategory: EnhancementF-questionCall For Participation: Unanswered question (need more information)P-normalPriority: Normal.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions