diff --git a/bytecode_migration_plan.md b/bytecode_migration_plan.md index 8c470c8..e042fd3 100644 --- a/bytecode_migration_plan.md +++ b/bytecode_migration_plan.md @@ -32,6 +32,13 @@ Goal: migrate the compiler so all values live in frames/bytecode, keeping JVM te - [x] Step 9: Module-level bytecode execution. - [x] Compile `Script` bodies to bytecode instead of interpreting at module scope. - [x] Keep import/module slot seeding in frame-only flow. +- [ ] Step 10: Bytecode for declaration statements in module scripts. + - [ ] Support `ClassDeclStatement`, `FunctionDeclStatement`, `EnumDeclStatement` in bytecode compilation. + - [ ] Decide whether to compile declarations into module bytecode or keep a mixed execution path. +- [ ] Step 11: Destructuring assignment bytecode. + - [ ] Handle `[a, b] = expr` (AssignRef target `ListLiteralRef`) without interpreter fallback. +- [ ] Step 12: Optional member assign-ops and inc/dec in bytecode. + - [ ] Support `a?.b += 1` and `a?.b++` for `FieldRef` targets. ## Notes diff --git a/lynglib/src/commonMain/kotlin/net/sergeych/lyng/Compiler.kt b/lynglib/src/commonMain/kotlin/net/sergeych/lyng/Compiler.kt index e0b155b..f004f04 100644 --- a/lynglib/src/commonMain/kotlin/net/sergeych/lyng/Compiler.kt +++ b/lynglib/src/commonMain/kotlin/net/sergeych/lyng/Compiler.kt @@ -1967,11 +1967,9 @@ class Compiler( is LocalSlotRef -> target.name else -> null } - if (targetName == "delay") return true containsUnsupportedRef(ref.target) || ref.args.any { containsUnsupportedForBytecode(it.value) } } is MethodCallRef -> { - if (ref.name == "delay") return true val receiverClass = resolveReceiverClassForMember(ref.receiver) ?: return true val hasMember = receiverClass.instanceMethodIdMap(includeAbstract = true)[ref.name] != null if (!hasMember && !hasExtensionFor(receiverClass.className, ref.name)) return true