Skip to content

OpRegistry

Defined in: packages/engine/src/vm/OpRegistry.ts:90

Legacy opcode registry, retained for the VM interface contract.

Previously dispatched custom opcodes (>= 200) from the VM switch-default branch. Now plugins should use CALL_PLUGIN (opcode 50) via pluginFunctionRegistry instead.

new OpRegistry(): OpRegistry;

OpRegistry

allocateOpcode(): number;

Defined in: packages/engine/src/vm/OpRegistry.ts:124

Allocate a unique opcode for a plugin’s custom bytecode handler.

Returns the next available opcode (starting at 201). Each call returns a distinct value. Plugins should call this once during registration and store the result.

number

A unique opcode number for the calling plugin.

If the dynamic opcode pool is exhausted.


get(opcode): OpcodeHandler | undefined;

Defined in: packages/engine/src/vm/OpRegistry.ts:106

ParameterType
opcodenumber

OpcodeHandler | undefined


has(opcode): boolean;

Defined in: packages/engine/src/vm/OpRegistry.ts:110

ParameterType
opcodenumber

boolean


register(registration): void;

Defined in: packages/engine/src/vm/OpRegistry.ts:94

ParameterType
registrationIOpcodeHandlerRegistration

void


unregister(opcode): void;

Defined in: packages/engine/src/vm/OpRegistry.ts:102

Remove a previously registered opcode handler. Used by package unregistration to reverse shared-registry contributions.

ParameterType
opcodenumber

void