Repository navigation
Commit 5a9be05
committed
Emit class-form resumable state machines under hot reload (EnC)
Add an Edit-and-Continue codegen mode (--test:HotReloadClassStateMachines)
that lowers task/taskSeq/user resumable computation expressions to
reference-type (class) state machines instead of structs, so adding,
removing, or reordering a let!/do!/yield becomes an
AddInstanceFieldToExistingType + method update at runtime rather than a
forbidden value-type re-layout. This mirrors Roslyn's struct->class flip
under EnC, generalized to the resumable-code substrate (the gate lives in
the shared GenStructStateMachine).
- IlxGen: boxity threaded through TemplateReplacement; class type-def
(parameterless ctor, newobj, reference-based capture init); a byref-this
bridge (spill 'this' to a byref local via ldarga + ldobj deref before
field access) so the byref-threaded resumable ABI works on a reference type.
- TypedTreeDiff: under class mode a resumable-member shape change is an
allowed, capability-gated method/field update rather than a
StateMachineShapeChange rude edit.
- IlxDeltaEmitter: a fresh instance field on an existing compiler-generated
class state machine is emitted as an added field
(AddInstanceFieldToExistingType) instead of being skipped.
- TcGlobals/TcConfig: the flag drives codegen and the classifier consistently
across the baseline and delta compiles.
- Tests: runtime ApplyUpdate parity tests (add/remove let!, add inside a loop,
backgroundTask) for the edits Roslyn allows.
Flag-off is byte-identical (mkILValueTy = mkILNamedTy AsValue); the deref and
spill only fire under an active class-state-machine template replacement.1 parent d917915 commit 5a9be05
12 files changed
Lines changed: 366 additions & 28 deletions
File tree
- src/Compiler
- CodeGen
- Driver
- Service
- TypedTree
- tests/FSharp.Compiler.ComponentTests/HotReload
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3773 | 3773 | | |
3774 | 3774 | | |
3775 | 3775 | | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
| 3780 | + | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
| 3785 | + | |
| 3786 | + | |
| 3787 | + | |
| 3788 | + | |
| 3789 | + | |
| 3790 | + | |
| 3791 | + | |
| 3792 | + | |
3776 | 3793 | | |
3777 | 3794 | | |
3778 | 3795 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
| 744 | + | |
| 745 | + | |
744 | 746 | | |
745 | 747 | | |
746 | 748 | | |
| |||
942 | 944 | | |
943 | 945 | | |
944 | 946 | | |
| 947 | + | |
945 | 948 | | |
946 | 949 | | |
947 | 950 | | |
| |||
1487 | 1490 | | |
1488 | 1491 | | |
1489 | 1492 | | |
| 1493 | + | |
1490 | 1494 | | |
1491 | 1495 | | |
1492 | 1496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
593 | 595 | | |
594 | 596 | | |
595 | 597 | | |
| |||
965 | 967 | | |
966 | 968 | | |
967 | 969 | | |
| 970 | + | |
| 971 | + | |
968 | 972 | | |
969 | 973 | | |
970 | 974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2602 | 2602 | | |
2603 | 2603 | | |
2604 | 2604 | | |
| 2605 | + | |
2605 | 2606 | | |
2606 | 2607 | | |
2607 | 2608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1469 | 1469 | | |
1470 | 1470 | | |
1471 | 1471 | | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1472 | 1479 | | |
1473 | 1480 | | |
1474 | 1481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | | - | |
| 566 | + | |
| 567 | + | |
567 | 568 | | |
568 | 569 | | |
569 | 570 | | |
| |||
578 | 579 | | |
579 | 580 | | |
580 | 581 | | |
| 582 | + | |
581 | 583 | | |
582 | 584 | | |
583 | 585 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
969 | 969 | | |
970 | 970 | | |
971 | 971 | | |
| 972 | + | |
972 | 973 | | |
973 | 974 | | |
974 | 975 | | |
| |||
984 | 985 | | |
985 | 986 | | |
986 | 987 | | |
| 988 | + | |
987 | 989 | | |
988 | 990 | | |
989 | 991 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
1145 | 1146 | | |
1146 | 1147 | | |
1147 | 1148 | | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
1148 | 1154 | | |
1149 | 1155 | | |
1150 | 1156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
901 | 902 | | |
902 | 903 | | |
903 | 904 | | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
904 | 910 | | |
905 | 911 | | |
906 | 912 | | |
| |||
0 commit comments