Commit b75c5122
b75c5122a082Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 3 files · ~3 modified
Description
Add Object.new identity sentinel support
Emit sp_Object_new() for Object.new calls; wire up SP_BUILTIN_OBJECT constant and TY_POLY inference for Object.new call sites.
Co-Authored-By: Claude Sonnet 4.6 [email protected]
Details
- Commit
- b75c5122a082
- Parent
- 85ca448660c7
lib/sp_runtime.hmodifiedView file
@@ -2639,6 +2639,7 @@
26392639
#define SP_BUILTIN_STR_POLY_HASH (-18)26402640
#define SP_BUILTIN_SYM_POLY_HASH (-19)26412641
#define SP_BUILTIN_POLY_POLY_HASH (-20)2642+
#define SP_BUILTIN_OBJECT (-21) /* Object.new identity sentinel */26422643
/* sp_RbVal is defined in sp_gc.h (the mark helpers dispatch on its tag). */26432644
static sp_RbVal sp_box_int(mrb_int v) { sp_RbVal r; r.tag = SP_TAG_INT; r.cls_id = 0; r.v.i = v; return r; }26442645
static sp_RbVal sp_box_str(const char *v) { sp_RbVal r; r.tag = SP_TAG_STR; r.cls_id = 0; r.v.s = v; return r; }src/analyze.cmodifiedView file
Loading diff…
src/codegen.cmodifiedView file
Loading diff…