feat: store class reference directly in Obj struct and inline class lookup for method dispatch

Move the class pointer from ObjInstance into the base Obj struct and remove the separate metaclass field from ObjClass, allowing all heap objects to directly reference their class. Add an inlined wrenGetClassInline function in the header to eliminate function call overhead during method dispatch, yielding 10-43% performance gains across benchmarks.
This commit is contained in:
Bob Nystrom
2014-12-07 22:29:50 +00:00
parent 520e841044
commit d224721f79
7 changed files with 108 additions and 92 deletions
+2 -2
View File
@@ -17,10 +17,10 @@ RELEASE_OBJECTS = $(addprefix build/release/, $(notdir $(OBJECTS)))
all: release
clean:
rm -rf build wren wrend
@rm -rf build wren wrend
prep:
mkdir -p build/debug build/release
@mkdir -p build/debug build/release
# Debug build.
debug: prep wrend