Skip to content

ABI: implement exception scopes and termination control #206

Description

@chrisbbreuer

Parent

Scope

Implement the 18 shared pinned exception/termination imports:

  • all six TopExceptionScope__* operations;
  • JSGlobalObject__clearExceptionExceptTermination, clearTerminationException, createOutOfMemoryError, requestTermination, throwOutOfMemoryError, and throwStackOverflow;
  • JSC__VM__clearHasTerminationRequest, executionForbidden, hasTerminationRequest, notifyNeedTermination, setExecutionForbidden;
  • JSC__JSValue__isTerminationException.

Acceptance criteria

  • The caller-provided 8/56-byte, 8-aligned TopExceptionScope storage retains exact VM identity, supports pure vs trap-aware exception reads, unconditional clear, assertion checking, and safe destruction without escaping stack storage.
  • Termination requests are VM-shared and thread-safe; trap-aware scope lookup materializes one stable termination exception, while pure lookup does not process a pending request.
  • Normal exceptions clear through clearExceptionExceptTermination; termination remains and returns false until clearTerminationException clears both the request and thrown termination exception.
  • VM request and execution-forbidden controls preserve the pinned behavior, including the source contract where setExecutionForbidden makes execution forbidden regardless of the boolean argument.
  • OOM creation returns a selected-realm Error without throwing; OOM and stack-overflow throw operations publish exact Error kinds while preserving the first pending exception.
  • Focused coverage includes 8- and 56-byte scope buffers, sibling realms/VM identity, normal and primitive exceptions, pending requests, materialization order, stable exception identity, classification, clearing/resumption, foreign/invalid pointers, forbidden state, OOM/stack errors, and first-exception preservation.
  • Inventories, README/API evidence, and parent trackers are regenerated from checked-in results.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions