Move OP_CLOSURE and OP_LIST down.

Since they're less frequently used, pushing them down speeds
things up a little bit.
This commit is contained in:
Bob Nystrom
2013-12-13 06:47:34 -08:00
parent 5aaaa33552
commit 4957728893
4 changed files with 95 additions and 95 deletions
+15 -15
View File
@@ -22,21 +22,6 @@ typedef enum
// Push true onto the stack.
CODE_TRUE,
// 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
// upvalue. The first is non-zero if the variable being captured is a local
// (as opposed to an upvalue), and the second is the index of the local or
// upvalue being captured.
//
// Pushes the created closure.
CODE_CLOSURE,
// Pushes the value in local slot [arg].
CODE_LOAD_LOCAL,
@@ -115,6 +100,21 @@ 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
// upvalue. The first is non-zero if the variable being captured is a local
// (as opposed to an upvalue), and the second is the index of the local or
// upvalue being captured.
//
// Pushes the created closure.
CODE_CLOSURE,
// Define a new empty class and push it.
CODE_CLASS,