refactor: remove separate CODE_SUBCLASS instruction, unify class creation with null sentinel

Eliminate the dedicated CODE_SUBCLASS opcode and instead push a null value to indicate implicit inheritance from Object. This simplifies the bytecode interpreter by using a single CODE_CLASS instruction that checks the top of stack for a null sentinel to determine whether to use the implicit Object superclass or a user-provided superclass. The change also consolidates argument counting and debug printing logic, removing the now-unnecessary case branches for CODE_SUBCLASS across the compiler, VM, and debug modules.
This commit is contained in:
Bob Nystrom
2014-01-27 01:25:38 +00:00
parent 4aa851cb64
commit 74b67eae67
5 changed files with 74 additions and 157 deletions
+1
View File
@@ -1,5 +1,6 @@
# Intermediate files directory.
build/
build_xcode/
# Built applications.
wren