Commit db0dcd7
vm: lower Foo::\$bar OP= rhs to OP_STATIC_PROP_COMPOUND_ASSIGN
Mirrors the OP_OBJECT_COMPOUND_ASSIGN landed in the prior commit.
Encoding:
A = const-pool name index (ZString varName, w/o leading $)
B = tokenizer ItemType (op token)
C bit 0 = keep-value-on-stack (expr vs stmt context)
Stack: pops rhs, pops class-source. Handler:
cur, _ := EvalClassStaticVarRead(ctx, class-source, name, loc)
cur := cur.Dup()
res := compoundOp(op)(cur, rhs)
AssignClassStaticProp(ctx, class-source, name, res)
if C&1 { push(res) }
Both helpers already exist and carry LSB-aware class resolution,
read-side and asymmetric write-side visibility checks, and typed-prop
coercion. The native path inherits those unchanged.
Verified locally:
Counter::\$n += 5 -> 15
Counter::\$n *= 2 -> 26
Counter::\$s .= ' world' -> 'hi world'
Expr ctx: \$x = (Counter::\$n += 100) -> both 126
LSB: Parent1::bump() bumps Parent1::\$cnt,
Child1::bump() bumps Child1::\$cnt
(static::\$cnt picks up the called class)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent bb1672f commit db0dcd7
3 files changed
Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
490 | 501 | | |
491 | 502 | | |
492 | 503 | | |
| |||
625 | 636 | | |
626 | 637 | | |
627 | 638 | | |
| 639 | + | |
628 | 640 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1596 | 1596 | | |
1597 | 1597 | | |
1598 | 1598 | | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
1599 | 1631 | | |
1600 | 1632 | | |
1601 | 1633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
966 | 966 | | |
967 | 967 | | |
968 | 968 | | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
969 | 996 | | |
970 | 997 | | |
971 | 998 | | |
| |||
0 commit comments