pr1.2
This commit is contained in:
@@ -25,10 +25,10 @@ grep -RIn --exclude-dir target \
|
||||
# Scope-related (inventory only; not necessarily to delete)
|
||||
grep -RIn --exclude-dir target -e 'PushScope' -e 'PopScope' crates/console
|
||||
|
||||
# Trap codes with HIP/RC semantics
|
||||
# Trap codes inventory (post-reset, check for any lingering gate-specific traps)
|
||||
grep -RIn --exclude-dir target \
|
||||
-e 'TRAP_INVALID_GATE' -e 'TRAP_DEAD_GATE' -e 'TRAP_TYPE' \
|
||||
crates/console/prometeu-bytecode crates/console/prometeu-vm
|
||||
-e '\bTRAP_\w\+' \
|
||||
crates/console/prometeu-bytecode crates/console/prometeu-vm | grep -Ei 'gate|heap|hip' -n || true
|
||||
|
||||
# Value::Gate usages
|
||||
grep -RIn --exclude-dir target -e 'Value::Gate' crates/console
|
||||
@@ -88,11 +88,9 @@ Remove — OpCode variants (definitions and all references)
|
||||
|
||||
2) Trap codes (RC/HIP)
|
||||
|
||||
Remove — HIP-specific traps (delete constants and all usages)
|
||||
Remove — gate-specific traps (delete constants and all usages)
|
||||
- crates/console/prometeu-bytecode/src/abi.rs
|
||||
- TRAP_INVALID_GATE (0x01)
|
||||
- TRAP_DEAD_GATE (0x02)
|
||||
- TRAP_TYPE (0x04) — typed storage/gate mismatch (legacy)
|
||||
- Remove identifiers tied to HIP/gate semantics
|
||||
|
||||
Keep — still meaningful under GC model (names may be revised later, but remain functionally)
|
||||
- crates/console/prometeu-bytecode/src/abi.rs
|
||||
@@ -103,10 +101,11 @@ Keep — still meaningful under GC model (names may be revised later, but remain
|
||||
- TRAP_DIV_ZERO (0x0000_000A)
|
||||
- TRAP_INVALID_FUNC (0x0000_000B)
|
||||
- TRAP_BAD_RET_SLOTS (0x0000_000C)
|
||||
- TRAP_TYPE — retained; semantics generalized to non-HIP type mismatches
|
||||
|
||||
Usages to edit alongside removal
|
||||
- crates/console/prometeu-vm/src/virtual_machine.rs
|
||||
- Imports: TRAP_INVALID_GATE, TRAP_DEAD_GATE, TRAP_TYPE
|
||||
- Imports: remove any gate-specific trap imports
|
||||
- resolve_gate() and gate handlers construct TrapInfo with those codes
|
||||
- Tests asserting these trap codes
|
||||
|
||||
@@ -144,7 +143,7 @@ Will be removed outright (symbols or blocks)
|
||||
- prometeu-bytecode
|
||||
- opcode.rs: all Gate* variants and Alloc variant; TryFrom/encoding IDs and cycles for those
|
||||
- opcode_spec.rs: corresponding spec arms (GATE_*, ALLOC)
|
||||
- abi.rs: TRAP_INVALID_GATE, TRAP_DEAD_GATE, TRAP_TYPE constants
|
||||
- abi.rs: gate-specific trap constants
|
||||
- prometeu-vm
|
||||
- virtual_machine.rs: handlers for Alloc and all Gate* opcodes; GateEntry/GateId data structures; resolve_gate(); HIP-focused unit tests listed above
|
||||
|
||||
|
||||
@@ -81,13 +81,15 @@ TrapInfo {
|
||||
| `TRAP_OOB` | Out of bounds | Access beyond allowed bounds |
|
||||
| `TRAP_INVALID_LOCAL` | Invalid local | Local slot index out of bounds |
|
||||
|
||||
### 5.2 Heap / Gate
|
||||
### 5.2 Execution & Types
|
||||
|
||||
| Code | Name | Meaning |
|
||||
| ------------------- | -------------- | -------------------------- |
|
||||
| `TRAP_INVALID_GATE` | Invalid gate | Non-existent gate handle |
|
||||
| `TRAP_DEAD_GATE` | Dead gate | Gate with refcount = 0 |
|
||||
| `TRAP_TYPE` | Type violation | Heap or gate type mismatch |
|
||||
| Code | Name | Meaning |
|
||||
| ------------------------- | -------------------- | ------------------------------------------------------ |
|
||||
| `TRAP_ILLEGAL_INSTRUCTION`| Illegal instruction | Unknown/invalid opcode encountered |
|
||||
| `TRAP_TYPE` | Type violation | Type mismatch for operation or syscall argument types |
|
||||
| `TRAP_DIV_ZERO` | Divide by zero | Division/modulo by zero |
|
||||
| `TRAP_INVALID_FUNC` | Invalid function | Function index not present in function table |
|
||||
| `TRAP_BAD_RET_SLOTS` | Bad return slots | Stack height mismatch at return |
|
||||
|
||||
### 5.3 System
|
||||
|
||||
|
||||
Reference in New Issue
Block a user