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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new OpRegistry(): OpRegistry;Returns
Section titled “Returns”OpRegistry
Methods
Section titled “Methods”allocateOpcode()
Section titled “allocateOpcode()”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.
Returns
Section titled “Returns”number
A unique opcode number for the calling plugin.
Throws
Section titled “Throws”If the dynamic opcode pool is exhausted.
get(opcode): OpcodeHandler | undefined;Defined in: packages/engine/src/vm/OpRegistry.ts:106
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opcode | number |
Returns
Section titled “Returns”OpcodeHandler | undefined
has(opcode): boolean;Defined in: packages/engine/src/vm/OpRegistry.ts:110
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opcode | number |
Returns
Section titled “Returns”boolean
register()
Section titled “register()”register(registration): void;Defined in: packages/engine/src/vm/OpRegistry.ts:94
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
registration | IOpcodeHandlerRegistration |
Returns
Section titled “Returns”void
unregister()
Section titled “unregister()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opcode | number |
Returns
Section titled “Returns”void