Skip to content

Extract per-receiver branches from EmitGetProperty (follow-up to #1141) #1242

Description

@nickna

Follow-up to #1141 / epic #1094.

PR #1241 split the 5,222-line RuntimeEmitter.Objects.Properties.cs at the file level (Set*/Delete* emitters moved to sibling partials, leaving 3,090 lines), but deliberately did not extract the per-receiver branches inside the 2,028-line EmitGetProperty method into Emit<Receiver>GetBranch(il, …) helpers (the original #1141 ask).

Why deferred: EmitGetProperty emits IL through method-scoped labels and locals that are defined once at the top and shared/marked across every receiver branch (globalThis, __proto__, proxy, namespace, $Object, dict, list, string, class-instance, error-type, …). Slicing a branch into a helper means threading those shared labels/locals through the call and risks silently emitting different IL — a class of bug the test suites may not surface for every receiver×property combination.

Action: extract branches incrementally, one receiver type at a time, each verified with --verify (IL validation) plus the full dotnet test + Test262 (compiled mode) gate. Mirror the already-factored EmitProxyGetPropertyCheck/EmitProxyDeleteCheck shape (pass il + arg-loader delegates + the fall-through label). EmitSetProperty (now in RuntimeEmitter.Objects.SetProperty.cs) has the same internal structure and is a candidate too.

Part of #1094.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtCode maintainability / tech-debt cleanup

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions