Skip to content

CFG Part 1: ProcDecoder Refactor#2596

Closed
ike709 wants to merge 18 commits into
OpenDreamProject:masterfrom
ike709:cfg_part_1
Closed

CFG Part 1: ProcDecoder Refactor#2596
ike709 wants to merge 18 commits into
OpenDreamProject:masterfrom
ike709:cfg_part_1

Conversation

@ike709

@ike709 ike709 commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Please merge #2635 first since this PR is branched off of that. This PR is just the last couple commits. EDIT: Will update after #2635 is merged first.

This is the much more atomized next PR in the series of changes to implement a control flow graph. This PR focuses on ripping ProcDecoder out of the runtime and throwing it into the DMCompiler project so the control flow graph can share it with the debugger and disassembler. It also changes the ITuple to a new ProcInstruction struct comprised of ProcOperands.

I tested it by doing before & after disassembler dumps of TG between CFG Part 0 and this PR. They were identical except for the removal of some trailing whitespace on some of the N-variant opcodes.

@boring-cyborg boring-cyborg Bot added Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime labels May 26, 2026
@ike709

ike709 commented May 26, 2026

Copy link
Copy Markdown
Collaborator Author

We could eliminate the switch() in GetBranchTarget() by being consistent about operand ordering in the opcodes, but I'll leave that for a future PR.

@github-actions

Copy link
Copy Markdown

This pull request has conflicts, please resolve those before we can evaluate the pull request.

public sealed class BytecodeProcDecoder(IReadOnlyList<string> strings, byte[] bytecode) {
public readonly IReadOnlyList<string> Strings = strings;
public readonly byte[] Bytecode = bytecode;
public int Offset = 0;
@ike709 ike709 marked this pull request as draft June 22, 2026 14:42
@ike709

ike709 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

Will update after #2635 is merged.

@github-actions

Copy link
Copy Markdown

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@ike709

ike709 commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

Superceded by #2651

@ike709 ike709 closed this Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compiler Involves the OpenDream compiler Merge Conflict Runtime Involves the OpenDream server/runtime size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants