Get rid of separate CODE_SUBCLASS instruction.

Just pushes null to indicate "inherits from Object". Unifies a
bit of code.
This commit is contained in:
Bob Nystrom
2014-01-26 17:25:38 -08:00
parent 27f458de8e
commit 9739bc7b30
5 changed files with 74 additions and 157 deletions
+1 -4
View File
@@ -151,9 +151,6 @@ typedef enum
// Define a new empty class and push it.
CODE_CLASS,
// Pop a superclass off the stack, then push a new class that extends it.
CODE_SUBCLASS,
// Define a method for symbol [arg]. The class receiving the method is popped
// off the stack, then the function defining the body is popped.
CODE_METHOD_INSTANCE,
@@ -162,7 +159,7 @@ typedef enum
// the method is popped off the stack, then the function defining the body is
// popped.
CODE_METHOD_STATIC,
// This pseudo-instruction indicates the end of the bytecode. It should
// always be preceded by a `CODE_RETURN`, so is never actually executed.
CODE_END