Step 4: allow bytecode for destructuring/extension decls
This commit is contained in:
parent
f5ced02505
commit
f9fe3d1186
@ -14,6 +14,24 @@ Goal: migrate the compiler so all values live in frames/bytecode, keeping JVM te
|
|||||||
- [x] Preserve existing error/stack semantics.
|
- [x] Preserve existing error/stack semantics.
|
||||||
- [x] JVM tests must be green before commit.
|
- [x] JVM tests must be green before commit.
|
||||||
|
|
||||||
|
## Remaining Migration (prioritized)
|
||||||
|
|
||||||
|
- [x] Step 4: Allow bytecode wrapping for supported declaration statements.
|
||||||
|
- [x] Enable `DestructuringVarDeclStatement` and `ExtensionPropertyDeclStatement` in `containsUnsupportedForBytecode`.
|
||||||
|
- [x] Keep JVM tests green before commit.
|
||||||
|
- [ ] Step 5: Enable bytecode for delegated var declarations.
|
||||||
|
- [ ] Revisit `containsDelegatedRefs` guard for `DelegatedVarDeclStatement`.
|
||||||
|
- [ ] Ensure delegate binding uses explicit `Statement` objects (no inline suspend lambdas).
|
||||||
|
- [ ] Step 6: Map literal spread in bytecode.
|
||||||
|
- [ ] Replace `MapLiteralEntry.Spread` bytecode exception with runtime `putAll`/merge logic.
|
||||||
|
- [ ] Step 7: Class-scope member refs in bytecode.
|
||||||
|
- [ ] Support `ClassScopeMemberRef` without scope-map fallback.
|
||||||
|
- [ ] Step 8: ObjDynamic member access in bytecode.
|
||||||
|
- [ ] Allow dynamic receiver field/method lookup without falling back to interpreter.
|
||||||
|
- [ ] Step 9: Module-level bytecode execution.
|
||||||
|
- [ ] Compile `Script` bodies to bytecode instead of interpreting at module scope.
|
||||||
|
- [ ] Keep import/module slot seeding in frame-only flow.
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- Keep imports bound to module frame slots; no scope map writes for imports.
|
- Keep imports bound to module frame slots; no scope map writes for imports.
|
||||||
|
|||||||
@ -1893,10 +1893,12 @@ class Compiler(
|
|||||||
is BlockStatement -> target.statements().any { containsUnsupportedForBytecode(it) }
|
is BlockStatement -> target.statements().any { containsUnsupportedForBytecode(it) }
|
||||||
is InlineBlockStatement -> target.statements().any { containsUnsupportedForBytecode(it) }
|
is InlineBlockStatement -> target.statements().any { containsUnsupportedForBytecode(it) }
|
||||||
is VarDeclStatement -> target.initializer?.let { containsUnsupportedForBytecode(it) } ?: false
|
is VarDeclStatement -> target.initializer?.let { containsUnsupportedForBytecode(it) } ?: false
|
||||||
|
is DestructuringVarDeclStatement -> containsUnsupportedForBytecode(target.initializer)
|
||||||
is BreakStatement -> target.resultExpr?.let { containsUnsupportedForBytecode(it) } ?: false
|
is BreakStatement -> target.resultExpr?.let { containsUnsupportedForBytecode(it) } ?: false
|
||||||
is ContinueStatement -> false
|
is ContinueStatement -> false
|
||||||
is ReturnStatement -> target.resultExpr?.let { containsUnsupportedForBytecode(it) } ?: false
|
is ReturnStatement -> target.resultExpr?.let { containsUnsupportedForBytecode(it) } ?: false
|
||||||
is ThrowStatement -> containsUnsupportedForBytecode(target.throwExpr)
|
is ThrowStatement -> containsUnsupportedForBytecode(target.throwExpr)
|
||||||
|
is ExtensionPropertyDeclStatement -> false
|
||||||
is TryStatement -> {
|
is TryStatement -> {
|
||||||
containsUnsupportedForBytecode(target.body) ||
|
containsUnsupportedForBytecode(target.body) ||
|
||||||
target.catches.any { containsUnsupportedForBytecode(it.block) } ||
|
target.catches.any { containsUnsupportedForBytecode(it.block) } ||
|
||||||
@ -1928,6 +1930,7 @@ class Compiler(
|
|||||||
is CastRef -> containsUnsupportedRef(ref.castValueRef()) || containsUnsupportedRef(ref.castTypeRef())
|
is CastRef -> containsUnsupportedRef(ref.castValueRef()) || containsUnsupportedRef(ref.castTypeRef())
|
||||||
is net.sergeych.lyng.obj.TypeDeclRef -> false
|
is net.sergeych.lyng.obj.TypeDeclRef -> false
|
||||||
is AssignRef -> {
|
is AssignRef -> {
|
||||||
|
if (ref.target is ListLiteralRef) return true
|
||||||
val target = ref.target as? LocalSlotRef
|
val target = ref.target as? LocalSlotRef
|
||||||
(target?.isDelegated == true) || containsUnsupportedRef(ref.value)
|
(target?.isDelegated == true) || containsUnsupportedRef(ref.value)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user