Commit Graph

3 Commits

Author SHA1 Message Date
Bob Nystrom
9c663aa13c feat: implement NaN tagging for Value union and hoist bytecode/IP into locals in interpret loop
Switch Value from a struct with type/num/obj fields to a NaN-tagged uint64_t/double union, enabling faster type checks and unboxed numbers. Refactor all macros and accessors (IS_OBJ, AS_OBJ, AS_NUM, etc.) to work with the new representation. Hoist CallFrame pointer, instruction pointer, and bytecode array into local variables inside the interpret loop, updating them on frame push/pop. Enable NAN_TAGGING define and DEBUG_GC_STRESS in common.h. Update Xcode project to use c99 standard, pedantic warnings, and treat warnings as errors. Add benchmark/fib.txt with timing comparisons showing fib benchmark within 25% of Lua.
2013-11-17 22:20:15 +00:00
Bob Nystrom
69744a3acc refactor: replace call method primitives with fiber primitives and remove NO_VAL sentinel
Introduce METHOD_FIBER type and FIBER_PRIMITIVE/DEF_FIBER_PRIMITIVE macros to handle primitives that directly manipulate the fiber's call stack, eliminating the need for the special NO_VAL return value hack. Remove all fn_call0 through fn_call8 primitives and convert them to fiber primitives that call callFunction without returning a value. Update Primitive typedef to remove the Fiber parameter, and adjust primitive_metaclass_new and the interpret switch case accordingly. Delete the NO_VAL macro and its TODO comment from value.h.
2013-11-17 17:02:57 +00:00
Bob Nystrom
a59289a0af refactor: extract value type definitions and helpers from vm.h into new value.h/c files 2013-11-17 01:51:30 +00:00