From 00c9a21ccef939cdad9b6abef2cd90c9dbd8c1c6 Mon Sep 17 00:00:00 2001 From: Randy Stauner Date: Wed, 5 Nov 2025 18:29:38 -0700 Subject: [PATCH 1/2] [DOC] Update glossary (#15070) --- doc/contributing/glossary.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/contributing/glossary.md b/doc/contributing/glossary.md index fb5570f5e2562b..3ec9796147ddc7 100644 --- a/doc/contributing/glossary.md +++ b/doc/contributing/glossary.md @@ -4,15 +4,17 @@ Just a list of acronyms I've run across in the Ruby source code and their meanin | Term | Definition | | --- | -----------| +| `bmethod` | Method defined by `define_method() {}` (a Block that runs as a Method). | | `BIN` | Basic Instruction Name. Used as a macro to reference the YARV instruction. Converts pop into YARVINSN_pop. | | `bop` | Basic Operator. Relates to methods like `Integer` plus and minus which can be optimized as long as they haven't been redefined. | | `cc` | Call Cache. An inline cache structure for the call site. Stored in the `cd` | | `cd` | Call Data. A data structure that points at the `ci` and the `cc`. `iseq` objects points at the `cd`, and access call information and call caches via this structure | | CFG | Control Flow Graph. Representation of the program where all control-flow and data dependencies have been made explicit by unrolling the stack and local variables. | | `cfp`| Control Frame Pointer. Represents a Ruby stack frame. Calling a method pushes a new frame (cfp), returning pops a frame. Points at the `pc`, `sp`, `ep`, and the corresponding `iseq`| -| `ci` | Call Information. Refers to an `rb_callinfo` struct. Contains call information about the call site, including number of parameters to be passed, whether it they are keyword arguments or not, etc. Used in conjunction with the `cc` and `cd`. | +| `ci` | Call Information. Refers to an `rb_callinfo` struct. Contains call information about the call site, including number of parameters to be passed, whether they are keyword arguments or not, etc. Used in conjunction with the `cc` and `cd`. | +| `cme` | Callable Method Entry. Refers to the `rb_callable_method_entry_t` struct, the internal representation of a Ruby method that has `defined_class` and `owner` set and is ready for dispatch. | | `cref` | Class reference. A structure pointing to the class reference where `klass_or_self`, visibility scope, and refinements are stored. It also stores a pointer to the next class in the hierarchy referenced by `rb_cref_struct * next`. The Class reference is lexically scoped. | -| CRuby | Implementation of Ruby written in C | +| CRuby | Reference implementation of Ruby written in C | | `cvar` | Class Variable. Refers to a Ruby class variable like `@@foo` | | `dvar` | Dynamic Variable. Used by the parser to refer to local variables that are defined outside of the current lexical scope. For example `def foo; bar = 1; -> { p bar }; end` the "bar" inside the block is a `dvar` | | `ec` | Execution Context. The top level VM context, points at the current `cfp` | @@ -36,9 +38,10 @@ Just a list of acronyms I've run across in the Ruby source code and their meanin | `snt` | Shared Native Thread. OS thread on which many ruby threads can run. Ruby threads from different ractors can even run on the same SNT. Ruby threads can switch SNTs when they context switch. SNTs are used in the M:N threading model. By default, non-main ractors use this model. | `dnt` | Dedicated Native Thread. OS thread on which only one ruby thread can run. The ruby thread always runs on that same OS thread. DNTs are used in the 1:1 threading model. By default, the main ractor uses this model. | `sp` | Stack Pointer. The top of the stack. The VM executes instructions in the `iseq` and instructions will push and pop values on the stack. The VM updates the `sp` on the `cfp` to point at the top of the stack| +| ST table | ST table is the main C implementation of a hash (smaller Ruby hashes may be backed by AR tables). | | `svar` | Special Variable. Refers to special local variables like `$~` and `$_`. See the `getspecial` instruction in `insns.def` | | `VALUE` | VALUE is a pointer to a ruby object from the Ruby C code. | -| VM | Virtual Machine. In MRI's case YARV (Yet Another Ruby VM) +| VM | Virtual Machine. In MRI's case YARV (Yet Another Ruby VM) | WB | Write Barrier. To do with GC write barriers | | WC | Wild Card. As seen in instructions like `getlocal_WC_0`. It means this instruction takes a "wild card" for the parameter (in this case an index for a local) | | YARV | Yet Another Ruby VM. The virtual machine that CRuby uses | From 6014ed99680fd3beb013dd8564f81f6c2f2a9f34 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sun, 2 Nov 2025 13:45:26 -0500 Subject: [PATCH 2/2] Remove dead rb_hash_dump --- hash.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/hash.c b/hash.c index 97a303c4d5851c..a8be0bad75f675 100644 --- a/hash.c +++ b/hash.c @@ -492,37 +492,6 @@ RHASH_AR_TABLE_BOUND(VALUE h) #if HASH_DEBUG #define hash_verify(hash) hash_verify_(hash, __FILE__, __LINE__) -void -rb_hash_dump(VALUE hash) -{ - rb_obj_info_dump(hash); - - if (RHASH_AR_TABLE_P(hash)) { - unsigned i, bound = RHASH_AR_TABLE_BOUND(hash); - - fprintf(stderr, " size:%u bound:%u\n", - RHASH_AR_TABLE_SIZE(hash), bound); - - for (i=0; ikey; - v = pair->val; - fprintf(stderr, " %d key:%s val:%s hint:%02x\n", i, - rb_raw_obj_info(b1, 0x100, k), - rb_raw_obj_info(b2, 0x100, v), - ar_hint(hash, i)); - } - else { - fprintf(stderr, " %d empty\n", i); - } - } - } -} - static VALUE hash_verify_(VALUE hash, const char *file, int line) {