refactor: remove dedicated CODE_LIST bytecode in favor of new List instantiation with .add() calls
Eliminate the LIST opcode and its interpreter case, debug printing, and enum entry. Instead compile list literals by loading the List class, calling its constructor, then emitting DUP, element expression, CALL_1 for add(), and POP for each element. This removes interpreter loop code and lifts the previous 255-element limit on list literals.
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
class Sequence {
|
||||
map(f) {
|
||||
var result = []
|
||||
var result = new List
|
||||
for (element in this) {
|
||||
result.add(f.call(element))
|
||||
}
|
||||
@@ -8,7 +8,7 @@ class Sequence {
|
||||
}
|
||||
|
||||
where(f) {
|
||||
var result = []
|
||||
var result = new List
|
||||
for (element in this) {
|
||||
if (f.call(element)) result.add(element)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user