Get rid of bytecodes for list literals.

Just compile them to:

new List
.add(...)
.add(...)
...

Gets rid of some code in the interpreter loop, which is always good.
Also addresses the old limitation where a list literal could only have
255 elements.
This commit is contained in:
Bob Nystrom
2015-01-25 22:49:30 -08:00
parent a9bd864c6b
commit ed8e595f54
6 changed files with 27 additions and 45 deletions
-5
View File
@@ -148,11 +148,6 @@ typedef enum
// stack.
CODE_RETURN,
// Create a new list with [arg] elements. The top [arg] values on the stack
// are the elements in forward order. Removes the elements and then pushes
// the new list.
CODE_LIST,
// Creates a closure for the function stored at [arg] in the constant table.
//
// Following the function argument is a number of arguments, two for each