Ruby  2.7.1p83(2020-03-31revisiona0c7c23c9cec0d0ffcba012279cd652d28ad5bf3)
internal.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  internal.h -
4 
5  $Author$
6  created at: Tue May 17 11:42:20 JST 2011
7 
8  Copyright (C) 2011 Yukihiro Matsumoto
9 
10 **********************************************************************/
11 
12 #ifndef RUBY_INTERNAL_H
13 #define RUBY_INTERNAL_H 1
14 
15 #include "ruby.h"
16 
17 #if defined(__cplusplus)
18 extern "C" {
19 #if 0
20 } /* satisfy cc-mode */
21 #endif
22 #endif
23 
24 #ifdef HAVE_STDBOOL_H
25 # include <stdbool.h>
26 #else
27 # include "missing/stdbool.h"
28 #endif
29 
30 /* The most significant bit of the lower part of half-long integer.
31  * If sizeof(long) == 4, this is 0x8000.
32  * If sizeof(long) == 8, this is 0x80000000.
33  */
34 #define HALF_LONG_MSB ((SIGNED_VALUE)1<<((SIZEOF_LONG*CHAR_BIT-1)/2))
35 
36 #define LIKELY(x) RB_LIKELY(x)
37 #define UNLIKELY(x) RB_UNLIKELY(x)
38 
39 #ifndef MAYBE_UNUSED
40 # define MAYBE_UNUSED(x) x
41 #endif
42 
43 #ifndef WARN_UNUSED_RESULT
44 # define WARN_UNUSED_RESULT(x) x
45 #endif
46 
47 #ifndef __has_feature
48 # define __has_feature(x) 0
49 #endif
50 
51 #ifndef __has_extension
52 # define __has_extension __has_feature
53 #endif
54 
55 #if 0
56 #elif defined(NO_SANITIZE) && __has_feature(memory_sanitizer)
57 # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
58  NO_SANITIZE("memory", NO_SANITIZE("address", NOINLINE(x)))
59 #elif defined(NO_SANITIZE)
60 # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
61  NO_SANITIZE("address", NOINLINE(x))
62 #elif defined(NO_SANITIZE_ADDRESS)
63 # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
64  NO_SANITIZE_ADDRESS(NOINLINE(x))
65 #elif defined(NO_ADDRESS_SAFETY_ANALYSIS)
66 # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
67  NO_ADDRESS_SAFETY_ANALYSIS(NOINLINE(x))
68 #else
69 # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x
70 #endif
71 
72 #if defined(NO_SANITIZE) && defined(__GNUC__) &&! defined(__clang__)
73 /* GCC warns about unknown sanitizer, which is annoying. */
74 #undef NO_SANITIZE
75 #define NO_SANITIZE(x, y) \
76  COMPILER_WARNING_PUSH; \
77  COMPILER_WARNING_IGNORED(-Wattributes); \
78  __attribute__((__no_sanitize__(x))) y; \
79  COMPILER_WARNING_POP
80 #endif
81 
82 #ifndef NO_SANITIZE
83 # define NO_SANITIZE(x, y) y
84 #endif
85 
86 #ifdef HAVE_VALGRIND_MEMCHECK_H
87 # include <valgrind/memcheck.h>
88 # ifndef VALGRIND_MAKE_MEM_DEFINED
89 # define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE((p), (n))
90 # endif
91 # ifndef VALGRIND_MAKE_MEM_UNDEFINED
92 # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n))
93 # endif
94 #else
95 # define VALGRIND_MAKE_MEM_DEFINED(p, n) 0
96 # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
97 #endif
98 
99 #define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
100 
101 #ifndef MJIT_HEADER
102 
103 #ifdef HAVE_SANITIZER_ASAN_INTERFACE_H
104 # include <sanitizer/asan_interface.h>
105 #endif
106 
107 #if !__has_feature(address_sanitizer)
108 # define __asan_poison_memory_region(x, y)
109 # define __asan_unpoison_memory_region(x, y)
110 # define __asan_region_is_poisoned(x, y) 0
111 #endif
112 
113 #ifdef HAVE_SANITIZER_MSAN_INTERFACE_H
114 # if __has_feature(memory_sanitizer)
115 # include <sanitizer/msan_interface.h>
116 # endif
117 #endif
118 
119 #if !__has_feature(memory_sanitizer)
120 # define __msan_allocated_memory(x, y) ((void)(x), (void)(y))
121 # define __msan_poison(x, y) ((void)(x), (void)(y))
122 # define __msan_unpoison(x, y) ((void)(x), (void)(y))
123 # define __msan_unpoison_string(x) ((void)(x))
124 #endif
125 
139 static inline void
140 asan_poison_memory_region(const volatile void *ptr, size_t size)
141 {
144 }
145 
151 static inline void
152 asan_poison_object(VALUE obj)
153 {
154  MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
155  asan_poison_memory_region(ptr, SIZEOF_VALUE);
156 }
157 
158 #if !__has_feature(address_sanitizer)
159 #define asan_poison_object_if(ptr, obj) ((void)(ptr), (void)(obj))
160 #else
161 #define asan_poison_object_if(ptr, obj) do { \
162  if (ptr) asan_poison_object(obj); \
163  } while (0)
164 #endif
165 
173 static inline void *
174 asan_poisoned_object_p(VALUE obj)
175 {
176  MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
178 }
179 
195 static inline void
196 asan_unpoison_memory_region(const volatile void *ptr, size_t size, bool malloc_p)
197 {
199  if (malloc_p) {
201  }
202  else {
204  }
205 }
206 
213 static inline void
214 asan_unpoison_object(VALUE obj, bool newobj_p)
215 {
216  MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
217  asan_unpoison_memory_region(ptr, SIZEOF_VALUE, newobj_p);
218 }
219 
220 #endif
221 
222 /* Prevent compiler from reordering access */
223 #define ACCESS_ONCE(type,x) (*((volatile type *)&(x)))
224 
225 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
226 # define STATIC_ASSERT(name, expr) _Static_assert(expr, #name ": " #expr)
227 #elif GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
228 # define STATIC_ASSERT(name, expr) RB_GNUC_EXTENSION _Static_assert(expr, #name ": " #expr)
229 #else
230 # define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
231 #endif
232 
233 #define SIGNED_INTEGER_TYPE_P(int_type) (0 > ((int_type)0)-1)
234 #define SIGNED_INTEGER_MAX(sint_type) \
235  (sint_type) \
236  ((((sint_type)1) << (sizeof(sint_type) * CHAR_BIT - 2)) | \
237  ((((sint_type)1) << (sizeof(sint_type) * CHAR_BIT - 2)) - 1))
238 #define SIGNED_INTEGER_MIN(sint_type) (-SIGNED_INTEGER_MAX(sint_type)-1)
239 #define UNSIGNED_INTEGER_MAX(uint_type) (~(uint_type)0)
240 
241 #if SIGNEDNESS_OF_TIME_T < 0 /* signed */
242 # define TIMET_MAX SIGNED_INTEGER_MAX(time_t)
243 # define TIMET_MIN SIGNED_INTEGER_MIN(time_t)
244 #elif SIGNEDNESS_OF_TIME_T > 0 /* unsigned */
245 # define TIMET_MAX UNSIGNED_INTEGER_MAX(time_t)
246 # define TIMET_MIN ((time_t)0)
247 #endif
248 #define TIMET_MAX_PLUS_ONE (2*(double)(TIMET_MAX/2+1))
249 
250 #ifdef HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
251 #define MUL_OVERFLOW_P(a, b) \
252  __builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0)
253 #elif defined HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
254 #define MUL_OVERFLOW_P(a, b) \
255  RB_GNUC_EXTENSION_BLOCK(__typeof__(a) c; __builtin_mul_overflow((a), (b), &c))
256 #endif
257 
258 #define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \
259  (a) == 0 ? 0 : \
260  (a) == -1 ? (b) < -(max) : \
261  (a) > 0 ? \
262  ((b) > 0 ? (max) / (a) < (b) : (min) / (a) > (b)) : \
263  ((b) > 0 ? (min) / (a) < (b) : (max) / (a) > (b)))
264 
265 #ifdef HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
266 /* __builtin_mul_overflow_p can take bitfield */
267 /* and GCC permits bitfields for integers other than int */
268 #define MUL_OVERFLOW_FIXNUM_P(a, b) RB_GNUC_EXTENSION_BLOCK( \
269  struct { long fixnum : SIZEOF_LONG * CHAR_BIT - 1; } c; \
270  __builtin_mul_overflow_p((a), (b), c.fixnum); \
271 )
272 #else
273 #define MUL_OVERFLOW_FIXNUM_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX)
274 #endif
275 
276 #ifdef MUL_OVERFLOW_P
277 #define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_P(a, b)
278 #define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_P(a, b)
279 #define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_P(a, b)
280 #else
281 #define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX)
282 #define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX)
283 #define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX)
284 #endif
285 
286 #ifndef swap16
287 # ifdef HAVE_BUILTIN___BUILTIN_BSWAP16
288 # define swap16(x) __builtin_bswap16(x)
289 # endif
290 #endif
291 
292 #ifndef swap16
293 # define swap16(x) ((uint16_t)((((x)&0xFF)<<8) | (((x)>>8)&0xFF)))
294 #endif
295 
296 #ifndef swap32
297 # ifdef HAVE_BUILTIN___BUILTIN_BSWAP32
298 # define swap32(x) __builtin_bswap32(x)
299 # endif
300 #endif
301 
302 #ifndef swap32
303 # define swap32(x) ((uint32_t)((((x)&0xFF)<<24) \
304  |(((x)>>24)&0xFF) \
305  |(((x)&0x0000FF00)<<8) \
306  |(((x)&0x00FF0000)>>8) ))
307 #endif
308 
309 #ifndef swap64
310 # ifdef HAVE_BUILTIN___BUILTIN_BSWAP64
311 # define swap64(x) __builtin_bswap64(x)
312 # endif
313 #endif
314 
315 #ifndef swap64
316 # ifdef HAVE_INT64_T
317 # define byte_in_64bit(n) ((uint64_t)0xff << (n))
318 # define swap64(x) ((uint64_t)((((x)&byte_in_64bit(0))<<56) \
319  |(((x)>>56)&0xFF) \
320  |(((x)&byte_in_64bit(8))<<40) \
321  |(((x)&byte_in_64bit(48))>>40) \
322  |(((x)&byte_in_64bit(16))<<24) \
323  |(((x)&byte_in_64bit(40))>>24) \
324  |(((x)&byte_in_64bit(24))<<8) \
325  |(((x)&byte_in_64bit(32))>>8)))
326 # endif
327 #endif
328 
329 static inline unsigned int
330 nlz_int(unsigned int x)
331 {
332 #if defined(HAVE_BUILTIN___BUILTIN_CLZ)
333  if (x == 0) return SIZEOF_INT * CHAR_BIT;
334  return (unsigned int)__builtin_clz(x);
335 #else
336  unsigned int y;
337 # if 64 < SIZEOF_INT * CHAR_BIT
338  unsigned int n = 128;
339 # elif 32 < SIZEOF_INT * CHAR_BIT
340  unsigned int n = 64;
341 # else
342  unsigned int n = 32;
343 # endif
344 # if 64 < SIZEOF_INT * CHAR_BIT
345  y = x >> 64; if (y) {n -= 64; x = y;}
346 # endif
347 # if 32 < SIZEOF_INT * CHAR_BIT
348  y = x >> 32; if (y) {n -= 32; x = y;}
349 # endif
350  y = x >> 16; if (y) {n -= 16; x = y;}
351  y = x >> 8; if (y) {n -= 8; x = y;}
352  y = x >> 4; if (y) {n -= 4; x = y;}
353  y = x >> 2; if (y) {n -= 2; x = y;}
354  y = x >> 1; if (y) {return n - 2;}
355  return (unsigned int)(n - x);
356 #endif
357 }
358 
359 static inline unsigned int
360 nlz_long(unsigned long x)
361 {
362 #if defined(HAVE_BUILTIN___BUILTIN_CLZL)
363  if (x == 0) return SIZEOF_LONG * CHAR_BIT;
364  return (unsigned int)__builtin_clzl(x);
365 #else
366  unsigned long y;
367 # if 64 < SIZEOF_LONG * CHAR_BIT
368  unsigned int n = 128;
369 # elif 32 < SIZEOF_LONG * CHAR_BIT
370  unsigned int n = 64;
371 # else
372  unsigned int n = 32;
373 # endif
374 # if 64 < SIZEOF_LONG * CHAR_BIT
375  y = x >> 64; if (y) {n -= 64; x = y;}
376 # endif
377 # if 32 < SIZEOF_LONG * CHAR_BIT
378  y = x >> 32; if (y) {n -= 32; x = y;}
379 # endif
380  y = x >> 16; if (y) {n -= 16; x = y;}
381  y = x >> 8; if (y) {n -= 8; x = y;}
382  y = x >> 4; if (y) {n -= 4; x = y;}
383  y = x >> 2; if (y) {n -= 2; x = y;}
384  y = x >> 1; if (y) {return n - 2;}
385  return (unsigned int)(n - x);
386 #endif
387 }
388 
389 #ifdef HAVE_LONG_LONG
390 static inline unsigned int
391 nlz_long_long(unsigned LONG_LONG x)
392 {
393 #if defined(HAVE_BUILTIN___BUILTIN_CLZLL)
394  if (x == 0) return SIZEOF_LONG_LONG * CHAR_BIT;
395  return (unsigned int)__builtin_clzll(x);
396 #else
397  unsigned LONG_LONG y;
398 # if 64 < SIZEOF_LONG_LONG * CHAR_BIT
399  unsigned int n = 128;
400 # elif 32 < SIZEOF_LONG_LONG * CHAR_BIT
401  unsigned int n = 64;
402 # else
403  unsigned int n = 32;
404 # endif
405 # if 64 < SIZEOF_LONG_LONG * CHAR_BIT
406  y = x >> 64; if (y) {n -= 64; x = y;}
407 # endif
408 # if 32 < SIZEOF_LONG_LONG * CHAR_BIT
409  y = x >> 32; if (y) {n -= 32; x = y;}
410 # endif
411  y = x >> 16; if (y) {n -= 16; x = y;}
412  y = x >> 8; if (y) {n -= 8; x = y;}
413  y = x >> 4; if (y) {n -= 4; x = y;}
414  y = x >> 2; if (y) {n -= 2; x = y;}
415  y = x >> 1; if (y) {return n - 2;}
416  return (unsigned int)(n - x);
417 #endif
418 }
419 #endif
420 
421 #ifdef HAVE_UINT128_T
422 static inline unsigned int
423 nlz_int128(uint128_t x)
424 {
425  uint128_t y;
426  unsigned int n = 128;
427  y = x >> 64; if (y) {n -= 64; x = y;}
428  y = x >> 32; if (y) {n -= 32; x = y;}
429  y = x >> 16; if (y) {n -= 16; x = y;}
430  y = x >> 8; if (y) {n -= 8; x = y;}
431  y = x >> 4; if (y) {n -= 4; x = y;}
432  y = x >> 2; if (y) {n -= 2; x = y;}
433  y = x >> 1; if (y) {return n - 2;}
434  return (unsigned int)(n - x);
435 }
436 #endif
437 
438 static inline unsigned int
439 nlz_intptr(uintptr_t x)
440 {
441 #if SIZEOF_UINTPTR_T == SIZEOF_INT
442  return nlz_int(x);
443 #elif SIZEOF_UINTPTR_T == SIZEOF_LONG
444  return nlz_long(x);
445 #elif SIZEOF_UINTPTR_T == SIZEOF_LONG_LONG
446  return nlz_long_long(x);
447 #else
448  #error no known integer type corresponds uintptr_t
449  return /* sane compiler */ ~0;
450 #endif
451 }
452 
453 static inline unsigned int
454 rb_popcount32(uint32_t x)
455 {
456 #ifdef HAVE_BUILTIN___BUILTIN_POPCOUNT
457  return (unsigned int)__builtin_popcount(x);
458 #else
459  x = (x & 0x55555555) + (x >> 1 & 0x55555555);
460  x = (x & 0x33333333) + (x >> 2 & 0x33333333);
461  x = (x & 0x0f0f0f0f) + (x >> 4 & 0x0f0f0f0f);
462  x = (x & 0x001f001f) + (x >> 8 & 0x001f001f);
463  return (x & 0x0000003f) + (x >>16 & 0x0000003f);
464 #endif
465 }
466 
467 static inline int
468 rb_popcount64(uint64_t x)
469 {
470 #ifdef HAVE_BUILTIN___BUILTIN_POPCOUNT
471  return __builtin_popcountll(x);
472 #else
473  x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555);
474  x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333);
475  x = (x & 0x0707070707070707) + (x >> 4 & 0x0707070707070707);
476  x = (x & 0x001f001f001f001f) + (x >> 8 & 0x001f001f001f001f);
477  x = (x & 0x0000003f0000003f) + (x >>16 & 0x0000003f0000003f);
478  return (x & 0x7f) + (x >>32 & 0x7f);
479 #endif
480 }
481 
482 static inline int
483 rb_popcount_intptr(uintptr_t x)
484 {
485 #if SIZEOF_VOIDP == 8
486  return rb_popcount64(x);
487 #elif SIZEOF_VOIDP == 4
488  return rb_popcount32(x);
489 #endif
490 }
491 
492 static inline int
493 ntz_int32(uint32_t x)
494 {
495 #ifdef HAVE_BUILTIN___BUILTIN_CTZ
496  return __builtin_ctz(x);
497 #else
498  return rb_popcount32((~x) & (x-1));
499 #endif
500 }
501 
502 static inline int
503 ntz_int64(uint64_t x)
504 {
505 #ifdef HAVE_BUILTIN___BUILTIN_CTZLL
506  return __builtin_ctzll(x);
507 #else
508  return rb_popcount64((~x) & (x-1));
509 #endif
510 }
511 
512 static inline int
513 ntz_intptr(uintptr_t x)
514 {
515 #if SIZEOF_VOIDP == 8
516  return ntz_int64(x);
517 #elif SIZEOF_VOIDP == 4
518  return ntz_int32(x);
519 #endif
520 }
521 
522 #if HAVE_LONG_LONG && SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG
523 # define DLONG LONG_LONG
524 # define DL2NUM(x) LL2NUM(x)
525 #elif defined(HAVE_INT128_T)
526 # define DLONG int128_t
527 # define DL2NUM(x) (RB_FIXABLE(x) ? LONG2FIX(x) : rb_int128t2big(x))
529 #endif
530 
531 static inline long
532 rb_overflowed_fix_to_int(long x)
533 {
534  return (long)((unsigned long)(x >> 1) ^ (1LU << (SIZEOF_LONG * CHAR_BIT - 1)));
535 }
536 
537 static inline VALUE
538 rb_fix_plus_fix(VALUE x, VALUE y)
539 {
540 #ifdef HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW
541  long lz;
542  /* NOTE
543  * (1) `LONG2FIX(FIX2LONG(x)+FIX2LONG(y))`
544  + = `((lx*2+1)/2 + (ly*2+1)/2)*2+1`
545  + = `lx*2 + ly*2 + 1`
546  + = `(lx*2+1) + (ly*2+1) - 1`
547  + = `x + y - 1`
548  * (2) Fixnum's LSB is always 1.
549  * It means you can always run `x - 1` without overflow.
550  * (3) Of course `z = x + (y-1)` may overflow.
551  * At that time true value is
552  * * positive: 0b0 1xxx...1, and z = 0b1xxx...1
553  * * nevative: 0b1 0xxx...1, and z = 0b0xxx...1
554  * To convert this true value to long,
555  * (a) Use arithmetic shift
556  * * positive: 0b11xxx...
557  * * negative: 0b00xxx...
558  * (b) invert MSB
559  * * positive: 0b01xxx...
560  * * negative: 0b10xxx...
561  */
562  if (__builtin_add_overflow((long)x, (long)y-1, &lz)) {
563  return rb_int2big(rb_overflowed_fix_to_int(lz));
564  }
565  else {
566  return (VALUE)lz;
567  }
568 #else
569  long lz = FIX2LONG(x) + FIX2LONG(y);
570  return LONG2NUM(lz);
571 #endif
572 }
573 
574 static inline VALUE
575 rb_fix_minus_fix(VALUE x, VALUE y)
576 {
577 #ifdef HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW
578  long lz;
579  if (__builtin_sub_overflow((long)x, (long)y-1, &lz)) {
580  return rb_int2big(rb_overflowed_fix_to_int(lz));
581  }
582  else {
583  return (VALUE)lz;
584  }
585 #else
586  long lz = FIX2LONG(x) - FIX2LONG(y);
587  return LONG2NUM(lz);
588 #endif
589 }
590 
591 /* arguments must be Fixnum */
592 static inline VALUE
593 rb_fix_mul_fix(VALUE x, VALUE y)
594 {
595  long lx = FIX2LONG(x);
596  long ly = FIX2LONG(y);
597 #ifdef DLONG
598  return DL2NUM((DLONG)lx * (DLONG)ly);
599 #else
600  if (MUL_OVERFLOW_FIXNUM_P(lx, ly)) {
601  return rb_big_mul(rb_int2big(lx), rb_int2big(ly));
602  }
603  else {
604  return LONG2FIX(lx * ly);
605  }
606 #endif
607 }
608 
609 /*
610  * This behaves different from C99 for negative arguments.
611  * Note that div may overflow fixnum.
612  */
613 static inline void
614 rb_fix_divmod_fix(VALUE a, VALUE b, VALUE *divp, VALUE *modp)
615 {
616  /* assume / and % comply C99.
617  * ldiv(3) won't be inlined by GCC and clang.
618  * I expect / and % are compiled as single idiv.
619  */
620  long x = FIX2LONG(a);
621  long y = FIX2LONG(b);
622  long div, mod;
623  if (x == FIXNUM_MIN && y == -1) {
624  if (divp) *divp = LONG2NUM(-FIXNUM_MIN);
625  if (modp) *modp = LONG2FIX(0);
626  return;
627  }
628  div = x / y;
629  mod = x % y;
630  if (y > 0 ? mod < 0 : mod > 0) {
631  mod += y;
632  div -= 1;
633  }
634  if (divp) *divp = LONG2FIX(div);
635  if (modp) *modp = LONG2FIX(mod);
636 }
637 
638 /* div() for Ruby
639  * This behaves different from C99 for negative arguments.
640  */
641 static inline VALUE
642 rb_fix_div_fix(VALUE x, VALUE y)
643 {
644  VALUE div;
645  rb_fix_divmod_fix(x, y, &div, NULL);
646  return div;
647 }
648 
649 /* mod() for Ruby
650  * This behaves different from C99 for negative arguments.
651  */
652 static inline VALUE
653 rb_fix_mod_fix(VALUE x, VALUE y)
654 {
655  VALUE mod;
656  rb_fix_divmod_fix(x, y, NULL, &mod);
657  return mod;
658 }
659 
660 #if defined(HAVE_UINT128_T) && defined(HAVE_LONG_LONG)
661 # define bit_length(x) \
662  (unsigned int) \
663  (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
664  sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
665  sizeof(x) <= SIZEOF_LONG_LONG ? SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)(x)) : \
666  SIZEOF_INT128_T * CHAR_BIT - nlz_int128((uint128_t)(x)))
667 #elif defined(HAVE_UINT128_T)
668 # define bit_length(x) \
669  (unsigned int) \
670  (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
671  sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
672  SIZEOF_INT128_T * CHAR_BIT - nlz_int128((uint128_t)(x)))
673 #elif defined(HAVE_LONG_LONG)
674 # define bit_length(x) \
675  (unsigned int) \
676  (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
677  sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
678  SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)(x)))
679 #else
680 # define bit_length(x) \
681  (unsigned int) \
682  (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
683  SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)))
684 #endif
685 
686 #ifndef BDIGIT
687 # if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
688 # define BDIGIT unsigned int
689 # define SIZEOF_BDIGIT SIZEOF_INT
690 # define BDIGIT_DBL unsigned LONG_LONG
691 # define BDIGIT_DBL_SIGNED LONG_LONG
692 # define PRI_BDIGIT_PREFIX ""
693 # define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX
694 # elif SIZEOF_INT*2 <= SIZEOF_LONG
695 # define BDIGIT unsigned int
696 # define SIZEOF_BDIGIT SIZEOF_INT
697 # define BDIGIT_DBL unsigned long
698 # define BDIGIT_DBL_SIGNED long
699 # define PRI_BDIGIT_PREFIX ""
700 # define PRI_BDIGIT_DBL_PREFIX "l"
701 # elif SIZEOF_SHORT*2 <= SIZEOF_LONG
702 # define BDIGIT unsigned short
703 # define SIZEOF_BDIGIT SIZEOF_SHORT
704 # define BDIGIT_DBL unsigned long
705 # define BDIGIT_DBL_SIGNED long
706 # define PRI_BDIGIT_PREFIX "h"
707 # define PRI_BDIGIT_DBL_PREFIX "l"
708 # else
709 # define BDIGIT unsigned short
710 # define SIZEOF_BDIGIT (SIZEOF_LONG/2)
711 # define SIZEOF_ACTUAL_BDIGIT SIZEOF_LONG
712 # define BDIGIT_DBL unsigned long
713 # define BDIGIT_DBL_SIGNED long
714 # define PRI_BDIGIT_PREFIX "h"
715 # define PRI_BDIGIT_DBL_PREFIX "l"
716 # endif
717 #endif
718 #ifndef SIZEOF_ACTUAL_BDIGIT
719 # define SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGIT
720 #endif
721 
722 #ifdef PRI_BDIGIT_PREFIX
723 # define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
724 # define PRIiBDIGIT PRI_BDIGIT_PREFIX"i"
725 # define PRIoBDIGIT PRI_BDIGIT_PREFIX"o"
726 # define PRIuBDIGIT PRI_BDIGIT_PREFIX"u"
727 # define PRIxBDIGIT PRI_BDIGIT_PREFIX"x"
728 # define PRIXBDIGIT PRI_BDIGIT_PREFIX"X"
729 #endif
730 
731 #ifdef PRI_BDIGIT_DBL_PREFIX
732 # define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d"
733 # define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i"
734 # define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o"
735 # define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u"
736 # define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x"
737 # define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X"
738 #endif
739 
740 #define BIGNUM_EMBED_LEN_NUMBITS 3
741 #ifndef BIGNUM_EMBED_LEN_MAX
742 # if (SIZEOF_VALUE*RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT) < (1 << BIGNUM_EMBED_LEN_NUMBITS)-1
743 # define BIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT)
744 # else
745 # define BIGNUM_EMBED_LEN_MAX ((1 << BIGNUM_EMBED_LEN_NUMBITS)-1)
746 # endif
747 #endif
748 
749 struct RBignum {
750  struct RBasic basic;
751  union {
752  struct {
753  size_t len;
755  } heap;
757  } as;
758 };
759 #define BIGNUM_SIGN_BIT ((VALUE)FL_USER1)
760 /* sign: positive:1, negative:0 */
761 #define BIGNUM_SIGN(b) ((RBASIC(b)->flags & BIGNUM_SIGN_BIT) != 0)
762 #define BIGNUM_SET_SIGN(b,sign) \
763  ((sign) ? (RBASIC(b)->flags |= BIGNUM_SIGN_BIT) \
764  : (RBASIC(b)->flags &= ~BIGNUM_SIGN_BIT))
765 #define BIGNUM_POSITIVE_P(b) BIGNUM_SIGN(b)
766 #define BIGNUM_NEGATIVE_P(b) (!BIGNUM_SIGN(b))
767 #define BIGNUM_NEGATE(b) (RBASIC(b)->flags ^= BIGNUM_SIGN_BIT)
768 
769 #define BIGNUM_EMBED_FLAG ((VALUE)FL_USER2)
770 #define BIGNUM_EMBED_LEN_MASK \
771  (~(~(VALUE)0U << BIGNUM_EMBED_LEN_NUMBITS) << BIGNUM_EMBED_LEN_SHIFT)
772 #define BIGNUM_EMBED_LEN_SHIFT \
773  (FL_USHIFT+3) /* bit offset of BIGNUM_EMBED_LEN_MASK */
774 #define BIGNUM_LEN(b) \
775  ((RBASIC(b)->flags & BIGNUM_EMBED_FLAG) ? \
776  (size_t)((RBASIC(b)->flags >> BIGNUM_EMBED_LEN_SHIFT) & \
777  (BIGNUM_EMBED_LEN_MASK >> BIGNUM_EMBED_LEN_SHIFT)) : \
778  RBIGNUM(b)->as.heap.len)
779 /* LSB:BIGNUM_DIGITS(b)[0], MSB:BIGNUM_DIGITS(b)[BIGNUM_LEN(b)-1] */
780 #define BIGNUM_DIGITS(b) \
781  ((RBASIC(b)->flags & BIGNUM_EMBED_FLAG) ? \
782  RBIGNUM(b)->as.ary : \
783  RBIGNUM(b)->as.heap.digits)
784 #define BIGNUM_LENINT(b) rb_long2int(BIGNUM_LEN(b))
785 
786 #define RBIGNUM(obj) (R_CAST(RBignum)(obj))
787 
788 struct RRational {
789  struct RBasic basic;
792 };
793 
794 #define RRATIONAL(obj) (R_CAST(RRational)(obj))
795 #define RRATIONAL_SET_NUM(rat, n) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->num,(n))
796 #define RRATIONAL_SET_DEN(rat, d) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->den,(d))
797 
798 struct RFloat {
799  struct RBasic basic;
800  double float_value;
801 };
802 
803 #define RFLOAT(obj) (R_CAST(RFloat)(obj))
804 
805 struct RComplex {
806  struct RBasic basic;
809 };
810 
811 #define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
812 
813 /* shortcut macro for internal only */
814 #define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->real,(r))
815 #define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->imag,(i))
816 
821 #define RHASH_AR_TABLE_MAX_SIZE SIZEOF_VALUE
826 
827  // we can not put it in "enum" because it can exceed "int" range.
828 #define RHASH_LEV_MASK (FL_USER13 | FL_USER14 | FL_USER15 | /* FL 13..19 */ \
829  FL_USER16 | FL_USER17 | FL_USER18 | FL_USER19)
830 
831 #if USE_TRANSIENT_HEAP
833 #endif
834 
836  RHASH_LEV_MAX = 127, /* 7 bits */
837 
839 };
840 
841 #define RHASH_AR_TABLE_SIZE_RAW(h) \
842  ((unsigned int)((RBASIC(h)->flags & RHASH_AR_TABLE_SIZE_MASK) >> RHASH_AR_TABLE_SIZE_SHIFT))
843 
845 
846 #if 0 /* for debug */
847 int rb_hash_ar_table_p(VALUE hash);
850 #define RHASH_AR_TABLE_P(hash) rb_hash_ar_table_p(hash)
851 #define RHASH_AR_TABLE(h) rb_hash_ar_table(h)
852 #define RHASH_ST_TABLE(h) rb_hash_st_table(h)
853 #else
854 #define RHASH_AR_TABLE_P(hash) (!FL_TEST_RAW((hash), RHASH_ST_TABLE_FLAG))
855 #define RHASH_AR_TABLE(hash) (RHASH(hash)->as.ar)
856 #define RHASH_ST_TABLE(hash) (RHASH(hash)->as.st)
857 #endif
858 
859 #define RHASH(obj) (R_CAST(RHash)(obj))
860 #define RHASH_ST_SIZE(h) (RHASH_ST_TABLE(h)->num_entries)
861 #define RHASH_ST_TABLE_P(h) (!RHASH_AR_TABLE_P(h))
862 #define RHASH_ST_CLEAR(h) (FL_UNSET_RAW(h, RHASH_ST_TABLE_FLAG), RHASH(h)->as.ar = NULL)
863 
864 #define RHASH_AR_TABLE_SIZE_MASK (VALUE)RHASH_AR_TABLE_SIZE_MASK
865 #define RHASH_AR_TABLE_SIZE_SHIFT RHASH_AR_TABLE_SIZE_SHIFT
866 #define RHASH_AR_TABLE_BOUND_MASK (VALUE)RHASH_AR_TABLE_BOUND_MASK
867 #define RHASH_AR_TABLE_BOUND_SHIFT RHASH_AR_TABLE_BOUND_SHIFT
868 
869 #if USE_TRANSIENT_HEAP
870 #define RHASH_TRANSIENT_P(hash) FL_TEST_RAW((hash), RHASH_TRANSIENT_FLAG)
871 #define RHASH_SET_TRANSIENT_FLAG(h) FL_SET_RAW(h, RHASH_TRANSIENT_FLAG)
872 #define RHASH_UNSET_TRANSIENT_FLAG(h) FL_UNSET_RAW(h, RHASH_TRANSIENT_FLAG)
873 #else
874 #define RHASH_TRANSIENT_P(hash) 0
875 #define RHASH_SET_TRANSIENT_FLAG(h) ((void)0)
876 #define RHASH_UNSET_TRANSIENT_FLAG(h) ((void)0)
877 #endif
878 
879 #if SIZEOF_VALUE / RHASH_AR_TABLE_MAX_SIZE == 2
880 typedef uint16_t ar_hint_t;
881 #elif SIZEOF_VALUE / RHASH_AR_TABLE_MAX_SIZE == 1
882 typedef unsigned char ar_hint_t;
883 #else
884 #error unsupported
885 #endif
886 
887 struct RHash {
888  struct RBasic basic;
889  union {
891  struct ar_table_struct *ar; /* possibly 0 */
892  } as;
893  const VALUE ifnone;
894  union {
897  } ar_hint;
898 };
899 
900 #ifdef RHASH_IFNONE
901 # undef RHASH_IFNONE
902 # undef RHASH_SIZE
903 
904 # define RHASH_IFNONE(h) (RHASH(h)->ifnone)
905 # define RHASH_SIZE(h) (RHASH_AR_TABLE_P(h) ? RHASH_AR_TABLE_SIZE_RAW(h) : RHASH_ST_SIZE(h))
906 #endif /* ifdef RHASH_IFNONE */
907 
908 struct RMoved {
912 };
913 
914 /* missing/setproctitle.c */
915 #ifndef HAVE_SETPROCTITLE
916 extern void ruby_init_setproctitle(int argc, char *argv[]);
917 #endif
918 
919 #define RSTRUCT_EMBED_LEN_MAX RSTRUCT_EMBED_LEN_MAX
920 #define RSTRUCT_EMBED_LEN_MASK RSTRUCT_EMBED_LEN_MASK
921 #define RSTRUCT_EMBED_LEN_SHIFT RSTRUCT_EMBED_LEN_SHIFT
922 
923 enum {
925  RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1),
928 
930 };
931 
932 #if USE_TRANSIENT_HEAP
933 #define RSTRUCT_TRANSIENT_P(st) FL_TEST_RAW((obj), RSTRUCT_TRANSIENT_FLAG)
934 #define RSTRUCT_TRANSIENT_SET(st) FL_SET_RAW((st), RSTRUCT_TRANSIENT_FLAG)
935 #define RSTRUCT_TRANSIENT_UNSET(st) FL_UNSET_RAW((st), RSTRUCT_TRANSIENT_FLAG)
936 #else
937 #define RSTRUCT_TRANSIENT_P(st) 0
938 #define RSTRUCT_TRANSIENT_SET(st) ((void)0)
939 #define RSTRUCT_TRANSIENT_UNSET(st) ((void)0)
940 #endif
941 
942 struct RStruct {
943  struct RBasic basic;
944  union {
945  struct {
946  long len;
947  const VALUE *ptr;
948  } heap;
950  } as;
951 };
952 
953 #undef RSTRUCT_LEN
954 #undef RSTRUCT_PTR
955 #undef RSTRUCT_SET
956 #undef RSTRUCT_GET
957 #define RSTRUCT_EMBED_LEN(st) \
958  (long)((RBASIC(st)->flags >> RSTRUCT_EMBED_LEN_SHIFT) & \
959  (RSTRUCT_EMBED_LEN_MASK >> RSTRUCT_EMBED_LEN_SHIFT))
960 #define RSTRUCT_LEN(st) rb_struct_len(st)
961 #define RSTRUCT_LENINT(st) rb_long2int(RSTRUCT_LEN(st))
962 #define RSTRUCT_CONST_PTR(st) rb_struct_const_ptr(st)
963 #define RSTRUCT_PTR(st) ((VALUE *)RSTRUCT_CONST_PTR(RB_OBJ_WB_UNPROTECT_FOR(STRUCT, st)))
964 #define RSTRUCT_SET(st, idx, v) RB_OBJ_WRITE(st, &RSTRUCT_CONST_PTR(st)[idx], (v))
965 #define RSTRUCT_GET(st, idx) (RSTRUCT_CONST_PTR(st)[idx])
966 #define RSTRUCT(obj) (R_CAST(RStruct)(obj))
967 
968 static inline long
969 rb_struct_len(VALUE st)
970 {
971  return (RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ?
972  RSTRUCT_EMBED_LEN(st) : RSTRUCT(st)->as.heap.len;
973 }
974 
975 static inline const VALUE *
976 rb_struct_const_ptr(VALUE st)
977 {
979  RSTRUCT(st)->as.ary : RSTRUCT(st)->as.heap.ptr);
980 }
981 
982 static inline const VALUE *
983 rb_struct_const_heap_ptr(VALUE st)
984 {
985  /* TODO: check embed on debug mode */
986  return RSTRUCT(st)->as.heap.ptr;
987 }
988 
989 /* class.c */
990 
992  char conflict[sizeof(VALUE) * 3];
993 };
994 
995 struct rb_subclass_entry;
997 
1001 };
1002 
1003 #if defined(HAVE_LONG_LONG)
1004 typedef unsigned LONG_LONG rb_serial_t;
1005 #define SERIALT2NUM ULL2NUM
1006 #define PRI_SERIALT_PREFIX PRI_LL_PREFIX
1007 #define SIZEOF_SERIAL_T SIZEOF_LONG_LONG
1008 #elif defined(HAVE_UINT64_T)
1009 typedef uint64_t rb_serial_t;
1010 #define SERIALT2NUM SIZET2NUM
1011 #define PRI_SERIALT_PREFIX PRI_64_PREFIX
1012 #define SIZEOF_SERIAL_T SIZEOF_UINT64_T
1013 #else
1014 typedef unsigned long rb_serial_t;
1015 #define SERIALT2NUM ULONG2NUM
1016 #define PRI_SERIALT_PREFIX PRI_LONG_PREFIX
1017 #define SIZEOF_SERIAL_T SIZEOF_LONG
1018 #endif
1019 
1022  struct st_table *iv_tbl;
1023 #if SIZEOF_SERIAL_T == SIZEOF_VALUE /* otherwise m_tbl is in struct RClass */
1025 #endif
1036 #if SIZEOF_SERIAL_T != SIZEOF_VALUE /* otherwise class_serial is in struct RClass */
1037  rb_serial_t class_serial;
1038 #endif
1043 };
1044 
1046 
1047 #undef RClass
1048 struct RClass {
1049  struct RBasic basic;
1052 #if SIZEOF_SERIAL_T == SIZEOF_VALUE
1053  /* Class serial is as wide as VALUE. Place it here. */
1055 #else
1056  /* Class serial does not fit into struct RClass. Place m_tbl instead. */
1057  struct rb_id_table *m_tbl;
1058 #endif
1059 };
1060 
1061 void rb_class_subclass_add(VALUE super, VALUE klass);
1064 
1065 #define RCLASS_EXT(c) (RCLASS(c)->ptr)
1066 #define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
1067 #define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
1068 #if SIZEOF_SERIAL_T == SIZEOF_VALUE
1069 # define RCLASS_M_TBL(c) (RCLASS_EXT(c)->m_tbl)
1070 #else
1071 # define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
1072 #endif
1073 #define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_tbl)
1074 #define RCLASS_IV_INDEX_TBL(c) (RCLASS_EXT(c)->iv_index_tbl)
1075 #define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin_)
1076 #define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
1077 #if SIZEOF_SERIAL_T == SIZEOF_VALUE
1078 # define RCLASS_SERIAL(c) (RCLASS(c)->class_serial)
1079 #else
1080 # define RCLASS_SERIAL(c) (RCLASS_EXT(c)->class_serial)
1081 #endif
1082 #define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer)
1083 
1084 #define RCLASS_CLONED FL_USER6
1085 #define RICLASS_IS_ORIGIN FL_USER5
1086 #define RCLASS_REFINED_BY_ANY FL_USER7
1087 
1088 static inline void
1089 RCLASS_SET_ORIGIN(VALUE klass, VALUE origin)
1090 {
1091  RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin);
1092  if (klass != origin) FL_SET(origin, RICLASS_IS_ORIGIN);
1093 }
1094 
1095 static inline void
1096 RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass)
1097 {
1098  RB_OBJ_WRITE(iclass, &RCLASS_INCLUDER(iclass), klass);
1099 }
1100 
1101 #undef RCLASS_SUPER
1102 static inline VALUE
1104 {
1105  return RCLASS(klass)->super;
1106 }
1107 
1108 static inline VALUE
1109 RCLASS_SET_SUPER(VALUE klass, VALUE super)
1110 {
1111  if (super) {
1113  rb_class_subclass_add(super, klass);
1114  }
1115  RB_OBJ_WRITE(klass, &RCLASS(klass)->super, super);
1116  return super;
1117 }
1118 /* IMEMO: Internal memo object */
1119 
1120 #ifndef IMEMO_DEBUG
1121 #define IMEMO_DEBUG 0
1122 #endif
1123 
1124 struct RIMemo {
1130 };
1131 
1144 };
1145 #define IMEMO_MASK 0x0f
1146 
1147 static inline enum imemo_type
1149 {
1150  return (RBASIC(imemo)->flags >> FL_USHIFT) & IMEMO_MASK;
1151 }
1152 
1153 static inline int
1154 imemo_type_p(VALUE imemo, enum imemo_type imemo_type)
1155 {
1156  if (LIKELY(!RB_SPECIAL_CONST_P(imemo))) {
1157  /* fixed at compile time if imemo_type is given. */
1158  const VALUE mask = (IMEMO_MASK << FL_USHIFT) | RUBY_T_MASK;
1159  const VALUE expected_type = (imemo_type << FL_USHIFT) | T_IMEMO;
1160  /* fixed at runtime. */
1161  return expected_type == (RBASIC(imemo)->flags & mask);
1162  }
1163  else {
1164  return 0;
1165  }
1166 }
1167 
1168 VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0);
1169 
1170 /* FL_USER0 to FL_USER3 is for type */
1171 #define IMEMO_FL_USHIFT (FL_USHIFT + 4)
1172 #define IMEMO_FL_USER0 FL_USER4
1173 #define IMEMO_FL_USER1 FL_USER5
1174 #define IMEMO_FL_USER2 FL_USER6
1175 #define IMEMO_FL_USER3 FL_USER7
1176 #define IMEMO_FL_USER4 FL_USER8
1177 
1178 /* CREF (Class REFerence) is defined in method.h */
1179 
1181 struct vm_svar {
1186  const VALUE others;
1187 };
1188 
1189 
1190 #define THROW_DATA_CONSUMED IMEMO_FL_USER0
1191 
1199 };
1200 
1201 #define THROW_DATA_P(err) RB_TYPE_P((VALUE)(err), T_IMEMO)
1202 
1203 /* IFUNC (Internal FUNCtion) */
1204 
1206 #if SIZEOF_INT * 2 > SIZEOF_VALUE
1207  signed int min: (SIZEOF_VALUE * CHAR_BIT) / 2;
1208  signed int max: (SIZEOF_VALUE * CHAR_BIT) / 2;
1209 #else
1210  int min, max;
1211 #endif
1212 };
1213 
1215 struct vm_ifunc {
1219  const void *data;
1221 };
1222 
1223 #define IFUNC_NEW(a, b, c) ((struct vm_ifunc *)rb_imemo_new(imemo_ifunc, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0))
1224 struct vm_ifunc *rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc);
1225 static inline struct vm_ifunc *
1226 rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data)
1227 {
1229 }
1230 
1231 typedef struct rb_imemo_tmpbuf_struct {
1234  VALUE *ptr; /* malloc'ed buffer */
1235  struct rb_imemo_tmpbuf_struct *next; /* next imemo */
1236  size_t cnt; /* buffer size in VALUE */
1238 
1239 #define rb_imemo_tmpbuf_auto_free_pointer() rb_imemo_new(imemo_tmpbuf, 0, 0, 0, 0)
1241 
1242 #define RB_IMEMO_TMPBUF_PTR(v) \
1243  ((void *)(((const struct rb_imemo_tmpbuf_struct *)(v))->ptr))
1244 
1245 static inline void *
1246 rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr)
1247 {
1248  return ((rb_imemo_tmpbuf_t *)v)->ptr = ptr;
1249 }
1250 
1251 static inline VALUE
1252 rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str)
1253 {
1254  const void *src;
1255  VALUE imemo;
1256  rb_imemo_tmpbuf_t *tmpbuf;
1257  void *dst;
1258  size_t len;
1259 
1261  /* create tmpbuf to keep the pointer before xmalloc */
1263  tmpbuf = (rb_imemo_tmpbuf_t *)imemo;
1264  len = RSTRING_LEN(str);
1265  src = RSTRING_PTR(str);
1266  dst = ruby_xmalloc(len);
1267  memcpy(dst, src, len);
1268  tmpbuf->ptr = dst;
1269  return imemo;
1270 }
1271 
1272 void rb_strterm_mark(VALUE obj);
1273 
1278 struct MEMO {
1281  const VALUE v1;
1282  const VALUE v2;
1283  union {
1284  long cnt;
1285  long state;
1286  const VALUE value;
1288  } u3;
1289 };
1290 
1291 #define MEMO_V1_SET(m, v) RB_OBJ_WRITE((m), &(m)->v1, (v))
1292 #define MEMO_V2_SET(m, v) RB_OBJ_WRITE((m), &(m)->v2, (v))
1293 
1294 #define MEMO_CAST(m) ((struct MEMO *)m)
1295 
1296 #define MEMO_NEW(a, b, c) ((struct MEMO *)rb_imemo_new(imemo_memo, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0))
1297 
1298 #define roomof(x, y) (((x) + (y) - 1) / (y))
1299 #define type_roomof(x, y) roomof(sizeof(x), sizeof(y))
1300 #define MEMO_FOR(type, value) ((type *)RARRAY_PTR(value))
1301 #define NEW_MEMO_FOR(type, value) \
1302  ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value))
1303 #define NEW_PARTIAL_MEMO_FOR(type, value, member) \
1304  ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), \
1305  rb_ary_set_len((value), offsetof(type, member) / sizeof(VALUE)), \
1306  MEMO_FOR(type, value))
1307 
1308 #define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
1309 
1310 #ifdef RUBY_INTEGER_UNIFICATION
1311 # define rb_cFixnum rb_cInteger
1312 # define rb_cBignum rb_cInteger
1313 #endif
1314 
1315 enum {
1320 };
1321 
1323  unsigned int opt_methods;
1324  unsigned int opt_inited;
1325 };
1326 
1327 #define NEW_CMP_OPT_MEMO(type, value) \
1328  NEW_PARTIAL_MEMO_FOR(type, value, cmp_opt)
1329 #define CMP_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(cmp_opt_,type))
1330 #define CMP_OPTIMIZABLE(data, type) \
1331  (((data).opt_inited & CMP_OPTIMIZABLE_BIT(type)) ? \
1332  ((data).opt_methods & CMP_OPTIMIZABLE_BIT(type)) : \
1333  (((data).opt_inited |= CMP_OPTIMIZABLE_BIT(type)), \
1334  rb_method_basic_definition_p(TOKEN_PASTE(rb_c,type), id_cmp) && \
1335  ((data).opt_methods |= CMP_OPTIMIZABLE_BIT(type))))
1336 
1337 #define OPTIMIZED_CMP(a, b, data) \
1338  ((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data, Fixnum)) ? \
1339  (((long)a > (long)b) ? 1 : ((long)a < (long)b) ? -1 : 0) : \
1340  (STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(data, String)) ? \
1341  rb_str_cmp(a, b) : \
1342  (RB_FLOAT_TYPE_P(a) && RB_FLOAT_TYPE_P(b) && CMP_OPTIMIZABLE(data, Float)) ? \
1343  rb_float_cmp(a, b) : \
1344  rb_cmpint(rb_funcallv(a, id_cmp, 1, &b), a, b))
1345 
1346 /* ment is in method.h */
1347 
1348 /* global variable */
1349 
1353 };
1354 
1359 
1360 /* array.c */
1361 
1362 #ifndef ARRAY_DEBUG
1363 #define ARRAY_DEBUG (0+RUBY_DEBUG)
1364 #endif
1365 
1366 #ifdef ARRAY_DEBUG
1367 #define RARRAY_PTR_IN_USE_FLAG FL_USER14
1368 #define ARY_PTR_USING_P(ary) FL_TEST_RAW((ary), RARRAY_PTR_IN_USE_FLAG)
1369 #else
1370 
1371 /* disable debug function */
1372 #undef RARRAY_PTR_USE_START_TRANSIENT
1373 #undef RARRAY_PTR_USE_END_TRANSIENT
1374 #define RARRAY_PTR_USE_START_TRANSIENT(a) ((VALUE *)RARRAY_CONST_PTR_TRANSIENT(a))
1375 #define RARRAY_PTR_USE_END_TRANSIENT(a)
1376 #define ARY_PTR_USING_P(ary) 0
1377 
1378 #endif
1379 
1380 #if USE_TRANSIENT_HEAP
1381 #define RARY_TRANSIENT_SET(ary) FL_SET_RAW((ary), RARRAY_TRANSIENT_FLAG);
1382 #define RARY_TRANSIENT_UNSET(ary) FL_UNSET_RAW((ary), RARRAY_TRANSIENT_FLAG);
1383 #else
1384 #undef RARRAY_TRANSIENT_P
1385 #define RARRAY_TRANSIENT_P(a) 0
1386 #define RARY_TRANSIENT_SET(ary) ((void)0)
1387 #define RARY_TRANSIENT_UNSET(ary) ((void)0)
1388 #endif
1389 
1390 
1391 VALUE rb_ary_last(int, const VALUE *, VALUE);
1392 void rb_ary_set_len(VALUE, long);
1394 VALUE rb_ary_tmp_new_fill(long capa);
1397 size_t rb_ary_memsize(VALUE);
1401 VALUE rb_ary_behead(VALUE, long);
1402 #if defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO)
1403 #define rb_ary_new_from_args(n, ...) \
1404  __extension__ ({ \
1405  const VALUE args_to_new_ary[] = {__VA_ARGS__}; \
1406  if (__builtin_constant_p(n)) { \
1407  STATIC_ASSERT(rb_ary_new_from_args, numberof(args_to_new_ary) == (n)); \
1408  } \
1409  rb_ary_new_from_values(numberof(args_to_new_ary), args_to_new_ary); \
1410  })
1411 #endif
1412 
1413 static inline VALUE
1414 rb_ary_entry_internal(VALUE ary, long offset)
1415 {
1416  long len = RARRAY_LEN(ary);
1417  const VALUE *ptr = RARRAY_CONST_PTR_TRANSIENT(ary);
1418  if (len == 0) return Qnil;
1419  if (offset < 0) {
1420  offset += len;
1421  if (offset < 0) return Qnil;
1422  }
1423  else if (len <= offset) {
1424  return Qnil;
1425  }
1426  return ptr[offset];
1427 }
1428 
1429 /* MRI debug support */
1430 void rb_obj_info_dump(VALUE obj);
1431 void rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func);
1432 void ruby_debug_breakpoint(void);
1433 
1434 // show obj data structure without any side-effect
1435 #define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, __func__)
1436 
1437 // same as rp, but add message header
1438 #define rp_m(msg, obj) do { \
1439  fprintf(stderr, "%s", (msg)); \
1440  rb_obj_info_dump((VALUE)obj); \
1441 } while (0)
1442 
1443 // `ruby_debug_breakpoint()` does nothing,
1444 // but breakpoint is set in run.gdb, so `make gdb` can stop here.
1445 #define bp() ruby_debug_breakpoint()
1446 
1447 /* bignum.c */
1448 extern const char ruby_digitmap[];
1449 double rb_big_fdiv_double(VALUE x, VALUE y);
1454 size_t rb_big_size(VALUE);
1457 VALUE rb_str_convert_to_inum(VALUE str, int base, int badcheck, int raise_exception);
1464 VALUE rb_big_gt(VALUE x, VALUE y);
1465 VALUE rb_big_ge(VALUE x, VALUE y);
1466 VALUE rb_big_lt(VALUE x, VALUE y);
1467 VALUE rb_big_le(VALUE x, VALUE y);
1468 VALUE rb_int_powm(int const argc, VALUE * const argv, VALUE const num);
1469 
1470 /* class.c */
1479 VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj);
1486 void Init_class_hierarchy(void);
1487 
1489 void rb_undef_methods_from(VALUE klass, VALUE super);
1490 
1491 /* compar.c */
1493 
1494 /* compile.c */
1495 struct rb_block;
1496 struct rb_iseq_struct;
1497 int rb_dvar_defined(ID, const struct rb_iseq_struct *);
1498 int rb_local_defined(ID, const struct rb_iseq_struct *);
1499 const char * rb_insns_name(int i);
1501 int rb_vm_insn_addr2insn(const void *);
1502 
1503 /* complex.c */
1504 VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);
1505 
1506 struct rb_thread_struct;
1507 /* cont.c */
1508 struct rb_fiber_struct;
1511 void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(VALUE), VALUE (*rollback_func)(VALUE));
1512 void rb_fiber_init_mjit_cont(struct rb_fiber_struct *fiber);
1513 
1514 /* debug.c */
1515 PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
1516 
1517 /* dir.c */
1519 
1520 /* dmyext.c */
1521 void Init_enc(void);
1522 void Init_ext(void);
1523 
1524 /* encoding.c */
1525 ID rb_id_encoding(void);
1526 #ifdef RUBY_ENCODING_H
1529 #endif
1530 int rb_encdb_replicate(const char *alias, const char *orig);
1531 int rb_encdb_alias(const char *alias, const char *orig);
1532 int rb_encdb_dummy(const char *name);
1533 void rb_encdb_declare(const char *name);
1534 void rb_enc_set_base(const char *name, const char *orig);
1535 int rb_enc_set_dummy(int index);
1536 void rb_encdb_set_unicode(int index);
1538 
1539 /* enum.c */
1540 extern VALUE rb_cArithSeq;
1541 VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
1542 VALUE rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary);
1543 
1544 /* error.c */
1545 extern VALUE rb_eEAGAIN;
1546 extern VALUE rb_eEWOULDBLOCK;
1547 extern VALUE rb_eEINPROGRESS;
1548 void rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args);
1549 NORETURN(void rb_async_bug_errno(const char *,int));
1550 const char *rb_builtin_type_name(int t);
1551 const char *rb_builtin_class_name(VALUE x);
1552 PRINTF_ARGS(void rb_warn_deprecated(const char *fmt, const char *suggest, ...), 1, 3);
1553 #ifdef RUBY_ENCODING_H
1554 VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list);
1555 PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);
1556 PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
1557 PRINTF_ARGS(void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...), 3, 4);
1558 #endif
1559 
1560 typedef enum {
1567 
1568 #define rb_raise_cstr(etype, mesg) \
1569  rb_exc_raise(rb_exc_new_str(etype, rb_str_new_cstr(mesg)))
1570 #define rb_raise_static(etype, mesg) \
1571  rb_exc_raise(rb_exc_new_str(etype, rb_str_new_static(mesg, rb_strlen_lit(mesg))))
1572 
1573 VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method);
1574 #define rb_name_err_raise_str(mesg, recv, name) \
1575  rb_exc_raise(rb_name_err_new(mesg, recv, name))
1576 #define rb_name_err_raise(mesg, recv, name) \
1577  rb_name_err_raise_str(rb_fstring_cstr(mesg), (recv), (name))
1578 VALUE rb_nomethod_err_new(VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv);
1579 VALUE rb_key_err_new(VALUE mesg, VALUE recv, VALUE name);
1580 #define rb_key_err_raise(mesg, recv, name) \
1581  rb_exc_raise(rb_key_err_new(mesg, recv, name))
1582 PRINTF_ARGS(VALUE rb_warning_string(const char *fmt, ...), 1, 2);
1583 NORETURN(void rb_vraise(VALUE, const char *, va_list));
1584 
1585 /* eval.c */
1589 #define id_signo ruby_static_id_signo
1590 #define id_status ruby_static_id_status
1592 
1593 /* eval_error.c */
1595 
1596 /* eval_jump.c */
1597 void rb_call_end_proc(VALUE data);
1598 void rb_mark_end_proc(void);
1599 
1600 /* file.c */
1601 extern const char ruby_null_device[];
1602 VALUE rb_home_dir_of(VALUE user, VALUE result);
1604 VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
1605 #ifdef RUBY_ENCODING_H
1606 VALUE rb_check_realpath(VALUE basedir, VALUE path, rb_encoding *origenc);
1607 #endif
1608 void rb_file_const(const char*, VALUE);
1609 int rb_file_load_ok(const char *);
1614 void Init_File(void);
1615 int ruby_is_fd_loadable(int fd);
1616 
1617 #ifdef RUBY_FUNCTION_NAME_STRING
1618 # if defined __GNUC__ && __GNUC__ >= 4
1619 # pragma GCC visibility push(default)
1620 # endif
1621 NORETURN(void rb_sys_fail_path_in(const char *func_name, VALUE path));
1622 NORETURN(void rb_syserr_fail_path_in(const char *func_name, int err, VALUE path));
1623 # if defined __GNUC__ && __GNUC__ >= 4
1624 # pragma GCC visibility pop
1625 # endif
1626 # define rb_sys_fail_path(path) rb_sys_fail_path_in(RUBY_FUNCTION_NAME_STRING, path)
1627 # define rb_syserr_fail_path(err, path) rb_syserr_fail_path_in(RUBY_FUNCTION_NAME_STRING, (err), (path))
1628 #else
1629 # define rb_sys_fail_path(path) rb_sys_fail_str(path)
1630 # define rb_syserr_fail_path(err, path) rb_syserr_fail_str((err), (path))
1631 #endif
1632 
1633 /* gc.c */
1635 extern int ruby_disable_gc;
1636 struct rb_objspace; /* in vm_core.h */
1637 void Init_heap(void);
1638 void *ruby_mimmalloc(size_t size) RUBY_ATTR_MALLOC;
1639 void ruby_mimfree(void *ptr);
1643 #if USE_RGENGC
1645 #else
1646 #define rb_gc_writebarrier_remember(obj) 0
1647 #endif
1648 void ruby_gc_set_params(void);
1650 
1651 #if defined(HAVE_MALLOC_USABLE_SIZE) || defined(HAVE_MALLOC_SIZE) || defined(_WIN32)
1652 #define ruby_sized_xrealloc(ptr, new_size, old_size) ruby_xrealloc(ptr, new_size)
1653 #define ruby_sized_xrealloc2(ptr, new_count, element_size, old_count) ruby_xrealloc2(ptr, new_count, element_size)
1654 #define ruby_sized_xfree(ptr, size) ruby_xfree(ptr)
1655 #define SIZED_REALLOC_N(var,type,n,old_n) REALLOC_N(var, type, n)
1656 #else
1658 void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
1659 void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
1660 void ruby_sized_xfree(void *x, size_t size);
1662 #define SIZED_REALLOC_N(var,type,n,old_n) ((var)=(type*)ruby_sized_xrealloc2((void*)(var), (n), sizeof(type), (old_n)))
1663 #endif
1664 
1665 /* optimized version of NEWOBJ() */
1666 #undef NEWOBJF_OF
1667 #undef RB_NEWOBJ_OF
1668 #define RB_NEWOBJ_OF(obj,type,klass,flags) \
1669  type *(obj) = (type*)(((flags) & FL_WB_PROTECTED) ? \
1670  rb_wb_protected_newobj_of(klass, (flags) & ~FL_WB_PROTECTED) : \
1671  rb_wb_unprotected_newobj_of(klass, flags))
1672 #define NEWOBJ_OF(obj,type,klass,flags) RB_NEWOBJ_OF(obj,type,klass,flags)
1673 
1674 #ifdef __has_attribute
1675 #if __has_attribute(alloc_align)
1676 __attribute__((__alloc_align__(1)))
1677 #endif
1678 #endif
1679 void *rb_aligned_malloc(size_t, size_t) RUBY_ATTR_MALLOC RUBY_ATTR_ALLOC_SIZE((2));
1680 
1681 size_t rb_size_mul_or_raise(size_t, size_t, VALUE); /* used in compile.c */
1682 size_t rb_size_mul_add_or_raise(size_t, size_t, size_t, VALUE); /* used in iseq.h */
1683 void *rb_xmalloc_mul_add(size_t, size_t, size_t) RUBY_ATTR_MALLOC;
1684 void *rb_xrealloc_mul_add(const void *, size_t, size_t, size_t);
1685 void *rb_xmalloc_mul_add_mul(size_t, size_t, size_t, size_t) RUBY_ATTR_MALLOC;
1686 void *rb_xcalloc_mul_add_mul(size_t, size_t, size_t, size_t) RUBY_ATTR_MALLOC;
1687 
1688 /* hash.c */
1689 #if RHASH_CONVERT_TABLE_DEBUG
1690 struct st_table *rb_hash_tbl_raw(VALUE hash, const char *file, int line);
1691 #define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h, __FILE__, __LINE__)
1692 #else
1693 struct st_table *rb_hash_tbl_raw(VALUE hash);
1694 #define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h)
1695 #endif
1696 
1701 long rb_dbl_long_hash(double d);
1706 VALUE rb_hash_keys(VALUE hash);
1707 VALUE rb_hash_values(VALUE hash);
1708 VALUE rb_hash_rehash(VALUE hash);
1710 int rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val);
1711 VALUE rb_hash_set_pair(VALUE hash, VALUE pair);
1712 
1714 int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval);
1720 
1721 /* inits.c */
1722 void rb_call_inits(void);
1723 
1724 /* io.c */
1725 void ruby_set_inplace_mode(const char *);
1728 #ifdef RUBY_IO_H
1729 size_t rb_io_memsize(const rb_io_t *);
1730 #endif
1731 int rb_stderr_tty_p(void);
1732 void rb_io_fptr_finalize_internal(void *ptr);
1733 #define rb_io_fptr_finalize rb_io_fptr_finalize_internal
1734 
1735 /* load.c */
1737 int rb_require_internal(VALUE fname);
1738 NORETURN(void rb_load_fail(VALUE, const char*));
1739 
1740 /* loadpath.c */
1741 extern const char ruby_exec_prefix[];
1742 extern const char ruby_initial_load_paths[];
1743 
1744 /* localeinit.c */
1746 
1747 /* math.c */
1753 VALUE rb_math_log(int argc, const VALUE *argv);
1756 
1757 /* mjit.c */
1758 
1759 #if USE_MJIT
1760 extern bool mjit_enabled;
1761 VALUE mjit_pause(bool wait_p);
1762 VALUE mjit_resume(void);
1763 void mjit_finish(bool close_handle_p);
1764 #else
1765 #define mjit_enabled 0
1766 static inline VALUE mjit_pause(bool wait_p){ return Qnil; } // unreachable
1767 static inline VALUE mjit_resume(void){ return Qnil; } // unreachable
1768 static inline void mjit_finish(bool close_handle_p){}
1769 #endif
1770 
1771 /* newline.c */
1772 void Init_newline(void);
1773 
1774 /* numeric.c */
1775 
1776 #define FIXNUM_POSITIVE_P(num) ((SIGNED_VALUE)(num) > (SIGNED_VALUE)INT2FIX(0))
1777 #define FIXNUM_NEGATIVE_P(num) ((SIGNED_VALUE)(num) < 0)
1778 #define FIXNUM_ZERO_P(num) ((num) == INT2FIX(0))
1779 
1780 #define INT_NEGATIVE_P(x) (FIXNUM_P(x) ? FIXNUM_NEGATIVE_P(x) : BIGNUM_NEGATIVE_P(x))
1781 
1782 #define FLOAT_ZERO_P(x) (RFLOAT_VALUE(x) == 0.0)
1783 
1784 #ifndef ROUND_DEFAULT
1785 # define ROUND_DEFAULT RUBY_NUM_ROUND_HALF_UP
1786 #endif
1792 };
1793 #define ROUND_TO(mode, even, up, down) \
1794  ((mode) == RUBY_NUM_ROUND_HALF_EVEN ? even : \
1795  (mode) == RUBY_NUM_ROUND_HALF_UP ? up : down)
1796 #define ROUND_FUNC(mode, name) \
1797  ROUND_TO(mode, name##_half_even, name##_half_up, name##_half_down)
1798 #define ROUND_CALL(mode, name, args) \
1799  ROUND_TO(mode, name##_half_even args, \
1800  name##_half_up args, name##_half_down args)
1801 
1802 int rb_num_to_uint(VALUE val, unsigned int *ret);
1803 VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl);
1804 double ruby_float_step_size(double beg, double end, double unit, int excl);
1805 int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless);
1806 double ruby_float_mod(double x, double y);
1808 VALUE rb_int_succ(VALUE num);
1814 VALUE rb_int_mul(VALUE x, VALUE y);
1819 VALUE rb_int2str(VALUE num, int base);
1821 VALUE rb_fix_aref(VALUE fix, VALUE idx);
1822 VALUE rb_int_gt(VALUE x, VALUE y);
1823 int rb_float_cmp(VALUE x, VALUE y);
1825 VALUE rb_int_ge(VALUE x, VALUE y);
1827 double rb_int_fdiv_double(VALUE x, VALUE y);
1828 VALUE rb_int_pow(VALUE x, VALUE y);
1830 VALUE rb_int_cmp(VALUE x, VALUE y);
1833 VALUE rb_int_and(VALUE x, VALUE y);
1835 VALUE rb_int_div(VALUE x, VALUE y);
1836 VALUE rb_int_abs(VALUE num);
1837 VALUE rb_int_odd_p(VALUE num);
1838 int rb_int_positive_p(VALUE num);
1839 int rb_int_negative_p(VALUE num);
1840 VALUE rb_num_pow(VALUE x, VALUE y);
1841 VALUE rb_float_ceil(VALUE num, int ndigits);
1842 
1843 static inline VALUE
1844 rb_num_compare_with_zero(VALUE num, ID mid)
1845 {
1846  VALUE zero = INT2FIX(0);
1847  VALUE r = rb_check_funcall(num, mid, 1, &zero);
1848  if (r == Qundef) {
1849  rb_cmperr(num, zero);
1850  }
1851  return r;
1852 }
1853 
1854 static inline int
1855 rb_num_positive_int_p(VALUE num)
1856 {
1857  const ID mid = '>';
1858 
1859  if (FIXNUM_P(num)) {
1861  return FIXNUM_POSITIVE_P(num);
1862  }
1863  else if (RB_TYPE_P(num, T_BIGNUM)) {
1865  return BIGNUM_POSITIVE_P(num);
1866  }
1867  return RTEST(rb_num_compare_with_zero(num, mid));
1868 }
1869 
1870 
1871 static inline int
1872 rb_num_negative_int_p(VALUE num)
1873 {
1874  const ID mid = '<';
1875 
1876  if (FIXNUM_P(num)) {
1878  return FIXNUM_NEGATIVE_P(num);
1879  }
1880  else if (RB_TYPE_P(num, T_BIGNUM)) {
1882  return BIGNUM_NEGATIVE_P(num);
1883  }
1884  return RTEST(rb_num_compare_with_zero(num, mid));
1885 }
1886 
1887 
1888 VALUE rb_float_abs(VALUE flt);
1892 
1893 #if USE_FLONUM
1894 #define RUBY_BIT_ROTL(v, n) (((v) << (n)) | ((v) >> ((sizeof(v) * 8) - n)))
1895 #define RUBY_BIT_ROTR(v, n) (((v) >> (n)) | ((v) << ((sizeof(v) * 8) - n)))
1896 #endif
1897 
1898 static inline double
1899 rb_float_flonum_value(VALUE v)
1900 {
1901 #if USE_FLONUM
1902  if (v != (VALUE)0x8000000000000002) { /* LIKELY */
1903  union {
1904  double d;
1905  VALUE v;
1906  } t;
1907 
1908  VALUE b63 = (v >> 63);
1909  /* e: xx1... -> 011... */
1910  /* xx0... -> 100... */
1911  /* ^b63 */
1912  t.v = RUBY_BIT_ROTR((2 - b63) | (v & ~(VALUE)0x03), 3);
1913  return t.d;
1914  }
1915 #endif
1916  return 0.0;
1917 }
1918 
1919 static inline double
1920 rb_float_noflonum_value(VALUE v)
1921 {
1922  return ((struct RFloat *)v)->float_value;
1923 }
1924 
1925 static inline double
1926 rb_float_value_inline(VALUE v)
1927 {
1928  if (FLONUM_P(v)) {
1929  return rb_float_flonum_value(v);
1930  }
1931  return rb_float_noflonum_value(v);
1932 }
1933 
1934 static inline VALUE
1935 rb_float_new_inline(double d)
1936 {
1937 #if USE_FLONUM
1938  union {
1939  double d;
1940  VALUE v;
1941  } t;
1942  int bits;
1943 
1944  t.d = d;
1945  bits = (int)((VALUE)(t.v >> 60) & 0x7);
1946  /* bits contains 3 bits of b62..b60. */
1947  /* bits - 3 = */
1948  /* b011 -> b000 */
1949  /* b100 -> b001 */
1950 
1951  if (t.v != 0x3000000000000000 /* 1.72723e-77 */ &&
1952  !((bits-3) & ~0x01)) {
1953  return (RUBY_BIT_ROTL(t.v, 3) & ~(VALUE)0x01) | 0x02;
1954  }
1955  else if (t.v == (VALUE)0) {
1956  /* +0.0 */
1957  return 0x8000000000000002;
1958  }
1959  /* out of range */
1960 #endif
1961  return rb_float_new_in_heap(d);
1962 }
1963 
1964 #define rb_float_value(v) rb_float_value_inline(v)
1965 #define rb_float_new(d) rb_float_new_inline(d)
1966 
1967 /* object.c */
1968 void rb_obj_copy_ivar(VALUE dest, VALUE obj);
1969 CONSTFUNC(VALUE rb_obj_equal(VALUE obj1, VALUE obj2));
1970 CONSTFUNC(VALUE rb_obj_not(VALUE obj));
1972 NORETURN(void rb_undefined_alloc(VALUE klass));
1973 double rb_num_to_dbl(VALUE val);
1974 VALUE rb_obj_dig(int argc, VALUE *argv, VALUE self, VALUE notfound);
1977 VALUE rb_convert_type_with_id(VALUE,int,const char*,ID);
1978 VALUE rb_check_convert_type_with_id(VALUE,int,const char*,ID);
1979 int rb_bool_expected(VALUE, const char *);
1980 
1981 struct RBasicRaw {
1984 };
1985 
1986 #define RBASIC_CLEAR_CLASS(obj) memset(&(((struct RBasicRaw *)((VALUE)(obj)))->klass), 0, sizeof(VALUE))
1987 #define RBASIC_SET_CLASS_RAW(obj, cls) memcpy(&((struct RBasicRaw *)((VALUE)(obj)))->klass, &(cls), sizeof(VALUE))
1988 #define RBASIC_SET_CLASS(obj, cls) do { \
1989  VALUE _obj_ = (obj); \
1990  RB_OBJ_WRITE(_obj_, &((struct RBasicRaw *)(_obj_))->klass, cls); \
1991 } while (0)
1992 
1993 /* parse.y */
1994 #ifndef USE_SYMBOL_GC
1995 #define USE_SYMBOL_GC 1
1996 #endif
1999 VALUE rb_parser_set_context(VALUE, const struct rb_iseq_struct *, int);
2001 void *rb_parser_load_file(VALUE parser, VALUE name);
2008 ID rb_make_internal_id(void);
2010 
2011 /* proc.c */
2014 int rb_block_arity(void);
2015 int rb_block_min_max_arity(int *max);
2018 VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_info);
2019 
2020 /* process.c */
2021 #define RB_MAX_GROUPS (65536)
2022 
2023 struct waitpid_state;
2024 struct rb_execarg {
2025  union {
2026  struct {
2028  } sh;
2029  struct {
2031  VALUE command_abspath; /* full path string or nil */
2034  } cmd;
2035  } invoke;
2040  unsigned use_shell : 1;
2041  unsigned pgroup_given : 1;
2042  unsigned umask_given : 1;
2044  unsigned unsetenv_others_do : 1;
2045  unsigned close_others_given : 1;
2046  unsigned close_others_do : 1;
2047  unsigned chdir_given : 1;
2048  unsigned new_pgroup_given : 1;
2049  unsigned new_pgroup_flag : 1;
2050  unsigned uid_given : 1;
2051  unsigned gid_given : 1;
2052  unsigned exception : 1;
2053  unsigned exception_given : 1;
2054  struct waitpid_state *waitpid_state; /* for async process management */
2055  rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0<V). */
2056  VALUE rlimit_limits; /* Qfalse or [[rtype, softlim, hardlim], ...] */
2065  VALUE env_modification; /* Qfalse or [[k1,v1], ...] */
2068 };
2069 
2070 /* argv_str contains extra two elements.
2071  * The beginning one is for /bin/sh used by exec_with_sh.
2072  * The last one for terminating NULL used by execve.
2073  * See rb_exec_fillarg() in process.c. */
2074 #define ARGVSTR2ARGV(argv_str) ((char **)RB_IMEMO_TMPBUF_PTR(argv_str) + 1)
2075 
2076 static inline size_t
2077 ARGVSTR2ARGC(VALUE argv_str)
2078 {
2079  size_t i = 0;
2080  char *const *p = ARGVSTR2ARGV(argv_str);
2081  while (p[i++])
2082  ;
2083  return i - 1;
2084 }
2085 
2087 void rb_last_status_clear(void);
2088 
2089 /* range.c */
2090 #define RANGE_BEG(r) (RSTRUCT(r)->as.ary[0])
2091 #define RANGE_END(r) (RSTRUCT(r)->as.ary[1])
2092 #define RANGE_EXCL(r) (RSTRUCT(r)->as.ary[2])
2093 
2094 /* rational.c */
2097 VALUE rb_rational_plus(VALUE self, VALUE other);
2098 VALUE rb_rational_mul(VALUE self, VALUE other);
2099 VALUE rb_lcm(VALUE x, VALUE y);
2101 VALUE rb_cstr_to_rat(const char *, int);
2103 VALUE rb_rational_cmp(VALUE self, VALUE other);
2104 VALUE rb_rational_pow(VALUE self, VALUE other);
2108 
2109 /* re.c */
2110 VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
2112 long rb_reg_search0(VALUE, VALUE, long, int, int);
2113 VALUE rb_reg_match_p(VALUE re, VALUE str, long pos);
2115 void rb_backref_set_string(VALUE string, long pos, long len);
2116 void rb_match_unbusy(VALUE);
2117 int rb_match_count(VALUE match);
2118 int rb_match_nth_defined(int nth, VALUE match);
2119 VALUE rb_reg_new_ary(VALUE ary, int options);
2120 
2121 /* signal.c */
2122 extern int ruby_enable_coredump;
2123 int rb_get_next_signal(void);
2124 
2125 /* string.c */
2127 VALUE rb_fstring_new(const char *ptr, long len);
2128 #define rb_fstring_lit(str) rb_fstring_new((str), rb_strlen_lit(str))
2129 #define rb_fstring_literal(str) rb_fstring_lit(str)
2130 VALUE rb_fstring_cstr(const char *str);
2131 #ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
2132 # define rb_fstring_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
2133  (__builtin_constant_p(str)) ? \
2134  rb_fstring_new((str), (long)strlen(str)) : \
2135  rb_fstring_cstr(str) \
2136 )
2137 #endif
2138 #ifdef RUBY_ENCODING_H
2139 VALUE rb_fstring_enc_new(const char *ptr, long len, rb_encoding *enc);
2140 #define rb_fstring_enc_lit(str, enc) rb_fstring_enc_new((str), rb_strlen_lit(str), (enc))
2141 #define rb_fstring_enc_literal(str, enc) rb_fstring_enc_lit(str, enc)
2142 #endif
2143 int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
2144 int rb_str_symname_p(VALUE);
2147 #define QUOTE(str) rb_str_quote_unprintable(str)
2148 #define QUOTE_ID(id) rb_id_quote_unprintable(id)
2149 char *rb_str_fill_terminator(VALUE str, const int termlen);
2150 void rb_str_change_terminator_length(VALUE str, const int oldtermlen, const int termlen);
2153 #ifdef RUBY_ENCODING_H
2155 VALUE rb_str_cat_conv_enc_opts(VALUE newstr, long ofs, const char *ptr, long len,
2156  rb_encoding *from, int ecflags, VALUE ecopts);
2158 VALUE rb_str_initialize(VALUE str, const char *ptr, long len, rb_encoding *enc);
2159 #endif
2160 #define STR_NOEMBED FL_USER1
2161 #define STR_SHARED FL_USER2 /* = ELTS_SHARED */
2162 #define STR_EMBED_P(str) (!FL_TEST_RAW((str), STR_NOEMBED))
2163 #define STR_SHARED_P(s) FL_ALL_RAW((s), STR_NOEMBED|ELTS_SHARED)
2164 #define is_ascii_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT)
2165 #define is_broken_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN)
2166 size_t rb_str_memsize(VALUE);
2167 VALUE rb_sym_proc_call(ID mid, int argc, const VALUE *argv, int kw_splat, VALUE passed_proc);
2169 char *rb_str_to_cstr(VALUE str);
2170 VALUE rb_str_eql(VALUE str1, VALUE str2);
2172 const char *ruby_escaped_char(int c);
2174 
2175 /* expect tail call optimization */
2176 static inline VALUE
2177 rb_str_eql_internal(const VALUE str1, const VALUE str2)
2178 {
2179  const long len = RSTRING_LEN(str1);
2180  const char *ptr1, *ptr2;
2181 
2182  if (len != RSTRING_LEN(str2)) return Qfalse;
2183  if (!rb_str_comparable(str1, str2)) return Qfalse;
2184  if ((ptr1 = RSTRING_PTR(str1)) == (ptr2 = RSTRING_PTR(str2)))
2185  return Qtrue;
2186  if (memcmp(ptr1, ptr2, len) == 0)
2187  return Qtrue;
2188  return Qfalse;
2189 }
2190 
2191 /* symbol.c */
2192 #ifdef RUBY_ENCODING_H
2193 VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc);
2194 #endif
2195 VALUE rb_sym_intern_ascii(const char *ptr, long len);
2196 VALUE rb_sym_intern_ascii_cstr(const char *ptr);
2197 #ifdef __GNUC__
2198 #define rb_sym_intern_ascii_cstr(ptr) __extension__ ( \
2199 { \
2200  (__builtin_constant_p(ptr)) ? \
2201  rb_sym_intern_ascii((ptr), (long)strlen(ptr)) : \
2202  rb_sym_intern_ascii_cstr(ptr); \
2203 })
2204 #endif
2206 
2207 /* struct.c */
2211 
2212 /* time.c */
2213 struct timeval rb_time_timeval(VALUE);
2214 
2215 /* thread.c */
2216 #define COVERAGE_INDEX_LINES 0
2217 #define COVERAGE_INDEX_BRANCHES 1
2218 #define COVERAGE_TARGET_LINES 1
2219 #define COVERAGE_TARGET_BRANCHES 2
2220 #define COVERAGE_TARGET_METHODS 4
2221 #define COVERAGE_TARGET_ONESHOT_LINES 8
2222 
2226 VALUE rb_get_coverages(void);
2227 int rb_get_coverage_mode(void);
2233 int rb_thread_to_be_killed(VALUE thread);
2234 void rb_mutex_allow_trap(VALUE self, int val);
2235 VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data);
2237 
2238 /* transcode.c */
2240 #ifdef RUBY_ENCODING_H
2241 size_t rb_econv_memsize(rb_econv_t *);
2242 #endif
2243 
2244 /* us_ascii.c */
2245 #ifdef RUBY_ENCODING_H
2246 extern rb_encoding OnigEncodingUS_ASCII;
2247 #endif
2248 
2249 /* util.c */
2250 char *ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve);
2251 char *ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, char **rve);
2252 
2253 /* utf_8.c */
2254 #ifdef RUBY_ENCODING_H
2256 #endif
2257 
2258 /* variable.c */
2259 #if USE_TRANSIENT_HEAP
2260 #define ROBJECT_TRANSIENT_FLAG FL_USER13
2261 #define ROBJ_TRANSIENT_P(obj) FL_TEST_RAW((obj), ROBJECT_TRANSIENT_FLAG)
2262 #define ROBJ_TRANSIENT_SET(obj) FL_SET_RAW((obj), ROBJECT_TRANSIENT_FLAG)
2263 #define ROBJ_TRANSIENT_UNSET(obj) FL_UNSET_RAW((obj), ROBJECT_TRANSIENT_FLAG)
2264 #else
2265 #define ROBJ_TRANSIENT_P(obj) 0
2266 #define ROBJ_TRANSIENT_SET(obj) ((void)0)
2267 #define ROBJ_TRANSIENT_UNSET(obj) ((void)0)
2268 #endif
2269 void rb_gc_mark_global_tbl(void);
2273 VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef);
2274 void rb_autoload_str(VALUE mod, ID id, VALUE file);
2276 void rb_deprecate_constant(VALUE mod, const char *name);
2280 bool rb_gvar_is_traced(const struct rb_global_entry *);
2281 void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_);
2282 
2283 /* vm_insnhelper.h */
2285 
2286 /* vm.c */
2288 void rb_vm_mark(void *ptr);
2289 void Init_BareVM(void);
2290 void Init_vm_objects(void);
2293 const void **rb_vm_get_insns_address_table(void);
2294 VALUE rb_source_location(int *pline);
2295 const char *rb_source_location_cstr(int *pline);
2297 int rb_vm_add_root_module(ID id, VALUE module);
2300 VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
2303 
2304 
2305 /* vm_dump.c */
2306 void rb_print_backtrace(void);
2307 
2308 /* vm_eval.c */
2309 void Init_vm_eval(void);
2310 VALUE rb_adjust_argv_kw_splat(int *, const VALUE **, int *);
2313 typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE);
2314 VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
2316 VALUE rb_check_funcall_with_hook_kw(VALUE recv, ID mid, int argc, const VALUE *argv,
2317  rb_check_funcall_hook *hook, VALUE arg, int kw_splat);
2318 const char *rb_type_str(enum ruby_value_type type);
2320 VALUE rb_yield_1(VALUE val);
2322 VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv,
2323  rb_block_call_func_t bl_proc, int min_argc, int max_argc,
2324  VALUE data2);
2325 
2326 /* vm_insnhelper.c */
2329 void Init_vm_stack_canary(void);
2330 
2331 /* vm_method.c */
2332 void Init_eval_method(void);
2333 
2343 };
2348 struct rb_calling_info;
2349 struct rb_call_data;
2350 /* I have several reasons to chose 64 here:
2351  *
2352  * - A cache line must be a power-of-two size.
2353  * - Setting this to anything less than or equal to 32 boosts nothing.
2354  * - I have never seen an architecture that has 128 byte L1 cache line.
2355  * - I know Intel Core and Sparc T4 at least uses 64.
2356  * - I know jemalloc internally has this exact same `#define CACHE_LINE 64`.
2357  * https://github.com/jemalloc/jemalloc/blob/dev/include/jemalloc/internal/jemalloc_internal_types.h
2358  */
2359 #define CACHELINE 64
2361  /* inline cache: keys */
2364  (CACHELINE
2365  - sizeof(rb_serial_t) /* method_state */
2366  - sizeof(struct rb_callable_method_entry_struct *) /* me */
2367  - sizeof(uintptr_t) /* method_serial */
2368  - sizeof(enum method_missing_reason) /* aux */
2369  - sizeof(VALUE (*)( /* call */
2370  struct rb_execution_context_struct *e,
2371  struct rb_control_frame_struct *,
2372  struct rb_calling_info *,
2373  const struct rb_call_data *)))
2374  / sizeof(rb_serial_t)
2375  ];
2376 
2377  /* inline cache: values */
2379  uintptr_t method_serial; /* me->def->method_serial */
2380 
2382  struct rb_control_frame_struct *cfp,
2383  struct rb_calling_info *calling,
2384  struct rb_call_data *cd);
2385 
2386  union {
2387  unsigned int index; /* used by ivar */
2388  enum method_missing_reason method_missing_reason; /* used by method_missing */
2389  } aux;
2390 };
2391 STATIC_ASSERT(cachelined, sizeof(struct rb_call_cache) <= CACHELINE);
2393  /* fixed at compile time */
2395  unsigned int flag;
2397 };
2401 };
2403 RUBY_FUNC_NONNULL(1, VALUE rb_funcallv_with_cc(struct rb_call_data*, VALUE, ID, int, const VALUE*));
2406 
2407 #ifdef __GNUC__
2408 # define rb_funcallv(recv, mid, argc, argv) \
2409  __extension__({ \
2410  static struct rb_call_data rb_funcallv_data; \
2411  rb_funcallv_with_cc(&rb_funcallv_data, recv, mid, argc, argv); \
2412  })
2413 # define rb_method_basic_definition_p(klass, mid) \
2414  __extension__({ \
2415  static struct rb_call_data rb_mbdp; \
2416  (klass == Qfalse) ? /* hidden object cannot be overridden */ true : \
2417  rb_method_basic_definition_p_with_cc(&rb_mbdp, klass, mid); \
2418  })
2419 #endif
2420 
2421 /* vm_backtrace.c */
2422 void Init_vm_backtrace(void);
2423 VALUE rb_vm_thread_backtrace(int argc, const VALUE *argv, VALUE thval);
2425 
2426 VALUE rb_make_backtrace(void);
2428 int rb_backtrace_p(VALUE obj);
2431 void rb_backtrace_each(VALUE (*iter)(VALUE recv, VALUE str), VALUE output);
2432 
2434 const char *rb_objspace_data_type_name(VALUE obj);
2435 
2436 /* Temporary. This API will be removed (renamed). */
2437 VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
2438 
2439 /* array.c (export) */
2440 void rb_ary_detransient(VALUE a);
2442 void rb_ary_ptr_use_end(VALUE ary);
2443 
2444 /* bignum.c (export) */
2451 VALUE rb_big2str_poweroftwo(VALUE x, int base);
2452 VALUE rb_big2str_generic(VALUE x, int base);
2453 VALUE rb_str2big_poweroftwo(VALUE arg, int base, int badcheck);
2454 VALUE rb_str2big_normal(VALUE arg, int base, int badcheck);
2455 VALUE rb_str2big_karatsuba(VALUE arg, int base, int badcheck);
2456 #if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
2459 VALUE rb_big2str_gmp(VALUE x, int base);
2460 VALUE rb_str2big_gmp(VALUE arg, int base, int badcheck);
2461 #endif
2468 };
2469 VALUE rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits, int base, int flags);
2470 
2471 /* enumerator.c (export) */
2472 VALUE rb_arith_seq_new(VALUE obj, VALUE meth, int argc, VALUE const *argv,
2473  rb_enumerator_size_func *size_fn,
2474  VALUE beg, VALUE end, VALUE step, int excl);
2475 
2476 /* error.c (export) */
2477 int rb_bug_reporter_add(void (*func)(FILE *, void *), void *data);
2478 NORETURN(void rb_unexpected_type(VALUE,int));
2479 #undef Check_Type
2480 #define Check_Type(v, t) \
2481  (!RB_TYPE_P((VALUE)(v), (t)) || \
2482  ((t) == RUBY_T_DATA && RTYPEDDATA_P(v)) ? \
2483  rb_unexpected_type((VALUE)(v), (t)) : (void)0)
2484 
2485 static inline int
2486 rb_typeddata_is_instance_of_inline(VALUE obj, const rb_data_type_t *data_type)
2487 {
2488  return RB_TYPE_P(obj, T_DATA) && RTYPEDDATA_P(obj) && (RTYPEDDATA_TYPE(obj) == data_type);
2489 }
2490 #define rb_typeddata_is_instance_of rb_typeddata_is_instance_of_inline
2491 
2492 /* file.c (export) */
2493 #if defined HAVE_READLINK && defined RUBY_ENCODING_H
2495 #endif
2496 #ifdef __APPLE__
2497 VALUE rb_str_normalize_ospath(const char *ptr, long len);
2498 #endif
2499 
2500 /* hash.c (export) */
2502 VALUE rb_ident_hash_new(void);
2503 
2504 /* io.c (export) */
2505 void rb_maygvl_fd_fix_cloexec(int fd);
2506 int rb_gc_for_fd(int err);
2507 void rb_write_error_str(VALUE mesg);
2508 
2509 /* numeric.c (export) */
2510 VALUE rb_int_positive_pow(long x, unsigned long y);
2511 
2512 /* object.c (export) */
2513 int rb_opts_exception_p(VALUE opts, int default_value);
2514 
2515 /* process.c (export) */
2516 int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen);
2517 rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen);
2518 VALUE rb_execarg_new(int argc, const VALUE *argv, int accept_shell, int allow_exc_opt);
2519 struct rb_execarg *rb_execarg_get(VALUE execarg_obj); /* dangerous. needs GC guard. */
2520 int rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val);
2521 void rb_execarg_parent_start(VALUE execarg_obj);
2522 void rb_execarg_parent_end(VALUE execarg_obj);
2523 int rb_execarg_run_options(const struct rb_execarg *e, struct rb_execarg *s, char* errmsg, size_t errmsg_buflen);
2524 VALUE rb_execarg_extract_options(VALUE execarg_obj, VALUE opthash);
2525 void rb_execarg_setenv(VALUE execarg_obj, VALUE env);
2526 
2527 /* rational.c (export) */
2528 VALUE rb_gcd(VALUE x, VALUE y);
2529 VALUE rb_gcd_normal(VALUE self, VALUE other);
2530 #if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
2531 VALUE rb_gcd_gmp(VALUE x, VALUE y);
2532 #endif
2533 
2534 /* signal.c (export) */
2535 int rb_grantpt(int fd);
2536 
2537 /* string.c (export) */
2540 #ifdef RUBY_ENCODING_H
2541 /* internal use */
2542 VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc);
2543 #endif
2544 VALUE rb_str_upto_each(VALUE, VALUE, int, int (*each)(VALUE, VALUE), VALUE);
2546 
2547 /* thread.c (export) */
2548 int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
2549 
2550 /* time.c (export) */
2551 void ruby_reset_leap_second_info(void);
2552 
2553 /* util.c (export) */
2554 extern const signed char ruby_digit36_to_number_table[];
2555 extern const char ruby_hexdigits[];
2556 extern unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow);
2557 
2558 /* variable.c (export) */
2560 void rb_mv_generic_ivar(VALUE src, VALUE dst);
2562 int rb_class_ivar_set(VALUE klass, ID vid, VALUE value);
2563 void rb_iv_tbl_copy(VALUE dst, VALUE src);
2564 
2565 /* gc.c (export) */
2568 
2569 size_t rb_obj_memsize_of(VALUE);
2571 
2572 #define RB_OBJ_GC_FLAGS_MAX 6
2573 size_t rb_obj_gc_flags(VALUE, ID[], size_t);
2574 void rb_gc_mark_values(long n, const VALUE *values);
2575 void rb_gc_mark_vm_stack_values(long n, const VALUE *values);
2576 
2577 #if IMEMO_DEBUG
2578 VALUE rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0, const char *file, int line);
2579 #define rb_imemo_new(type, v1, v2, v3, v0) rb_imemo_new_debug(type, v1, v2, v3, v0, __FILE__, __LINE__)
2580 #else
2581 VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0);
2582 #endif
2583 
2584 /* random.c */
2585 int ruby_fill_random_bytes(void *, size_t, int);
2586 
2588 
2589 #define RUBY_DTRACE_CREATE_HOOK(name, arg) \
2590  RUBY_DTRACE_HOOK(name##_CREATE, arg)
2591 #define RUBY_DTRACE_HOOK(name, arg) \
2592 do { \
2593  if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \
2594  int dtrace_line; \
2595  const char *dtrace_file = rb_source_location_cstr(&dtrace_line); \
2596  if (!dtrace_file) dtrace_file = ""; \
2597  RUBY_DTRACE_##name(arg, dtrace_file, dtrace_line); \
2598  } \
2599 } while (0)
2600 
2601 #define RB_OBJ_BUILTIN_TYPE(obj) rb_obj_builtin_type(obj)
2602 #define OBJ_BUILTIN_TYPE(obj) RB_OBJ_BUILTIN_TYPE(obj)
2603 #ifdef __GNUC__
2604 #define rb_obj_builtin_type(obj) \
2605 __extension__({ \
2606  VALUE arg_obj = (obj); \
2607  RB_SPECIAL_CONST_P(arg_obj) ? -1 : \
2608  RB_BUILTIN_TYPE(arg_obj); \
2609  })
2610 #else
2611 static inline int
2613 {
2614  return RB_SPECIAL_CONST_P(obj) ? -1 :
2616 }
2617 #endif
2618 
2619 /* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */
2620 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
2621 # define FLEX_ARY_LEN /* VALUE ary[]; */
2622 #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
2623 # define FLEX_ARY_LEN 0 /* VALUE ary[0]; */
2624 #else
2625 # define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
2626 #endif
2627 
2628 /*
2629  * For declaring bitfields out of non-unsigned int types:
2630  * struct date {
2631  * BITFIELD(enum months, month, 4);
2632  * ...
2633  * };
2634  */
2635 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
2636 # define BITFIELD(type, name, size) type name : size
2637 #else
2638 # define BITFIELD(type, name, size) unsigned int name : size
2639 #endif
2640 
2641 #if defined(_MSC_VER)
2642 # define COMPILER_WARNING_PUSH __pragma(warning(push))
2643 # define COMPILER_WARNING_POP __pragma(warning(pop))
2644 # define COMPILER_WARNING_ERROR(flag) __pragma(warning(error: flag)))
2645 # define COMPILER_WARNING_IGNORED(flag) __pragma(warning(suppress: flag)))
2646 
2647 #elif defined(__clang__) /* clang 2.6 already had this feature */
2648 # define COMPILER_WARNING_PUSH _Pragma("clang diagnostic push")
2649 # define COMPILER_WARNING_POP _Pragma("clang diagnostic pop")
2650 # define COMPILER_WARNING_SPECIFIER(kind, msg) \
2651  clang diagnostic kind # msg
2652 # define COMPILER_WARNING_ERROR(flag) \
2653  COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(error, flag))
2654 # define COMPILER_WARNING_IGNORED(flag) \
2655  COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(ignored, flag))
2656 
2657 #elif GCC_VERSION_SINCE(4, 6, 0)
2658 /* https://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Diagnostic-Pragmas.html */
2659 # define COMPILER_WARNING_PUSH _Pragma("GCC diagnostic push")
2660 # define COMPILER_WARNING_POP _Pragma("GCC diagnostic pop")
2661 # define COMPILER_WARNING_SPECIFIER(kind, msg) \
2662  GCC diagnostic kind # msg
2663 # define COMPILER_WARNING_ERROR(flag) \
2664  COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(error, flag))
2665 # define COMPILER_WARNING_IGNORED(flag) \
2666  COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(ignored, flag))
2667 
2668 #else /* other compilers to follow? */
2669 # define COMPILER_WARNING_PUSH /* nop */
2670 # define COMPILER_WARNING_POP /* nop */
2671 # define COMPILER_WARNING_ERROR(flag) /* nop */
2672 # define COMPILER_WARNING_IGNORED(flag) /* nop */
2673 #endif
2674 
2675 #define COMPILER_WARNING_PRAGMA(str) COMPILER_WARNING_PRAGMA_(str)
2676 #define COMPILER_WARNING_PRAGMA_(str) _Pragma(#str)
2677 
2678 #if defined(USE_UNALIGNED_MEMBER_ACCESS) && USE_UNALIGNED_MEMBER_ACCESS && \
2679  (defined(__clang__) || GCC_VERSION_SINCE(9, 0, 0))
2680 # define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \
2681  COMPILER_WARNING_PUSH; \
2682  COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \
2683  typeof(expr) unaligned_member_access_result = (expr); \
2684  COMPILER_WARNING_POP; \
2685  unaligned_member_access_result; \
2686 })
2687 #else
2688 # define UNALIGNED_MEMBER_ACCESS(expr) expr
2689 #endif
2690 #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
2691 
2692 #undef RB_OBJ_WRITE
2693 #define RB_OBJ_WRITE(a, slot, b) UNALIGNED_MEMBER_ACCESS(rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__))
2694 
2695 #if defined(__cplusplus)
2696 #if 0
2697 { /* satisfy cc-mode */
2698 #endif
2699 } /* extern "C" { */
2700 #endif
2701 
2702 #endif /* RUBY_INTERNAL_H */
rb_hash_stlike_lookup
int rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval)
Definition: hash.c:2012
rb_eEAGAIN
VALUE rb_eEAGAIN
Definition: error.c:54
rb_readlink
VALUE rb_readlink(VALUE path, rb_encoding *resultenc)
Definition: file.c:618
rb_is_const_name
int rb_is_const_name(VALUE name)
Definition: symbol.c:1050
rb_rational_cmp
VALUE rb_rational_cmp(VALUE self, VALUE other)
Definition: rational.c:1097
rb_math_exp
VALUE rb_math_exp(VALUE)
rb_dir_getwd_ospath
VALUE rb_dir_getwd_ospath(void)
Definition: dir.c:1117
FLONUM_P
#define FLONUM_P(x)
Definition: ruby.h:430
rb_to_hash_type
VALUE rb_to_hash_type(VALUE obj)
Definition: hash.c:1840
Init_class_hierarchy
void Init_class_hierarchy(void)
Definition: class.c:549
RIMemo::v1
VALUE v1
Definition: internal.h:1127
rb_str_symname_p
int rb_str_symname_p(VALUE)
Definition: string.c:10695
__attribute__
unsigned int UINT8 __attribute__((__mode__(__QI__)))
Definition: ffi_common.h:110
rb_subclass_entry::next
rb_subclass_entry_t * next
Definition: internal.h:1000
rb_hash_stlike_foreach_with_replace
RUBY_SYMBOL_EXPORT_END int rb_hash_stlike_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg)
Definition: hash.c:1453
i
uint32_t i
Definition: rb_mjit_min_header-2.7.1.h:5464
ID
unsigned long ID
Definition: ruby.h:103
rb_check_funcall
VALUE rb_check_funcall(VALUE, ID, int, const VALUE *)
Definition: vm_eval.c:505
RUBY_SYMBOL_EXPORT_END
#define RUBY_SYMBOL_EXPORT_END
Definition: missing.h:49
rb_imemo_tmpbuf_parser_heap
rb_imemo_tmpbuf_t * rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt)
Definition: gc.c:2328
rb_execarg_parent_end
void rb_execarg_parent_end(VALUE execarg_obj)
Definition: process.c:2855
RHASH_PROC_DEFAULT
@ RHASH_PROC_DEFAULT
Definition: internal.h:819
rb_hash_set_pair
VALUE rb_hash_set_pair(VALUE hash, VALUE pair)
Definition: hash.c:3326
rb_deprecated_classext_struct::conflict
char conflict[sizeof(VALUE) *3]
Definition: internal.h:992
rb_fix_aref
VALUE rb_fix_aref(VALUE fix, VALUE idx)
Definition: numeric.c:4642
ruby_reset_leap_second_info
void ruby_reset_leap_second_info(void)
Definition: time.c:1193
obj
const VALUE VALUE obj
Definition: rb_mjit_min_header-2.7.1.h:5742
rb_f_raise
VALUE rb_f_raise(int argc, VALUE *argv)
Definition: eval.c:727
uint128_t
#define uint128_t
Definition: rb_mjit_min_header-2.7.1.h:235
ruby_dtoa
char * ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve)
rb_fstring
VALUE rb_fstring(VALUE)
Definition: string.c:312
MISSING_SUPER
@ MISSING_SUPER
Definition: internal.h:2340
rb_check_convert_type_with_id
VALUE rb_check_convert_type_with_id(VALUE, int, const char *, ID)
Definition: object.c:2957
rb_dvar_defined
int rb_dvar_defined(ID, const struct rb_iseq_struct *)
long
#define long
Definition: rb_mjit_min_header-2.7.1.h:2880
rb_block_arity
int rb_block_arity(void)
Definition: proc.c:1144
rb_reg_start_with_p
bool rb_reg_start_with_p(VALUE re, VALUE str)
Definition: re.c:1618
rb_id_encoding
ID rb_id_encoding(void)
Definition: encoding.c:759
FIX_CONST_VALUE_PTR
#define FIX_CONST_VALUE_PTR(x)
Definition: ruby.h:2178
rb_execarg::fd_dup2_child
VALUE fd_dup2_child
Definition: internal.h:2064
RHASH_AR_TABLE_MAX_SIZE
#define RHASH_AR_TABLE_MAX_SIZE
Definition: internal.h:821
st_update_callback_func
int st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
Definition: st.h:131
rb_suppress_tracing
VALUE rb_suppress_tracing(VALUE(*func)(VALUE), VALUE arg)
Definition: vm_trace.c:415
rb_gc_for_fd
int rb_gc_for_fd(int err)
Definition: io.c:953
rb_mark_generic_ivar
void rb_mark_generic_ivar(VALUE)
Definition: variable.c:973
rb_lambda_call
VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv, rb_block_call_func_t bl_proc, int min_argc, int max_argc, VALUE data2)
Definition: vm_eval.c:1501
rb_execarg::chdir_dir
VALUE chdir_dir
Definition: internal.h:2067
rb_class_inherited
VALUE rb_class_inherited(VALUE, VALUE)
Calls Class::inherited.
Definition: class.c:623
rb_obj_not_equal
VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2)
Definition: object.c:187
klass
VALUE klass
Definition: rb_mjit_min_header-2.7.1.h:13259
rb_big_ge
VALUE rb_big_ge(VALUE x, VALUE y)
Definition: bignum.c:5495
Init_enc_set_filesystem_encoding
int Init_enc_set_filesystem_encoding(void)
Definition: localeinit.c:119
st_data_t
unsigned long st_data_t
Definition: rb_mjit_min_header-2.7.1.h:5363
rb_class_modify_check
void rb_class_modify_check(VALUE)
Asserts that klass is not a frozen class.
Definition: eval.c:438
rb_execarg::env_modification
VALUE env_modification
Definition: internal.h:2065
rb_fiber_init_mjit_cont
void rb_fiber_init_mjit_cont(struct rb_fiber_struct *fiber)
Definition: cont.c:1135
rb_big_lt
VALUE rb_big_lt(VALUE x, VALUE y)
Definition: bignum.c:5501
rb_hash_default_value
VALUE rb_hash_default_value(VALUE hash, VALUE key)
Definition: hash.c:1985
rb_hash_set_default_proc
VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc)
Definition: hash.c:2237
env
#define env
rb_opts_exception_p
int rb_opts_exception_p(VALUE opts, int default_value)
Definition: object.c:3125
rb_struct_lookup
VALUE rb_struct_lookup(VALUE s, VALUE idx)
Definition: struct.c:1104
rb_mutex_owned_p
VALUE rb_mutex_owned_p(VALUE self)
Definition: thread_sync.c:345
rb_iseq_struct
Definition: vm_core.h:456
ruby_value_type
ruby_value_type
Definition: ruby.h:486
ruby_static_id_signo
ID ruby_static_id_signo
Definition: eval.c:37
rb_class_has_methods
int rb_class_has_methods(VALUE c)
Definition: class.c:2201
rb_gvar_defined
VALUE rb_gvar_defined(struct rb_global_entry *)
Definition: variable.c:695
MEMO::flags
VALUE flags
Definition: internal.h:1279
RFloat
Definition: internal.h:798
rb_hash_st_table
st_table * rb_hash_st_table(VALUE hash)
Definition: hash.c:551
rb_execarg_run_options
int rb_execarg_run_options(const struct rb_execarg *e, struct rb_execarg *s, char *errmsg, size_t errmsg_buflen)
Definition: process.c:3392
rb_reg_match_p
VALUE rb_reg_match_p(VALUE re, VALUE str, long pos)
Definition: re.c:3340
rb_execarg_parent_start
void rb_execarg_parent_start(VALUE execarg_obj)
Definition: process.c:2816
rb_big_hash
VALUE rb_big_hash(VALUE)
Definition: bignum.c:6726
RBignum::len
size_t len
Definition: internal.h:753
rb_sym_intern
VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc)
Definition: symbol.c:1024
RBignum::basic
struct RBasic basic
Definition: internal.h:750
rb_classext_struct::subclasses
rb_subclass_entry_t * subclasses
Definition: internal.h:1028
rb_dbl_complex_new_polar_pi
VALUE rb_dbl_complex_new_polar_pi(double abs, double ang)
Definition: complex.c:667
rb_vm_thread_backtrace_locations
VALUE rb_vm_thread_backtrace_locations(int argc, const VALUE *argv, VALUE thval)
Definition: vm_backtrace.c:966
rb_match_count
int rb_match_count(VALUE match)
Definition: re.c:1299
CONSTFUNC
CONSTFUNC(VALUE rb_obj_equal(VALUE obj1, VALUE obj2))
rb_backtrace_each
void rb_backtrace_each(VALUE(*iter)(VALUE recv, VALUE str), VALUE output)
Definition: vm_backtrace.c:855
rb_vm_inc_const_missing_count
void rb_vm_inc_const_missing_count(void)
Definition: vm.c:386
FL_USER3
#define FL_USER3
Definition: ruby.h:1294
rb_gc_mark_values
void rb_gc_mark_values(long n, const VALUE *values)
Definition: gc.c:4717
RComplex::basic
struct RBasic basic
Definition: internal.h:806
rb_big_aref
VALUE rb_big_aref(VALUE x, VALUE y)
Definition: bignum.c:6681
rb_bug_reporter_add
int rb_bug_reporter_add(void(*func)(FILE *, void *), void *data)
Definition: error.c:455
rb_type_str
const char * rb_type_str(enum ruby_value_type type)
Definition: vm_eval.c:572
rb_global_entry::var
struct rb_global_variable * var
Definition: internal.h:1351
imemo_memo
@ imemo_memo
Definition: internal.h:1138
RUBY_FL_USHIFT
@ RUBY_FL_USHIFT
Definition: ruby.h:853
IMEMO_MASK
#define IMEMO_MASK
Definition: internal.h:1145
rb_immutable_obj_clone
VALUE rb_immutable_obj_clone(int, VALUE *, VALUE)
Definition: object.c:346
rb_func_lambda_new
VALUE rb_func_lambda_new(rb_block_call_func_t func, VALUE val, int min_argc, int max_argc)
Definition: proc.c:735
rb_equal_opt
VALUE rb_equal_opt(VALUE obj1, VALUE obj2)
Definition: rb_mjit_min_header-2.7.1.h:13443
RB_BUILTIN_TYPE
#define RB_BUILTIN_TYPE(x)
Definition: ruby.h:550
rb_int_abs
VALUE rb_int_abs(VALUE num)
Definition: numeric.c:4855
rb_singleton_class_internal_p
int rb_singleton_class_internal_p(VALUE sklass)
Definition: class.c:455
rb_file_expand_path_fast
VALUE rb_file_expand_path_fast(VALUE, VALUE)
Definition: file.c:4025
ruby_float_mod
double ruby_float_mod(double x, double y)
Definition: numeric.c:1207
rb_classext_struct::iv_tbl
struct st_table * iv_tbl
Definition: internal.h:1022
rb_num_get_rounding_option
enum ruby_num_rounding_mode rb_num_get_rounding_option(VALUE opts)
Definition: numeric.c:200
rb_ary_last
VALUE rb_ary_last(int, const VALUE *, VALUE)
Definition: array.c:1677
rb_int_positive_pow
VALUE rb_int_positive_pow(long x, unsigned long y)
Definition: numeric.c:4033
vm_ifunc_argc::max
int max
Definition: internal.h:1210
vm_ifunc_argc::min
int min
Definition: internal.h:1210
rb_search_class_path
VALUE rb_search_class_path(VALUE)
Definition: variable.c:175
ruby_mimmalloc
void * ruby_mimmalloc(size_t size) RUBY_ATTR_MALLOC
Definition: gc.c:10206
rb_obj_builtin_type
#define rb_obj_builtin_type(obj)
Definition: rb_mjit_min_header-2.7.1.h:8011
__asan_unpoison_memory_region
#define __asan_unpoison_memory_region(x, y)
Definition: internal.h:109
rb_num_to_uint
int rb_num_to_uint(VALUE val, unsigned int *ret)
Definition: numeric.c:244
CACHELINE
#define CACHELINE
Definition: internal.h:2359
rb_vm_check_optimizable_mid
int rb_vm_check_optimizable_mid(VALUE mid)
Definition: vm.c:1581
RRational::num
VALUE num
Definition: internal.h:790
rb_str2big_gmp
VALUE rb_str2big_gmp(VALUE arg, int base, int badcheck)
MEMO::v1
const VALUE v1
Definition: internal.h:1281
INT2FIX
#define INT2FIX(i)
Definition: ruby.h:263
rb_make_internal_id
ID rb_make_internal_id(void)
Definition: symbol.c:810
n
const char size_t n
Definition: rb_mjit_min_header-2.7.1.h:5456
RB_INT_PARSE_ALL
@ RB_INT_PARSE_ALL
Definition: internal.h:2466
rb_ary_memsize
size_t rb_ary_memsize(VALUE)
Definition: array.c:816
rb_execarg::gid
rb_gid_t gid
Definition: internal.h:2059
rb_float_gt
VALUE rb_float_gt(VALUE x, VALUE y)
Definition: numeric.c:1503
rb_call_cache::me
const struct rb_callable_method_entry_struct * me
Definition: internal.h:2378
rb_to_symbol_type
VALUE rb_to_symbol_type(VALUE obj)
Definition: symbol.c:1044
vm_ifunc::data
const void * data
Definition: internal.h:1219
ruby_xmalloc
void * ruby_xmalloc(size_t size)
Definition: gc.c:11969
rb_int2str
VALUE rb_int2str(VALUE num, int base)
Definition: numeric.c:3562
RHash::ifnone
const VALUE ifnone
Definition: internal.h:893
rb_struct_s_keyword_init
VALUE rb_struct_s_keyword_init(VALUE klass)
Definition: struct.c:52
rb_execarg::unsetenv_others_do
unsigned unsetenv_others_do
Definition: internal.h:2044
st
enum ruby_tag_type st
Definition: rb_mjit_min_header-2.7.1.h:11116
vm_ifunc::func
rb_block_call_func_t func
Definition: internal.h:1218
rb_class_remove_from_module_subclasses
void rb_class_remove_from_module_subclasses(VALUE)
Definition: class.c:94
rb_warning_category_enabled_p
bool rb_warning_category_enabled_p(rb_warning_category_t category)
Definition: error.c:164
RUBY_ATTR_ALLOC_SIZE
#define RUBY_ATTR_ALLOC_SIZE(params)
Definition: defines.h:226
RSTRING_PTR
#define RSTRING_PTR(str)
Definition: ruby.h:1009
rb_file_load_ok
int rb_file_load_ok(const char *)
Definition: file.c:6222
rb_class_ivar_set
int rb_class_ivar_set(VALUE klass, ID vid, VALUE value)
Definition: variable.c:3316
rb_file_expand_path_internal
VALUE rb_file_expand_path_internal(VALUE, VALUE, int, int, VALUE)
Definition: file.c:3646
__asan_poison_memory_region
#define __asan_poison_memory_region(x, y)
Definition: internal.h:108
cmp_opt_Float
@ cmp_opt_Float
Definition: internal.h:1318
rb_call_cache::method_missing_reason
enum method_missing_reason method_missing_reason
Definition: internal.h:2388
RTYPEDDATA_TYPE
#define RTYPEDDATA_TYPE(v)
Definition: ruby.h:1178
rb_big_mul_karatsuba
VALUE rb_big_mul_karatsuba(VALUE x, VALUE y)
Definition: bignum.c:1870
rb_iv_tbl_copy
void rb_iv_tbl_copy(VALUE dst, VALUE src)
Definition: variable.c:3332
rb_int2big
VALUE rb_int2big(intptr_t n)
Definition: bignum.c:3180
rb_float_equal
VALUE rb_float_equal(VALUE x, VALUE y)
Definition: numeric.c:1383
rb_objspace
Definition: gc.c:676
vm_throw_data::catch_frame
const struct rb_control_frame_struct * catch_frame
Definition: internal.h:1197
RFloat::basic
struct RBasic basic
Definition: internal.h:799
rb_fork_async_signal_safe
rb_pid_t rb_fork_async_signal_safe(int *status, int(*chfunc)(void *, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen)
rb_block_to_s
VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_info)
Definition: proc.c:1360
RCLASS_INCLUDER
#define RCLASS_INCLUDER(c)
Definition: internal.h:1082
FL_USER10
#define FL_USER10
Definition: ruby.h:1301
rb_backref_set_string
void rb_backref_set_string(VALUE string, long pos, long len)
Definition: re.c:1340
rb_str2big_poweroftwo
VALUE rb_str2big_poweroftwo(VALUE arg, int base, int badcheck)
Definition: bignum.c:4274
rb_rational_uminus
VALUE rb_rational_uminus(VALUE self)
Definition: rational.c:624
rb_gvar_readonly_setter
void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_)
Definition: variable.c:412
VALUE
unsigned long VALUE
Definition: ruby.h:102
rb_math_sin
VALUE rb_math_sin(VALUE)
rb_key_err_new
VALUE rb_key_err_new(VALUE mesg, VALUE recv, VALUE name)
Definition: error.c:1907
rb_to_array_type
VALUE rb_to_array_type(VALUE obj)
Definition: array.c:902
rb_hash_st_table_set
void rb_hash_st_table_set(VALUE hash, st_table *st)
Definition: hash.c:558
RB_TYPE_P
#define RB_TYPE_P(obj, type)
Definition: ruby.h:560
rb_fiber_reset_root_local_storage
void rb_fiber_reset_root_local_storage(struct rb_thread_struct *)
Definition: cont.c:2135
rb_rational_plus
VALUE rb_rational_plus(VALUE self, VALUE other)
Definition: rational.c:737
rb_big_fdiv_double
double rb_big_fdiv_double(VALUE x, VALUE y)
Definition: bignum.c:6209
rb_hash_add_new_element
int rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val)
Definition: hash.c:4541
Init_ext
void Init_ext(void)
Definition: dmyext.c:2
rb_callable_method_entry_struct
Definition: method.h:59
rb_str_memsize
size_t rb_str_memsize(VALUE)
Definition: string.c:1371
fmt
const VALUE int int int int int int VALUE char * fmt
Definition: rb_mjit_min_header-2.7.1.h:6462
rb_str_to_cstr
char * rb_str_to_cstr(VALUE str)
Definition: string.c:2284
rb_obj_info_dump_loc
void rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func)
Definition: gc.c:11687
RStruct::basic
struct RBasic basic
Definition: internal.h:943
rb_name_err_new
VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method)
Definition: error.c:1592
rb_execarg::pgroup_given
unsigned pgroup_given
Definition: internal.h:2041
imemo_iseq
@ imemo_iseq
Definition: internal.h:1140
rb_big_mul_gmp
VALUE rb_big_mul_gmp(VALUE x, VALUE y)
rb_call_cache::call
VALUE(* call)(struct rb_execution_context_struct *ec, struct rb_control_frame_struct *cfp, struct rb_calling_info *calling, struct rb_call_data *cd)
Definition: internal.h:2381
rb_math_log
VALUE rb_math_log(int argc, const VALUE *argv)
Definition: math.c:459
rb_obj_gc_flags
size_t rb_obj_gc_flags(VALUE, ID[], size_t)
RUBY_NUM_ROUND_HALF_EVEN
@ RUBY_NUM_ROUND_HALF_EVEN
Definition: internal.h:1789
imemo_env
@ imemo_env
Definition: internal.h:1133
rb_refinement_module_get_refined_class
VALUE rb_refinement_module_get_refined_class(VALUE module)
Definition: eval.c:1481
RRational
Definition: internal.h:788
RUBY_NUM_ROUND_HALF_DOWN
@ RUBY_NUM_ROUND_HALF_DOWN
Definition: internal.h:1790
rb_bool_expected
int rb_bool_expected(VALUE, const char *)
Definition: object.c:3112
rb_execarg::waitpid_state
struct waitpid_state * waitpid_state
Definition: internal.h:2054
rb_execarg::new_pgroup_given
unsigned new_pgroup_given
Definition: internal.h:2048
rb_objspace_set_event_hook
void rb_objspace_set_event_hook(const rb_event_flag_t event)
Definition: gc.c:2082
rb_num_negative_p
int rb_num_negative_p(VALUE)
Definition: numeric.c:313
FL_USER11
#define FL_USER11
Definition: ruby.h:1302
rb_parser_set_yydebug
VALUE rb_parser_set_yydebug(VALUE, VALUE)
Definition: ripper.c:19326
alias
const char * alias
Definition: nkf.c:1159
rb_int_ge
VALUE rb_int_ge(VALUE x, VALUE y)
Definition: numeric.c:4292
rb_ary_delete_same
void rb_ary_delete_same(VALUE, VALUE)
Definition: array.c:3396
rb_execarg::gid_given
unsigned gid_given
Definition: internal.h:2051
rb_is_local_name
int rb_is_local_name(VALUE name)
Definition: symbol.c:1068
uint64_t
unsigned long long uint64_t
Definition: sha2.h:102
rb_proc_location
VALUE rb_proc_location(VALUE self)
Definition: proc.c:1256
RIMemo::v0
VALUE v0
Definition: internal.h:1126
rb_float_pow
VALUE rb_float_pow(VALUE x, VALUE y)
Definition: numeric.c:1298
MAYBE_UNUSED
#define MAYBE_UNUSED(x)
Definition: internal.h:40
rb_big_even_p
VALUE rb_big_even_p(VALUE)
Definition: bignum.c:6840
rb_id_table
Definition: id_table.c:40
RSTRUCT_EMBED_LEN
#define RSTRUCT_EMBED_LEN(st)
Definition: internal.h:957
rb_ary_ptr_use_start
VALUE * rb_ary_ptr_use_start(VALUE ary)
Definition: array.c:226
arg
VALUE arg
Definition: rb_mjit_min_header-2.7.1.h:5601
ruby_thread_has_gvl_p
int ruby_thread_has_gvl_p(void)
Definition: thread.c:1705
rb_int_pow
VALUE rb_int_pow(VALUE x, VALUE y)
Definition: numeric.c:4106
RB_INT_PARSE_PREFIX
@ RB_INT_PARSE_PREFIX
Definition: internal.h:2465
RB_WARN_CATEGORY_NONE
@ RB_WARN_CATEGORY_NONE
Definition: internal.h:1561
rb_is_attrset_sym
int rb_is_attrset_sym(VALUE sym)
Definition: symbol.c:902
rb_class_detach_module_subclasses
void rb_class_detach_module_subclasses(VALUE)
Definition: class.c:145
rb_gvar_is_traced
bool rb_gvar_is_traced(const struct rb_global_entry *)
Definition: variable.c:714
vm_svar::backref
const VALUE backref
Definition: internal.h:1185
PUREFUNC
PUREFUNC(int rb_data_is_encoding(VALUE obj))
rb_gvar_getter_t
VALUE rb_gvar_getter_t(ID id, VALUE *data)
Definition: ruby.h:1782
Qundef
#define Qundef
Definition: ruby.h:470
imemo
union @11::@13 imemo
rb_econv_t
Definition: transcode.c:111
CHAR_BIT
#define CHAR_BIT
Definition: ruby.h:227
MEMO::reserved
VALUE reserved
Definition: internal.h:1280
RHASH_ST_TABLE_FLAG
@ RHASH_ST_TABLE_FLAG
Definition: internal.h:820
rb_singleton_class_get
VALUE rb_singleton_class_get(VALUE obj)
Returns the singleton class of obj, or nil if obj is not a singleton object.
Definition: class.c:1694
rb_obj_copy_ivar
void rb_obj_copy_ivar(VALUE dest, VALUE obj)
Definition: object.c:247
rb_get_path_check_to_string
VALUE rb_get_path_check_to_string(VALUE)
Definition: file.c:196
rb_hash_stlike_update
int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func func, st_data_t arg)
Definition: hash.c:1646
rb_call_cache::method_serial
uintptr_t method_serial
Definition: internal.h:2379
rb_calling_info
Definition: vm_core.h:250
ptr
struct RIMemo * ptr
Definition: debug.c:74
rb_int_and
VALUE rb_int_and(VALUE x, VALUE y)
Definition: numeric.c:4467
rb_call_cache::method_state
rb_serial_t method_state
Definition: internal.h:2362
vm_ifunc
IFUNC (Internal FUNCtion)
Definition: internal.h:1215
rb_enc_set_base
void rb_enc_set_base(const char *name, const char *orig)
Definition: encoding.c:382
rb_class_subclass_add
void rb_class_subclass_add(VALUE super, VALUE klass)
Definition: class.c:36
T_DATA
#define T_DATA
Definition: ruby.h:538
cmp_opt_data::opt_inited
unsigned int opt_inited
Definition: internal.h:1324
stdbool.h
Qfalse
#define Qfalse
Definition: ruby.h:467
rb_encdb_alias
int rb_encdb_alias(const char *alias, const char *orig)
Definition: encoding.c:565
rb_float_abs
VALUE rb_float_abs(VALUE flt)
Definition: numeric.c:1698
rb_hash_stlike_delete
int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval)
Definition: hash.c:2305
rb_eql_opt
VALUE rb_eql_opt(VALUE obj1, VALUE obj2)
Definition: rb_mjit_min_header-2.7.1.h:13449
rb_execarg::unsetenv_others_given
unsigned unsetenv_others_given
Definition: internal.h:2043
uintptr_t
unsigned int uintptr_t
Definition: win32.h:106
rb_int_lshift
VALUE rb_int_lshift(VALUE x, VALUE y)
Definition: numeric.c:4583
RHash::st
st_table * st
Definition: internal.h:890
__asan_region_is_poisoned
#define __asan_region_is_poisoned(x, y)
Definition: internal.h:110
rb_execarg::argv_buf
VALUE argv_buf
Definition: internal.h:2033
rb_gvar_setter_t
void rb_gvar_setter_t(VALUE val, ID id, VALUE *data)
Definition: ruby.h:1783
rb_external_str_with_enc
VALUE rb_external_str_with_enc(VALUE str, rb_encoding *eenc)
Definition: string.c:1074
rb_str_eql
VALUE rb_str_eql(VALUE str1, VALUE str2)
Definition: string.c:3287
RFloat::float_value
double float_value
Definition: internal.h:800
ruby_digit36_to_number_table
const signed char ruby_digit36_to_number_table[]
Definition: escape.c:6
rb_numeric_quo
VALUE rb_numeric_quo(VALUE x, VALUE y)
Definition: rational.c:2014
rb_ivar_lookup
VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef)
Definition: variable.c:1035
rb_rational_reciprocal
VALUE rb_rational_reciprocal(VALUE x)
Definition: rational.c:1875
rb_enumerator_size_func
VALUE rb_enumerator_size_func(VALUE, VALUE, VALUE)
Definition: intern.h:256
rb_cInteger
RUBY_EXTERN VALUE rb_cInteger
Definition: ruby.h:2031
rb_stderr_tty_p
int rb_stderr_tty_p(void)
Definition: io.c:7958
rb_match_nth_defined
int rb_match_nth_defined(int nth, VALUE match)
Definition: re.c:1309
rb_enc_set_dummy
int rb_enc_set_dummy(int index)
Definition: encoding.c:393
RSTRUCT_ENUM_END
@ RSTRUCT_ENUM_END
Definition: internal.h:929
rb_gcd_gmp
VALUE rb_gcd_gmp(VALUE x, VALUE y)
rb_parser_load_file
RUBY_SYMBOL_EXPORT_END void * rb_parser_load_file(VALUE parser, VALUE name)
Definition: ruby.c:2193
rb_vm_insn_addr2insn
int rb_vm_insn_addr2insn(const void *)
Definition: iseq.c:3111
RIMemo::flags
VALUE flags
Definition: internal.h:1125
NULL
#define NULL
Definition: _sdbm.c:101
RIMemo
Definition: internal.h:1124
MUL_OVERFLOW_FIXNUM_P
#define MUL_OVERFLOW_FIXNUM_P(a, b)
Definition: internal.h:273
rb_print_backtrace
void rb_print_backtrace(void)
Definition: vm_dump.c:750
rb_check_realpath
VALUE rb_check_realpath(VALUE basedir, VALUE path, rb_encoding *enc)
Definition: file.c:4417
rb_execarg::pgroup_pgid
rb_pid_t pgroup_pgid
Definition: internal.h:2055
vm_ifunc::argc
struct vm_ifunc_argc argc
Definition: internal.h:1220
uint32_t
unsigned int uint32_t
Definition: sha2.h:101
SafeStringValue
#define SafeStringValue(v)
Definition: ruby.h:607
imemo_svar
@ imemo_svar
special variable
Definition: internal.h:1135
rb_require_internal
int rb_require_internal(VALUE fname)
Definition: load.c:1066
rb_ary_aref1
VALUE rb_ary_aref1(VALUE ary, VALUE i)
Definition: array.c:1595
vm_svar::others
const VALUE others
Definition: internal.h:1186
rb_float_new_in_heap
VALUE rb_float_new_in_heap(double)
Definition: numeric.c:895
rb_class_remove_from_super_subclasses
void rb_class_remove_from_super_subclasses(VALUE)
Definition: class.c:76
RVALUE
Definition: gc.c:566
rb_execarg::cmd
struct rb_execarg::@110::@112 cmd
rb_obj_info_dump
void rb_obj_info_dump(VALUE obj)
Definition: gc.c:11680
RUBY_BIT_ROTR
#define RUBY_BIT_ROTR(v, n)
Definition: internal.h:1895
ruby_static_id_status
ID ruby_static_id_status
Definition: internal.h:1587
int128_t
#define int128_t
Definition: rb_mjit_min_header-2.7.1.h:232
rb_classext_struct::const_tbl
struct rb_id_table * const_tbl
Definition: internal.h:1026
MISSING_NONE
@ MISSING_NONE
Definition: internal.h:2342
Init_heap
void Init_heap(void)
Definition: gc.c:2911
rb_local_defined
int rb_local_defined(ID, const struct rb_iseq_struct *)
rb_hash_ar_table_p
int rb_hash_ar_table_p(VALUE hash)
Definition: hash.c:532
RUBY_T_MASK
@ RUBY_T_MASK
Definition: ruby.h:518
rb_int_powm
VALUE rb_int_powm(int const argc, VALUE *const argv, VALUE const num)
Definition: bignum.c:7112
rb_str_cat_conv_enc_opts
VALUE rb_str_cat_conv_enc_opts(VALUE newstr, long ofs, const char *ptr, long len, rb_encoding *from, int ecflags, VALUE ecopts)
Definition: string.c:943
FL_SET
#define FL_SET(x, f)
Definition: ruby.h:1359
ruby_is_fd_loadable
int ruby_is_fd_loadable(int fd)
Definition: file.c:6195
rb_pid_t
#define rb_pid_t
Definition: rb_mjit_min_header-2.7.1.h:99
RSTRUCT_EMBED_LEN_MAX
#define RSTRUCT_EMBED_LEN_MAX
Definition: internal.h:919
FIX2LONG
#define FIX2LONG(x)
Definition: ruby.h:394
rb_execarg::close_others_maxhint
int close_others_maxhint
Definition: internal.h:2060
rb_int_idiv
VALUE rb_int_idiv(VALUE x, VALUE y)
Definition: numeric.c:3843
Init_vm_eval
void Init_vm_eval(void)
Definition: vm_eval.c:2472
rb_blocking_function_t
VALUE rb_blocking_function_t(void *)
Definition: intern.h:941
ruby_initial_load_paths
const char ruby_initial_load_paths[]
Definition: loadpath.c:62
rb_copy_wb_protected_attribute
void rb_copy_wb_protected_attribute(VALUE dest, VALUE obj)
Definition: gc.c:6940
RB_WARN_CATEGORY_EXPERIMENTAL
@ RB_WARN_CATEGORY_EXPERIMENTAL
Definition: internal.h:1563
rb_call_info::orig_argc
int orig_argc
Definition: internal.h:2396
RB_INT_PARSE_DEFAULT
@ RB_INT_PARSE_DEFAULT
Definition: internal.h:2467
rb_math_hypot
VALUE rb_math_hypot(VALUE, VALUE)
rb_autoload_at_p
VALUE rb_autoload_at_p(VALUE, ID, int)
Definition: variable.c:2287
imemo_throw_data
@ imemo_throw_data
Definition: internal.h:1136
rb_big_sq_fast
VALUE rb_big_sq_fast(VALUE x)
Definition: bignum.c:1630
MEMO
MEMO.
Definition: internal.h:1278
rb_int_uminus
VALUE rb_int_uminus(VALUE num)
Definition: numeric.c:3479
rb_gcd_normal
VALUE rb_gcd_normal(VALUE self, VALUE other)
Definition: rational.c:344
rb_write_error_str
void rb_write_error_str(VALUE mesg)
Definition: io.c:7936
rb_backtrace_to_location_ary
VALUE rb_backtrace_to_location_ary(VALUE obj)
Definition: vm_backtrace.c:686
RUBY_FUNC_EXPORTED
#define RUBY_FUNC_EXPORTED
Definition: defines.h:391
rb_reg_search0
long rb_reg_search0(VALUE, VALUE, long, int, int)
Definition: re.c:1530
MISSING_MISSING
@ MISSING_MISSING
Definition: internal.h:2341
waitpid_state
Definition: process.c:943
rb_strterm_mark
void rb_strterm_mark(VALUE obj)
Definition: ripper.c:765
rb_str_locktmp_ensure
VALUE rb_str_locktmp_ensure(VALUE str, VALUE(*func)(VALUE), VALUE arg)
Definition: string.c:2685
rb_get_expanded_load_path
VALUE rb_get_expanded_load_path(void)
Definition: load.c:92
imemo_ast
@ imemo_ast
Definition: internal.h:1142
rb_float_denominator
VALUE rb_float_denominator(VALUE x)
Definition: rational.c:2104
rb_big2str_gmp
VALUE rb_big2str_gmp(VALUE x, int base)
rb_big2str_generic
VALUE rb_big2str_generic(VALUE x, int base)
Definition: bignum.c:5004
UNLIMITED_ARGUMENTS
#define UNLIMITED_ARGUMENTS
Definition: intern.h:57
rb_call_cache::index
unsigned int index
Definition: internal.h:2387
rb_str_fill_terminator
char * rb_str_fill_terminator(VALUE str, const int termlen)
Definition: string.c:2306
RBignum::as
union RBignum::@103 as
rb_file_const
void rb_file_const(const char *, VALUE)
Definition: file.c:6083
rb_reg_compile
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline)
Definition: re.c:2953
rb_str_opt_plus
VALUE rb_str_opt_plus(VALUE, VALUE)
Definition: string.c:1925
mode_t
__mode_t mode_t
Definition: rb_mjit_min_header-2.7.1.h:1331
RCLASS_ORIGIN
#define RCLASS_ORIGIN(c)
Definition: internal.h:1075
rb_imemo_tmpbuf_struct::cnt
size_t cnt
Definition: internal.h:1236
RRational::basic
struct RBasic basic
Definition: internal.h:789
MEMO::u3
union MEMO::@109 u3
rb_str_tmp_frozen_acquire
VALUE rb_str_tmp_frozen_acquire(VALUE str)
Definition: string.c:1210
RClass::super
VALUE super
Definition: internal.h:1050
rb_call_cache
Definition: internal.h:2360
BDIGIT
#define BDIGIT
Definition: internal.h:688
FL_USER5
#define FL_USER5
Definition: ruby.h:1296
rb_execarg::fd_open
VALUE fd_open
Definition: internal.h:2063
Init_BareVM
void Init_BareVM(void)
Definition: vm.c:3301
rb_time_timeval
struct timeval rb_time_timeval(VALUE)
Definition: time.c:2675
RUBY_NUM_ROUND_HALF_UP
@ RUBY_NUM_ROUND_HALF_UP
Definition: internal.h:1788
rb_mark_end_proc
void rb_mark_end_proc(void)
Definition: eval_jump.c:78
rb_home_dir_of
VALUE rb_home_dir_of(VALUE user, VALUE result)
Definition: file.c:3536
rb_int_odd_p
VALUE rb_int_odd_p(VALUE num)
Definition: numeric.c:3222
imemo_parser_strterm
@ imemo_parser_strterm
Definition: internal.h:1143
rb_int_succ
VALUE rb_int_succ(VALUE num)
Definition: numeric.c:3321
LONG2NUM
#define LONG2NUM(x)
Definition: ruby.h:1644
rb_int_fdiv_double
double rb_int_fdiv_double(VALUE x, VALUE y)
Definition: numeric.c:3728
RStruct::ptr
const VALUE * ptr
Definition: internal.h:947
void
void
Definition: rb_mjit_min_header-2.7.1.h:13278
BIGNUM_POSITIVE_P
#define BIGNUM_POSITIVE_P(b)
Definition: internal.h:765
MISSING_PROTECTED
@ MISSING_PROTECTED
Definition: internal.h:2337
rb_ary_detransient
void rb_ary_detransient(VALUE a)
Definition: array.c:408
rb_special_singleton_class
VALUE rb_special_singleton_class(VALUE)
Definition: class.c:1621
rb_big_divrem_normal
VALUE rb_big_divrem_normal(VALUE x, VALUE y)
Definition: bignum.c:2714
rb_fstring_enc_new
VALUE rb_fstring_enc_new(const char *ptr, long len, rb_encoding *enc)
Definition: string.c:403
SIZEOF_VALUE
#define SIZEOF_VALUE
Definition: ruby.h:105
rb_fix_plus
VALUE rb_fix_plus(VALUE x, VALUE y)
Definition: numeric.c:3604
rb_big_size
size_t rb_big_size(VALUE)
Definition: bignum.c:6778
rb_sym_intern_ascii
VALUE rb_sym_intern_ascii(const char *ptr, long len)
Definition: symbol.c:1032
RUBY_FUNC_NONNULL
RUBY_FUNC_EXPORTED RUBY_FUNC_NONNULL(1, VALUE rb_funcallv_with_cc(struct rb_call_data *, VALUE, ID, int, const VALUE *))
RICLASS_IS_ORIGIN
#define RICLASS_IS_ORIGIN
Definition: internal.h:1085
rb_classext_struct::includer
const VALUE includer
Definition: internal.h:1042
rb_int_negative_p
int rb_int_negative_p(VALUE num)
Definition: numeric.c:307
rb_global_entry::id
ID id
Definition: internal.h:1352
rb_vraise
void rb_vraise(VALUE exc, const char *fmt, va_list ap)
Definition: error.c:2663
rb_load_fail
void rb_load_fail(VALUE path, const char *err)
Definition: error.c:2965
rb_const_missing
VALUE rb_const_missing(VALUE klass, VALUE name)
Definition: variable.c:1694
rb_yield_refine_block
VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements)
Definition: vm_eval.c:1885
st_foreach_check_callback_func
int st_foreach_check_callback_func(st_data_t, st_data_t, st_data_t, int)
Definition: st.h:138
imemo_type
imemo_type
Definition: internal.h:1132
vm_throw_data::throw_obj
const VALUE throw_obj
Definition: internal.h:1196
vm_svar
SVAR (Special VARiable)
Definition: internal.h:1181
rb_execarg::command_abspath
VALUE command_abspath
Definition: internal.h:2031
rb_thread_shield_new
VALUE rb_thread_shield_new(void)
Definition: thread.c:4790
rb_thread_shield_wait
VALUE rb_thread_shield_wait(VALUE self)
Definition: thread.c:4806
rb_float_numerator
VALUE rb_float_numerator(VALUE x)
Definition: rational.c:2081
rb_hash_tbl_raw
struct st_table * rb_hash_tbl_raw(VALUE hash)
Definition: hash.c:1589
rb_str_upto_endless_each
VALUE rb_str_upto_endless_each(VALUE, int(*each)(VALUE, VALUE), VALUE)
Definition: string.c:4345
rb_str_buf_cat_escaped_char
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p)
Definition: string.c:5815
rb_execarg::fd_dup2
VALUE fd_dup2
Definition: internal.h:2061
rb_deprecated_classext_struct
Definition: classext.h:10
rb_backtrace_to_str_ary
VALUE rb_backtrace_to_str_ary(VALUE obj)
Definition: vm_backtrace.c:620
rb_vm_pop_cfunc_frame
MJIT_STATIC void rb_vm_pop_cfunc_frame(void)
Definition: rb_mjit_min_header-2.7.1.h:17288
rb_int_mul
VALUE rb_int_mul(VALUE x, VALUE y)
Definition: numeric.c:3699
rb_sys_enc_warning
void rb_sys_enc_warning(rb_encoding *enc, const char *fmt,...)
Definition: error.c:2943
rb_cEncodingConverter
VALUE rb_cEncodingConverter
Definition: transcode.c:25
rb_gvar_setter_function_of
rb_gvar_setter_t * rb_gvar_setter_function_of(const struct rb_global_entry *)
Definition: variable.c:708
rb_undef_methods_from
void rb_undef_methods_from(VALUE klass, VALUE super)
Definition: class.c:1589
rb_imemo_tmpbuf_struct::ptr
VALUE * ptr
Definition: internal.h:1234
rb_thread_execute_interrupts
void rb_thread_execute_interrupts(VALUE th)
Definition: thread.c:2284
rb_float_plus
VALUE rb_float_plus(VALUE x, VALUE y)
Definition: numeric.c:1024
rb_execarg::umask_mask
mode_t umask_mask
Definition: internal.h:2057
rb_encoding
const typedef OnigEncodingType rb_encoding
Definition: encoding.h:115
rb_parser_set_context
RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_parser_set_context(VALUE, const struct rb_iseq_struct *, int)
Definition: ripper.c:19231
rb_ident_hash_new
VALUE rb_ident_hash_new(void)
Definition: hash.c:4272
rb_is_class_name
int rb_is_class_name(VALUE name)
Definition: symbol.c:1056
RHASH_ENUM_END
@ RHASH_ENUM_END
Definition: internal.h:838
vm_svar::lastline
const VALUE lastline
Definition: internal.h:1184
rb_execarg::new_pgroup_flag
unsigned new_pgroup_flag
Definition: internal.h:2049
rb_int_div
VALUE rb_int_div(VALUE x, VALUE y)
Definition: numeric.c:3816
rb_fstring_cstr
VALUE rb_fstring_cstr(const char *str)
Definition: string.c:410
cfp
rb_control_frame_t * cfp
Definition: rb_mjit_min_header-2.7.1.h:14564
rb_obj_is_fiber
VALUE rb_obj_is_fiber(VALUE)
Definition: cont.c:1041
rb_uid_t
#define rb_uid_t
Definition: rb_mjit_min_header-2.7.1.h:105
rb_sym_to_proc
VALUE rb_sym_to_proc(VALUE sym)
Definition: proc.c:1312
MISSING_VCALL
@ MISSING_VCALL
Definition: internal.h:2339
rb_nomethod_err_new
VALUE rb_nomethod_err_new(VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv)
Definition: error.c:1673
rb_big_divrem_gmp
VALUE rb_big_divrem_gmp(VALUE x, VALUE y)
rb_obj_protected_methods
VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj)
Definition: class.c:1380
cmp_optimizable_count
@ cmp_optimizable_count
Definition: internal.h:1319
rb_obj_is_thread
VALUE rb_obj_is_thread(VALUE obj)
Definition: vm.c:2655
ruby_scan_digits
unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow)
Definition: util.c:97
rb_thread_io_blocking_region
VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd)
Definition: thread.c:1595
rb_math_sinh
VALUE rb_math_sinh(VALUE)
rb_setup_fake_str
VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc)
Definition: string.c:385
rb_obj_dig
VALUE rb_obj_dig(int argc, VALUE *argv, VALUE self, VALUE notfound)
Definition: object.c:3791
rb_vm_get_insns_address_table
const void ** rb_vm_get_insns_address_table(void)
Definition: vm_exec.c:126
rb_convert_type_with_id
VALUE rb_convert_type_with_id(VALUE, int, const char *, ID)
Definition: object.c:2914
__msan_allocated_memory
#define __msan_allocated_memory(x, y)
Definition: internal.h:120
rb_execarg::dup2_tmpbuf
VALUE dup2_tmpbuf
Definition: internal.h:2039
st_foreach_callback_func
int st_foreach_callback_func(st_data_t, st_data_t, st_data_t)
Definition: st.h:137
rb_global_entry
struct rb_global_entry * rb_global_entry(ID)
Definition: variable.c:326
FL_USER2
#define FL_USER2
Definition: ruby.h:1293
rb_int_parse_cstr
VALUE rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits, int base, int flags)
Definition: bignum.c:4041
RSTRUCT_EMBED_LEN_MASK
#define RSTRUCT_EMBED_LEN_MASK
Definition: internal.h:920
rb_io_memsize
RUBY_FUNC_EXPORTED size_t rb_io_memsize(const rb_io_t *fptr)
Definition: io.c:4760
rb_serial_t
unsigned long rb_serial_t
Definition: internal.h:1014
rb_yield_1
VALUE rb_yield_1(VALUE val)
Definition: vm_eval.c:1231
rb_gvar_set
VALUE rb_gvar_set(struct rb_global_entry *, VALUE)
Definition: variable.c:654
rb_execarg_new
VALUE rb_execarg_new(int argc, const VALUE *argv, int accept_shell, int allow_exc_opt)
Definition: process.c:2633
rb_vm_top_self
VALUE rb_vm_top_self(void)
Definition: vm.c:3347
NORETURN
NORETURN(void rb_async_bug_errno(const char *, int))
ROUND_DEFAULT
#define ROUND_DEFAULT
Definition: internal.h:1785
rb_lcm
VALUE rb_lcm(VALUE x, VALUE y)
Definition: rational.c:1913
ruby_sized_xrealloc
RUBY_SYMBOL_EXPORT_BEGIN void * ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2))
Definition: gc.c:10126
rb_insns_name
const char * rb_insns_name(int i)
Definition: compile.c:8761
rb_sym_proc_call
VALUE rb_sym_proc_call(ID mid, int argc, const VALUE *argv, int kw_splat, VALUE passed_proc)
Definition: string.c:10816
FL_USER1
#define FL_USER1
Definition: ruby.h:1292
rb_vm_ifunc_new
struct vm_ifunc * rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc)
Definition: proc.c:699
rb_method_basic_definition_p
#define rb_method_basic_definition_p(klass, mid)
Definition: rb_mjit_min_header-2.7.1.h:7905
rb_match_unbusy
void rb_match_unbusy(VALUE)
Definition: re.c:1293
sym
#define sym(x)
Definition: date_core.c:3716
rb_builtin_type_name
const char * rb_builtin_type_name(int t)
Definition: error.c:761
mask
enum @11::@13::@14 mask
cmp_opt_String
@ cmp_opt_String
Definition: internal.h:1317
RMoved::flags
VALUE flags
Definition: internal.h:909
RCLASS
#define RCLASS(obj)
Definition: ruby.h:1269
rb_f_send
VALUE rb_f_send(int argc, VALUE *argv, VALUE recv)
Definition: vm_eval.c:1188
rb_imemo_tmpbuf_struct::next
struct rb_imemo_tmpbuf_struct * next
Definition: internal.h:1235
rb_check_funcall_hook
void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE)
Definition: internal.h:2313
abs
int abs(int)
rb_big_comp
VALUE rb_big_comp(VALUE x)
Definition: bignum.c:5564
vm_svar::cref_or_me
const VALUE cref_or_me
class reference or rb_method_entry_t
Definition: internal.h:1183
rb_execarg::shell_script
VALUE shell_script
Definition: internal.h:2027
rb_hash_rehash
VALUE rb_hash_rehash(VALUE hash)
Definition: hash.c:1953
RBasicRaw::klass
VALUE klass
Definition: internal.h:1983
max_argc
const rb_iseq_t const int const int const int max_argc
Definition: rb_mjit_min_header-2.7.1.h:13510
rb_enc_check_str
rb_encoding * rb_enc_check_str(VALUE str1, VALUE str2)
Definition: encoding.c:880
rb_hash_keys
VALUE rb_hash_keys(VALUE hash)
Definition: hash.c:3403
rb_big_uminus
VALUE rb_big_uminus(VALUE x)
Definition: bignum.c:5554
rb_execarg::uid_given
unsigned uid_given
Definition: internal.h:2050
rb_execarg_get
struct rb_execarg * rb_execarg_get(VALUE execarg_obj)
Definition: process.c:2608
RUBY_BIT_ROTL
#define RUBY_BIT_ROTL(v, n)
Definition: internal.h:1894
st_index_t
st_data_t st_index_t
Definition: st.h:50
MISSING_FCALL
@ MISSING_FCALL
Definition: internal.h:2338
rb_encdb_declare
void rb_encdb_declare(const char *name)
Definition: encoding.c:350
RComplex::real
VALUE real
Definition: internal.h:807
Init_vm_backtrace
void Init_vm_backtrace(void)
Definition: vm_backtrace.c:1045
rb_include_class_new
VALUE rb_include_class_new(VALUE, VALUE)
Definition: class.c:825
rb_obj_public_methods
VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj)
Definition: class.c:1410
rb_vm_add_root_module
int rb_vm_add_root_module(ID id, VALUE module)
Definition: vm.c:2312
ruby.h
vm_throw_data
THROW_DATA.
Definition: internal.h:1193
vm_throw_data::flags
VALUE flags
Definition: internal.h:1194
rb_integer_float_cmp
VALUE rb_integer_float_cmp(VALUE x, VALUE y)
Definition: bignum.c:5325
rb_make_backtrace
VALUE rb_make_backtrace(void)
Definition: vm_backtrace.c:872
RMoved::next
VALUE next
Definition: internal.h:911
cnt
rb_atomic_t cnt[RUBY_NSIG]
Definition: signal.c:503
rb_enc_str_scrub
VALUE rb_enc_str_scrub(rb_encoding *enc, VALUE str, VALUE repl)
Definition: string.c:10255
va_list
__gnuc_va_list va_list
Definition: rb_mjit_min_header-2.7.1.h:836
RIMemo::v2
VALUE v2
Definition: internal.h:1128
rb_classext_struct::refined_class
const VALUE refined_class
Definition: internal.h:1040
RUBY_ATTR_RETURNS_NONNULL
#define RUBY_ATTR_RETURNS_NONNULL
Definition: defines.h:244
rb_io_fptr_finalize_internal
void rb_io_fptr_finalize_internal(void *ptr)
Definition: io.c:4730
rb_io_flush_raw
VALUE rb_io_flush_raw(VALUE, int)
Definition: io.c:1864
rb_encdb_set_unicode
void rb_encdb_set_unicode(int index)
Definition: encoding.c:576
rb_call_data::cc
struct rb_call_cache cc
Definition: internal.h:2399
rb_big_remainder
VALUE rb_big_remainder(VALUE x, VALUE y)
Definition: bignum.c:6119
rb_source_location_cstr
const char * rb_source_location_cstr(int *pline)
Definition: vm.c:1376
RHASH_PASS_AS_KEYWORDS
@ RHASH_PASS_AS_KEYWORDS
Definition: internal.h:818
RRational::den
VALUE den
Definition: internal.h:791
rb_obj_is_mutex
VALUE rb_obj_is_mutex(VALUE obj)
Definition: thread_sync.c:131
obj2
VALUE obj2
Definition: rb_mjit_min_header-2.7.1.h:7588
RSTRUCT_EMBED_LEN_SHIFT
#define RSTRUCT_EMBED_LEN_SHIFT
Definition: internal.h:921
rb_int_parse_flags
rb_int_parse_flags
Definition: internal.h:2462
RSTRUCT_TRANSIENT_FLAG
@ RSTRUCT_TRANSIENT_FLAG
Definition: internal.h:927
rb_call_info::mid
ID mid
Definition: internal.h:2394
rb_backtrace_print_as_bugreport
void rb_backtrace_print_as_bugreport(void)
Definition: vm_backtrace.c:813
rb_get_coverages
VALUE rb_get_coverages(void)
Definition: thread.c:5477
rb_aligned_malloc
void * rb_aligned_malloc(size_t, size_t) RUBY_ATTR_MALLOC RUBY_ATTR_ALLOC_SIZE((2))
Definition: gc.c:9629
rb_enc_get_from_index
rb_encoding * rb_enc_get_from_index(int index)
Definition: encoding.c:618
rb_ary_behead
VALUE rb_ary_behead(VALUE, long)
Definition: array.c:1369
rb_gc_mark_global_tbl
void rb_gc_mark_global_tbl(void)
Definition: variable.c:434
rb_call_inits
void rb_call_inits(void)
Definition: inits.c:19
rb_fiber_struct
Definition: cont.c:226
RClass::basic
struct RBasic basic
Definition: internal.h:1049
MEMO::cnt
long cnt
Definition: internal.h:1284
rb_size_mul_or_raise
size_t rb_size_mul_or_raise(size_t, size_t, VALUE)
Definition: gc.c:192
rb_wb_unprotected_newobj_of
VALUE rb_wb_unprotected_newobj_of(VALUE, VALUE)
Definition: gc.c:2274
ruby_sized_xrealloc2
void * ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2
mjit_resume
VALUE mjit_resume(void)
rb_gc_writebarrier_remember
void rb_gc_writebarrier_remember(VALUE obj)
Definition: gc.c:6877
rb_execarg::envp_str
VALUE envp_str
Definition: internal.h:2037
mjit_enabled
#define mjit_enabled
Definition: internal.h:1765
mod
#define mod(x, y)
Definition: date_strftime.c:28
rb_control_frame_struct
Definition: vm_core.h:760
rb_call_cache::class_serial
rb_serial_t class_serial[(CACHELINE - sizeof(rb_serial_t) - sizeof(struct rb_callable_method_entry_struct *) - sizeof(uintptr_t) - sizeof(enum method_missing_reason) - sizeof(VALUE(*)(struct rb_execution_context_struct *e, struct rb_control_frame_struct *, struct rb_calling_info *, const struct rb_call_data *)))/sizeof(rb_serial_t)]
Definition: internal.h:2375
rb_mv_generic_ivar
void rb_mv_generic_ivar(VALUE src, VALUE dst)
Definition: variable.c:983
FL_USHIFT
#define FL_USHIFT
Definition: ruby.h:1289
rb_uninterruptible
VALUE rb_uninterruptible(VALUE(*b_proc)(VALUE), VALUE data)
Definition: thread.c:5554
rb_async_bug_errno
void rb_async_bug_errno(const char *mesg, int errno_arg)
Definition: error.c:688
rb_class_boot
VALUE rb_class_boot(VALUE)
A utility function that wraps class_alloc.
Definition: class.c:201
size
int size
Definition: encoding.c:58
rb_classext_struct::module_subclasses
rb_subclass_entry_t ** module_subclasses
In the case that this is an ICLASS, module_subclasses points to the link in the module's subclasses l...
Definition: internal.h:1035
rb_vm_mark
void rb_vm_mark(void *ptr)
Definition: vm.c:2243
FIXNUM_P
#define FIXNUM_P(f)
Definition: ruby.h:396
rb_big_mul_toom3
VALUE rb_big_mul_toom3(VALUE x, VALUE y)
Definition: bignum.c:2267
RString
Definition: ruby.h:988
rb_arith_seq_new
VALUE rb_arith_seq_new(VALUE obj, VALUE meth, int argc, VALUE const *argv, rb_enumerator_size_func *size_fn, VALUE beg, VALUE end, VALUE step, int excl)
Definition: enumerator.c:3308
RCLASS_SUPER
#define RCLASS_SUPER(c)
Definition: classext.h:16
ruby_initial_gc_stress_ptr
VALUE * ruby_initial_gc_stress_ptr
Definition: gc.c:905
RHASH_AR_TABLE_BOUND_MASK
#define RHASH_AR_TABLE_BOUND_MASK
Definition: internal.h:866
rb_struct_init_copy
VALUE rb_struct_init_copy(VALUE copy, VALUE s)
Definition: struct.c:977
rb_eEWOULDBLOCK
VALUE rb_eEWOULDBLOCK
Definition: error.c:55
rb_int128t2big
VALUE rb_int128t2big(__int128 n)
RClass::ptr
rb_classext_t * ptr
Definition: internal.h:1051
rb_classext_struct::allocator
rb_alloc_func_t allocator
Definition: internal.h:1041
OnigEncodingUTF_8
const ONIG_EXTERN OnigEncodingType OnigEncodingUTF_8
Definition: onigmo.h:201
cmp_opt_data
Definition: internal.h:1322
rb_int_modulo
VALUE rb_int_modulo(VALUE x, VALUE y)
Definition: numeric.c:3886
rb_gc_free_dsymbol
void rb_gc_free_dsymbol(VALUE)
Definition: symbol.c:678
DL2NUM
#define DL2NUM(x)
Definition: rb_mjit_min_header-2.7.1.h:6720
rb_check_to_array
VALUE rb_check_to_array(VALUE ary)
Definition: array.c:915
rb_execarg_extract_options
VALUE rb_execarg_extract_options(VALUE execarg_obj, VALUE opthash)
Definition: process.c:2279
rb_hash_stlike_foreach
RUBY_SYMBOL_EXPORT_BEGIN int rb_hash_stlike_foreach(VALUE hash, st_foreach_callback_func *func, st_data_t arg)
Definition: hash.c:1442
RHash::as
union RHash::@105 as
ruby_num_rounding_mode
ruby_num_rounding_mode
Definition: internal.h:1787
RBasicRaw::flags
VALUE flags
Definition: internal.h:1982
rb_thread_shield_destroy
VALUE rb_thread_shield_destroy(VALUE self)
Definition: thread.c:4846
rb_id_quote_unprintable
VALUE rb_id_quote_unprintable(ID)
Definition: string.c:10735
RHash::basic
struct RBasic basic
Definition: internal.h:888
RBignum::heap
struct RBignum::@103::@104 heap
rb_execarg::use_shell
unsigned use_shell
Definition: internal.h:2040
memcmp
int memcmp(const void *s1, const void *s2, size_t len)
Definition: memcmp.c:7
rb_syntax_error_append
VALUE rb_syntax_error_append(VALUE exc, VALUE file, int line, int column, rb_encoding *enc, const char *fmt, va_list args)
Definition: error.c:104
Init_newline
void Init_newline(void)
rb_call_end_proc
void rb_call_end_proc(VALUE data)
Definition: eval_jump.c:11
rb_big_le
VALUE rb_big_le(VALUE x, VALUE y)
Definition: bignum.c:5507
rb_fstring_new
VALUE rb_fstring_new(const char *ptr, long len)
Definition: string.c:396
RHash::ar_hint
union RHash::@106 ar_hint
RBignum::digits
BDIGIT * digits
Definition: internal.h:754
rb_class_search_ancestor
VALUE rb_class_search_ancestor(VALUE klass, VALUE super)
Definition: object.c:713
FL_USER7
#define FL_USER7
Definition: ruby.h:1298
rb_obj_as_string_result
VALUE rb_obj_as_string_result(VALUE str, VALUE obj)
Definition: string.c:1452
index
int index
Definition: rb_mjit_min_header-2.7.1.h:11251
rb_hash_resurrect
VALUE rb_hash_resurrect(VALUE hash)
Definition: hash.c:1570
key
key
Definition: openssl_missing.h:181
RStruct::as
union RStruct::@107 as
rb_hash_new_with_size
VALUE rb_hash_new_with_size(st_index_t size)
Definition: hash.c:1529
FL_USER4
#define FL_USER4
Definition: ruby.h:1295
rb_execarg::close_others_given
unsigned close_others_given
Definition: internal.h:2045
rb_float_div
VALUE rb_float_div(VALUE x, VALUE y)
Definition: numeric.c:1126
path
VALUE path
Definition: rb_mjit_min_header-2.7.1.h:7353
FL_USER9
#define FL_USER9
Definition: ruby.h:1300
RUBY_NUM_ROUND_DEFAULT
@ RUBY_NUM_ROUND_DEFAULT
Definition: internal.h:1791
vm_ifunc::flags
VALUE flags
Definition: internal.h:1216
rb_gvar_get
VALUE rb_gvar_get(struct rb_global_entry *)
Definition: variable.c:619
rb_execarg::umask_given
unsigned umask_given
Definition: internal.h:2042
rb_report_bug_valist
void rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args)
Definition: error.c:710
mjit_finish
void mjit_finish(_Bool close_handle_p)
ruby_debug_printf
void ruby_debug_printf(const char *format,...)
Definition: debug.c:85
RHash
Definition: internal.h:887
BIGNUM_EMBED_LEN_MAX
#define BIGNUM_EMBED_LEN_MAX
Definition: internal.h:743
RHash::ar
struct ar_table_struct * ar
Definition: internal.h:891
rb_gvar_getter_function_of
rb_gvar_getter_t * rb_gvar_getter_function_of(const struct rb_global_entry *)
Definition: variable.c:702
ruby_mimfree
void ruby_mimfree(void *ptr)
Definition: gc.c:10236
rb_big_gt
VALUE rb_big_gt(VALUE x, VALUE y)
Definition: bignum.c:5489
RMoved
Definition: internal.h:908
rb_hash_key_str
VALUE rb_hash_key_str(VALUE)
Definition: hash.c:2797
RARRAY_LEN
#define RARRAY_LEN(a)
Definition: ruby.h:1070
rb_check_block_call
VALUE rb_check_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE)
Definition: vm_eval.c:1528
imemo_ment
@ imemo_ment
Definition: internal.h:1139
ruby_register_rollback_func_for_ensure
void ruby_register_rollback_func_for_ensure(VALUE(*ensure_func)(VALUE), VALUE(*rollback_func)(VALUE))
FIXNUM_POSITIVE_P
#define FIXNUM_POSITIVE_P(num)
Definition: internal.h:1776
rb_reg_new_ary
VALUE rb_reg_new_ary(VALUE ary, int options)
Definition: re.c:2927
rb_big_bit_length
VALUE rb_big_bit_length(VALUE big)
Definition: bignum.c:6790
rb_cArithSeq
VALUE rb_cArithSeq
Definition: enumerator.c:180
rb_current_realfilepath
VALUE rb_current_realfilepath(void)
Definition: vm_eval.c:2462
rb_int_divmod
VALUE rb_int_divmod(VALUE x, VALUE y)
Definition: numeric.c:3963
rb_big_mul_normal
VALUE rb_big_mul_normal(VALUE x, VALUE y)
Definition: bignum.c:1561
RHASH_AR_TABLE_BOUND_SHIFT
#define RHASH_AR_TABLE_BOUND_SHIFT
Definition: internal.h:867
rb_int_equal
VALUE rb_int_equal(VALUE x, VALUE y)
Definition: numeric.c:4163
rb_event_flag_t
uint32_t rb_event_flag_t
Definition: ruby.h:2278
ruby_num_interval_step_size
VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl)
Definition: numeric.c:2555
rb_execarg::rlimit_limits
VALUE rlimit_limits
Definition: internal.h:2056
rb_float_mul
VALUE rb_float_mul(VALUE x, VALUE y)
Definition: numeric.c:1072
rb_ary_at
VALUE rb_ary_at(VALUE, VALUE)
Definition: array.c:1629
buf
unsigned char buf[MIME_BUF_SIZE]
Definition: nkf.c:4322
rb_func_proc_new
VALUE rb_func_proc_new(rb_block_call_func_t func, VALUE val)
Definition: proc.c:728
rb_hash_delete_entry
VALUE rb_hash_delete_entry(VALUE hash, VALUE key)
Definition: hash.c:2321
T_BIGNUM
#define T_BIGNUM
Definition: ruby.h:533
rb_rational_pow
VALUE rb_rational_pow(VALUE self, VALUE other)
Definition: rational.c:1002
rb_vm_fstring_table
st_table * rb_vm_fstring_table(void)
Definition: vm.c:3392
rb_classext_struct::callable_m_tbl
struct rb_id_table * callable_m_tbl
Definition: internal.h:1027
RStruct::len
long len
Definition: internal.h:946
rb_backtrace_p
int rb_backtrace_p(VALUE obj)
Definition: vm_backtrace.c:446
rb_block_call_func_t
rb_block_call_func * rb_block_call_func_t
Definition: ruby.h:1967
RStruct::heap
struct RStruct::@107::@108 heap
argv
char ** argv
Definition: ruby.c:223
rb_rational_abs
VALUE rb_rational_abs(VALUE self)
Definition: rational.c:1255
f
#define f
rb_big_mul_balance
VALUE rb_big_mul_balance(VALUE x, VALUE y)
Definition: bignum.c:1689
LONG_LONG
#define LONG_LONG
Definition: rb_mjit_min_header-2.7.1.h:3939
rb_method_basic_definition_p_with_cc
bool rb_method_basic_definition_p_with_cc(struct rb_call_data *cd, VALUE klass, ID mid)
Definition: vm_method.c:2057
STATIC_ASSERT
#define STATIC_ASSERT(name, expr)
Definition: internal.h:230
div
void div_t div(int __numer, int __denom)
rb_imemo_tmpbuf_t
struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t
RBignum
Definition: internal.h:749
RUBY_SYMBOL_EXPORT_BEGIN
#define RUBY_SYMBOL_EXPORT_BEGIN
Definition: missing.h:48
BIGNUM_NEGATIVE_P
#define BIGNUM_NEGATIVE_P(b)
Definition: internal.h:766
rb_ary_tmp_new_fill
VALUE rb_ary_tmp_new_fill(long capa)
Definition: array.c:776
rb_warn_deprecated
void rb_warn_deprecated(const char *fmt, const char *suggest,...)
Definition: error.c:364
rb_realpath_internal
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict)
Definition: file.c:4409
rb_cmperr
void rb_cmperr(VALUE x, VALUE y)
Definition: compar.c:25
rb_next_class_serial
rb_serial_t rb_next_class_serial(void)
Definition: vm.c:358
rb_syserr_enc_warning
void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt,...)
Definition: error.c:2955
rb_execarg_setenv
void rb_execarg_setenv(VALUE execarg_obj, VALUE env)
Definition: process.c:2646
rb_math_cos
VALUE rb_math_cos(VALUE)
rb_execarg::sh
struct rb_execarg::@110::@111 sh
rb_int_positive_p
int rb_int_positive_p(VALUE num)
Definition: numeric.c:301
rb_subclass_entry::klass
VALUE klass
Definition: internal.h:999
timeval
Definition: missing.h:53
rb_gc_mark_vm_stack_values
void rb_gc_mark_vm_stack_values(long n, const VALUE *values)
Definition: gc.c:4741
ruby_rhash_flags
ruby_rhash_flags
Definition: internal.h:817
str
char str[HTML_ESCAPE_MAX_LEN+1]
Definition: escape.c:18
ruby_float_step
int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless)
Definition: numeric.c:2524
rb_class_foreach_subclass
void rb_class_foreach_subclass(VALUE klass, void(*f)(VALUE, VALUE), VALUE)
Definition: class.c:113
ruby_float_step_size
double ruby_float_step_size(double beg, double end, double unit, int excl)
Definition: numeric.c:2495
rb_execarg
Definition: internal.h:2024
ssize_t
_ssize_t ssize_t
Definition: rb_mjit_min_header-2.7.1.h:1329
FIXNUM_MIN
#define FIXNUM_MIN
Definition: ruby.h:260
rb_num_pow
VALUE rb_num_pow(VALUE x, VALUE y)
Definition: numeric.c:4118
Init_enc
void Init_enc(void)
Definition: dmyenc.c:5
RMoved::destination
VALUE destination
Definition: internal.h:910
MEMO::v2
const VALUE v2
Definition: internal.h:1282
rb_invcmp
VALUE rb_invcmp(VALUE, VALUE)
Definition: compar.c:47
vm_throw_data::reserved
VALUE reserved
Definition: internal.h:1195
rb_math_atan2
VALUE rb_math_atan2(VALUE, VALUE)
MJIT_STATIC
#define MJIT_STATIC
Definition: intern.h:47
SIZEOF_LONG
#define SIZEOF_LONG
Definition: rb_mjit_min_header-2.7.1.h:85
rb_last_status_clear
void rb_last_status_clear(void)
Definition: process.c:554
rb_is_const_sym
int rb_is_const_sym(VALUE sym)
Definition: symbol.c:896
ARGVSTR2ARGV
#define ARGVSTR2ARGV(argv_str)
Definition: internal.h:2074
ar_hint_t
unsigned char ar_hint_t
Definition: rb_mjit_min_header-2.7.1.h:6887
rb_execarg::fd_close
VALUE fd_close
Definition: internal.h:2062
rb_big_mul
VALUE rb_big_mul(VALUE x, VALUE y)
Definition: bignum.c:5933
ruby_escaped_char
const char * ruby_escaped_char(int c)
Definition: string.c:5848
rb_default_home_dir
VALUE rb_default_home_dir(VALUE result)
Definition: file.c:3576
rb_wb_protected_newobj_of
VALUE rb_wb_protected_newobj_of(VALUE, VALUE)
Definition: gc.c:2281
rb_float_eql
VALUE rb_float_eql(VALUE x, VALUE y)
Definition: numeric.c:1654
int
__inline__ int
Definition: rb_mjit_min_header-2.7.1.h:2839
rb_execarg::redirect_fds
VALUE redirect_fds
Definition: internal.h:2036
rb_big_size_m
VALUE rb_big_size_m(VALUE big)
Definition: bignum.c:6784
RComplex
Definition: internal.h:805
RUBY_ATTR_MALLOC
#define RUBY_ATTR_MALLOC
Definition: defines.h:235
Init_vm_objects
void Init_vm_objects(void)
Definition: vm.c:3324
rb_autoload_str
void rb_autoload_str(VALUE mod, ID id, VALUE file)
Definition: variable.c:1933
rb_cstr_to_rat
VALUE rb_cstr_to_rat(const char *, int)
Definition: rational.c:2541
rb_alloc_func_t
VALUE(* rb_alloc_func_t)(VALUE)
Definition: intern.h:427
ruby_debug_breakpoint
void ruby_debug_breakpoint(void)
Definition: debug.c:135
memcpy
void * memcpy(void *__restrict, const void *__restrict, size_t)
rb_execarg::argv_str
VALUE argv_str
Definition: internal.h:2032
rb_ary_set_len
void rb_ary_set_len(VALUE, long)
Definition: array.c:1932
ruby_init_setproctitle
void ruby_init_setproctitle(int argc, char *argv[])
ruby_hexdigits
const char ruby_hexdigits[]
Definition: escape.c:5
Init_eval_method
void Init_eval_method(void)
Definition: vm_method.c:2281
rb_flo_div_flo
VALUE rb_flo_div_flo(VALUE x, VALUE y)
Definition: numeric.c:1110
DLONG
#define DLONG
Definition: rb_mjit_min_header-2.7.1.h:6719
rb_warning_string
VALUE rb_warning_string(const char *fmt,...)
Definition: error.c:344
rb_str_tmp_frozen_release
void rb_str_tmp_frozen_release(VALUE str, VALUE tmp)
Definition: string.c:1217
ruby_exec_prefix
const char ruby_exec_prefix[]
Definition: loadpath.c:59
argc
int argc
Definition: ruby.c:222
RHash::word
VALUE word
Definition: internal.h:896
rb_str_initialize
VALUE rb_str_initialize(VALUE str, const char *ptr, long len, rb_encoding *enc)
Definition: string.c:964
RB_INT_PARSE_SIGN
@ RB_INT_PARSE_SIGN
Definition: internal.h:2463
rb_enc_warn
void rb_enc_warn(rb_encoding *enc, const char *fmt,...)
Definition: error.c:323
T_IMEMO
#define T_IMEMO
Definition: ruby.h:543
RHash::ary
ar_hint_t ary[RHASH_AR_TABLE_MAX_SIZE]
Definition: internal.h:895
rb_objspace_gc_disable
VALUE rb_objspace_gc_disable(struct rb_objspace *)
Definition: gc.c:9255
rb_check_funcall_default
VALUE rb_check_funcall_default(VALUE, ID, int, const VALUE *, VALUE)
Definition: vm_eval.c:533
rb_call_cache::aux
union rb_call_cache::@113 aux
rb_init_identtable
st_table * rb_init_identtable(void)
Definition: hash.c:4280
ruby_enable_coredump
int ruby_enable_coredump
Definition: signal.c:1481
err
int err
Definition: win32.c:135
RHASH_LEV_SHIFT
@ RHASH_LEV_SHIFT
Definition: internal.h:835
rb_thread_to_be_killed
int rb_thread_to_be_killed(VALUE thread)
Definition: thread.c:2472
rb_adjust_argv_kw_splat
VALUE rb_adjust_argv_kw_splat(int *, const VALUE **, int *)
Definition: vm_eval.c:237
rb_get_next_signal
int rb_get_next_signal(void)
Definition: signal.c:756
rb_execarg_addopt
int rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val)
Definition: process.c:2013
rb_call_info::flag
unsigned int flag
Definition: internal.h:2395
rb_get_coverage_mode
int rb_get_coverage_mode(void)
Definition: thread.c:5483
rb_data_type_struct
Definition: ruby.h:1148
rb_make_metaclass
VALUE rb_make_metaclass(VALUE, VALUE)
Definition: class.c:580
__msan_poison
#define __msan_poison(x, y)
Definition: internal.h:121
rb_objspace_gc_enable
VALUE rb_objspace_gc_enable(struct rb_objspace *)
Definition: gc.c:9218
rb_global_variable
Definition: variable.c:301
rb_execarg::envp_buf
VALUE envp_buf
Definition: internal.h:2038
ruby_null_device
const char ruby_null_device[]
Definition: file.c:6389
rb_execarg::invoke
union rb_execarg::@110 invoke
rb_int_gt
VALUE rb_int_gt(VALUE x, VALUE y)
Definition: numeric.c:4252
rb_thread_shield_release
VALUE rb_thread_shield_release(VALUE self)
Definition: thread.c:4835
rb_call_data::ci
struct rb_call_info ci
Definition: internal.h:2400
rb_execarg::close_others_do
unsigned close_others_do
Definition: internal.h:2046
MEMO::value
const VALUE value
Definition: internal.h:1286
v
int VALUE v
Definition: rb_mjit_min_header-2.7.1.h:12337
RBASIC
#define RBASIC(obj)
Definition: ruby.h:1267
rb_execarg::path_env
VALUE path_env
Definition: internal.h:2066
rb_obj_private_methods
VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj)
Definition: class.c:1395
rb_xrealloc_mul_add
void * rb_xrealloc_mul_add(const void *, size_t, size_t, size_t)
Definition: gc.c:10182
FIXNUM_NEGATIVE_P
#define FIXNUM_NEGATIVE_P(num)
Definition: internal.h:1777
MISSING_NOENTRY
@ MISSING_NOENTRY
Definition: internal.h:2335
rb_nmin_run
VALUE rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary)
Definition: enum.c:1568
SIZEOF_LONG_LONG
#define SIZEOF_LONG_LONG
Definition: rb_mjit_min_header-2.7.1.h:86
FL_USER8
#define FL_USER8
Definition: ruby.h:1299
rb_deprecate_constant
void rb_deprecate_constant(VALUE mod, const char *name)
Definition: variable.c:2947
rb_method_definition_struct
Definition: method.h:163
rb_rational_canonicalize
VALUE rb_rational_canonicalize(VALUE x)
Definition: rational.c:2034
vm_svar::flags
VALUE flags
Definition: internal.h:1182
imemo_cref
@ imemo_cref
class reference
Definition: internal.h:1134
__msan_unpoison
#define __msan_unpoison(x, y)
Definition: internal.h:122
rb_vm_thread_backtrace
VALUE rb_vm_thread_backtrace(int argc, const VALUE *argv, VALUE thval)
Definition: vm_backtrace.c:960
rb_encdb_dummy
int rb_encdb_dummy(const char *name)
Definition: encoding.c:472
_
#define _(args)
Definition: dln.h:28
ruby_fill_random_bytes
int ruby_fill_random_bytes(void *, size_t, int)
Definition: random.c:434
rb_hash_values
VALUE rb_hash_values(VALUE hash)
Definition: hash.c:3450
ar_table_struct
Definition: hash.c:349
rb_singleton_class_clone_and_attach
VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
Definition: class.c:376
SIZEOF_INT
#define SIZEOF_INT
Definition: rb_mjit_min_header-2.7.1.h:83
rb_imemo_tmpbuf_auto_free_pointer
#define rb_imemo_tmpbuf_auto_free_pointer()
Definition: internal.h:1239
Qtrue
#define Qtrue
Definition: ruby.h:468
rb_str_convert_to_inum
VALUE rb_str_convert_to_inum(VALUE str, int base, int badcheck, int raise_exception)
Definition: bignum.c:4246
rb_get_backtrace
VALUE rb_get_backtrace(VALUE info)
Definition: error.c:1229
rb_hash_compare_by_id_p
VALUE rb_hash_compare_by_id_p(VALUE hash)
Definition: hash.c:4261
rb_xmalloc_mul_add
void * rb_xmalloc_mul_add(size_t, size_t, size_t) RUBY_ATTR_MALLOC
Definition: gc.c:10175
rb_ary_tmp_new_from_values
VALUE rb_ary_tmp_new_from_values(VALUE, long, const VALUE *)
Definition: array.c:748
rb_ary_ptr_use_end
void rb_ary_ptr_use_end(VALUE ary)
Definition: array.c:235
len
uint8_t len
Definition: escape.c:17
rb_gc_verify_internal_consistency
void rb_gc_verify_internal_consistency(void)
Definition: gc.c:6204
rb_hash_ar_table
ar_table * rb_hash_ar_table(VALUE hash)
Definition: hash.c:544
rb_sym_intern_ascii_cstr
VALUE rb_sym_intern_ascii_cstr(const char *ptr)
Definition: symbol.c:1038
rb_get_path_check_convert
VALUE rb_get_path_check_convert(VALUE)
Definition: file.c:211
rb_eEINPROGRESS
VALUE rb_eEINPROGRESS
Definition: error.c:56
rb_integer_float_eq
VALUE rb_integer_float_eq(VALUE x, VALUE y)
Definition: bignum.c:5386
rb_subclass_entry
Definition: internal.h:998
rb_str_change_terminator_length
void rb_str_change_terminator_length(VALUE str, const int oldtermlen, const int termlen)
Definition: string.c:2230
rb_size_mul_add_or_raise
size_t rb_size_mul_add_or_raise(size_t, size_t, size_t, VALUE)
Definition: gc.c:219
rb_int_cmp
VALUE rb_int_cmp(VALUE x, VALUE y)
Definition: numeric.c:4212
RStruct
Definition: internal.h:942
rb_dbl_long_hash
long rb_dbl_long_hash(double d)
Definition: hash.c:160
RBignum::ary
BDIGIT ary[BIGNUM_EMBED_LEN_MAX]
Definition: internal.h:756
rb_hash_proc
st_index_t rb_hash_proc(st_index_t hash, VALUE proc)
Definition: proc.c:1302
rb_execarg::uid
rb_uid_t uid
Definition: internal.h:2058
rb_mutex_allow_trap
void rb_mutex_allow_trap(VALUE self, int val)
Definition: thread_sync.c:545
uint16_t
__uint16_t uint16_t
Definition: rb_mjit_min_header-2.7.1.h:1172
rb_vm_check_redefinition_by_prepend
void rb_vm_check_redefinition_by_prepend(VALUE klass)
Definition: vm.c:1631
LONG2FIX
#define LONG2FIX(i)
Definition: ruby.h:265
RTYPEDDATA_P
#define RTYPEDDATA_P(v)
Definition: ruby.h:1177
waitpid_state::status
int status
Definition: process.c:949
RBasicRaw
Definition: internal.h:1981
rb_class_detach_subclasses
void rb_class_detach_subclasses(VALUE)
Definition: class.c:133
rb_classext_struct::iv_index_tbl
struct st_table * iv_index_tbl
Definition: internal.h:1021
imemo_tmpbuf
@ imemo_tmpbuf
Definition: internal.h:1141
rb_data_is_encoding
int rb_data_is_encoding(VALUE obj)
Definition: encoding.c:89
LIKELY
#define LIKELY(x)
Definition: internal.h:36
RClass::class_serial
rb_serial_t class_serial
Definition: internal.h:1054
rb_block
Definition: vm_core.h:751
RB_OBJ_WRITE
#define RB_OBJ_WRITE(a, slot, b)
Definition: internal.h:2693
rb_execarg::exception_given
unsigned exception_given
Definition: internal.h:2052
rb_execarg::chdir_given
unsigned chdir_given
Definition: internal.h:2047
rb_attr_delete
VALUE rb_attr_delete(VALUE, ID)
Definition: variable.c:1126
rb_float_uminus
VALUE rb_float_uminus(VALUE num)
Definition: numeric.c:1011
rb_econv_memsize
size_t rb_econv_memsize(rb_econv_t *ec)
Definition: transcode.c:1703
rb_obj_memsize_of
size_t rb_obj_memsize_of(VALUE)
Definition: gc.c:3936
rb_generic_ivar_memsize
size_t rb_generic_ivar_memsize(VALUE)
Definition: variable.c:1010
rb_yield_force_blockarg
VALUE rb_yield_force_blockarg(VALUE values)
Definition: vm_eval.c:1309
ruby_digitmap
const char ruby_digitmap[]
Definition: bignum.c:38
rb_call_info
Definition: internal.h:2392
RComplex::imag
VALUE imag
Definition: internal.h:808
rb_rational_mul
VALUE rb_rational_mul(VALUE self, VALUE other)
Definition: rational.c:874
rb_builtin_class_name
const char * rb_builtin_class_name(VALUE x)
Definition: error.c:797
RARRAY_CONST_PTR_TRANSIENT
#define RARRAY_CONST_PTR_TRANSIENT(a)
Definition: ruby.h:1073
ruby_vm_special_exception_copy
MJIT_STATIC VALUE ruby_vm_special_exception_copy(VALUE)
Definition: rb_mjit_min_header-2.7.1.h:12224
RHASH_AR_TABLE_SIZE_SHIFT
#define RHASH_AR_TABLE_SIZE_SHIFT
Definition: internal.h:865
RHASH_AR_TABLE_SIZE_MASK
#define RHASH_AR_TABLE_SIZE_MASK
Definition: internal.h:864
RB_WARN_CATEGORY_DEPRECATED
@ RB_WARN_CATEGORY_DEPRECATED
Definition: internal.h:1562
FL_USER12
#define FL_USER12
Definition: ruby.h:1303
vm_ifunc_argc
Definition: internal.h:1205
rb_num_to_dbl
double rb_num_to_dbl(VALUE val)
Definition: object.c:3576
ruby_hdtoa
char * ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, char **rve)
rb_imemo_tmpbuf_struct
Definition: internal.h:1231
rb_insns_name_array
VALUE rb_insns_name_array(void)
Definition: compile.c:8767
rb_str2big_karatsuba
VALUE rb_str2big_karatsuba(VALUE arg, int base, int badcheck)
Definition: bignum.c:4352
Qnil
#define Qnil
Definition: ruby.h:469
rb_stdio_set_default_encoding
void rb_stdio_set_default_encoding(void)
Definition: io.c:11758
rb_imemo_tmpbuf_struct::flags
VALUE flags
Definition: internal.h:1232
method_missing_reason
method_missing_reason
Definition: internal.h:2334
Init_File
void Init_File(void)
Definition: file.c:6435
waitpid_state::options
int options
Definition: process.c:950
rb_math_cosh
VALUE rb_math_cosh(VALUE)
ruby_disable_gc
int ruby_disable_gc
Definition: gc.c:1001
rb_exec_async_signal_safe
int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen)
Definition: process.c:3523
Init_vm_stack_canary
void Init_vm_stack_canary(void)
Definition: rb_mjit_min_header-2.7.1.h:17009
rb_float_ceil
VALUE rb_float_ceil(VALUE num, int ndigits)
Definition: numeric.c:2017
rb_imemo_tmpbuf_struct::reserved
VALUE reserved
Definition: internal.h:1233
rb_execarg::command_name
VALUE command_name
Definition: internal.h:2030
ruby_sized_xfree
void void ruby_sized_xfree(void *x, size_t size)
Definition: gc.c:10161
RIMemo::v3
VALUE v3
Definition: internal.h:1129
rb_imemo_new
VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
Definition: gc.c:2308
rb_objspace_data_type_name
const RUBY_SYMBOL_EXPORT_BEGIN char * rb_objspace_data_type_name(VALUE obj)
Definition: gc.c:2432
vm_ifunc::reserved
VALUE reserved
Definition: internal.h:1217
vm_throw_data::throw_state
int throw_state
Definition: internal.h:1198
rb_io_t
Definition: io.h:66
cmp_opt_data::opt_methods
unsigned int opt_methods
Definition: internal.h:1323
rb_warning_category_from_name
rb_warning_category_t rb_warning_category_from_name(VALUE category)
Definition: error.c:140
rb_str_chomp_string
VALUE rb_str_chomp_string(VALUE str, VALUE chomp)
Definition: string.c:8921
rb_classext_struct
Definition: internal.h:1020
rb_is_instance_name
int rb_is_instance_name(VALUE name)
Definition: symbol.c:1062
rb_int_plus
VALUE rb_int_plus(VALUE x, VALUE y)
Definition: numeric.c:3610
cmp_opt_Fixnum
@ cmp_opt_Fixnum
Definition: internal.h:1316
rb_encdb_replicate
int rb_encdb_replicate(const char *alias, const char *orig)
Definition: encoding.c:450
rb_thread_struct
Definition: vm_core.h:910
rb_check_funcall_with_hook
VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv, rb_check_funcall_hook *hook, VALUE arg)
Definition: vm_eval.c:565
rb_call_data
Definition: internal.h:2398
MEMO::state
long state
Definition: internal.h:1285
rb_classext_struct::origin_
const VALUE origin_
Definition: internal.h:1039
RSTRING_LEN
#define RSTRING_LEN(str)
Definition: ruby.h:1005
RHASH_TRANSIENT_FLAG
@ RHASH_TRANSIENT_FLAG
Definition: internal.h:832
rb_gcd
VALUE rb_gcd(VALUE x, VALUE y)
Definition: rational.c:1894
rb_obj_methods
VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj)
Definition: class.c:1361
rb_classext_struct::parent_subclasses
rb_subclass_entry_t ** parent_subclasses
Definition: internal.h:1029
st_table
Definition: st.h:79
ruby_set_inplace_mode
void ruby_set_inplace_mode(const char *)
Definition: io.c:12861
rb_mod_const_missing
VALUE rb_mod_const_missing(VALUE klass, VALUE name)
Definition: variable.c:1739
rb_classext_struct::m_tbl
struct rb_id_table * m_tbl
Definition: internal.h:1024
rb_grantpt
int rb_grantpt(int fd)
Definition: signal.c:1597
rb_gid_t
#define rb_gid_t
Definition: rb_mjit_min_header-2.7.1.h:111
FL_USER6
#define FL_USER6
Definition: ruby.h:1297
rb_default_coverage
VALUE rb_default_coverage(int)
Definition: thread.c:5519
MEMO::func
void(* func)(void)
Definition: internal.h:1287
calling
rb_control_frame_t struct rb_calling_info * calling
Definition: rb_mjit_min_header-2.7.1.h:14564
rb_reg_check_preprocess
VALUE rb_reg_check_preprocess(VALUE)
Definition: re.c:2707
ruby_gc_set_params
void ruby_gc_set_params(void)
Definition: gc.c:9420
rb_warning_category_t
rb_warning_category_t
Definition: internal.h:1560
RTEST
#define RTEST(v)
Definition: ruby.h:481
imemo_ifunc
@ imemo_ifunc
iterator function
Definition: internal.h:1137
ruby::backward::cxxanyargs::type
VALUE type(ANYARGS)
ANYARGS-ed function type.
Definition: cxxanyargs.hpp:39
rb_str2big_normal
VALUE rb_str2big_normal(VALUE arg, int base, int badcheck)
Definition: bignum.c:4310
RB_SPECIAL_CONST_P
#define RB_SPECIAL_CONST_P(x)
Definition: ruby.h:1312
rb_str_quote_unprintable
VALUE rb_str_quote_unprintable(VALUE)
Definition: string.c:10714
rb_maygvl_fd_fix_cloexec
void rb_maygvl_fd_fix_cloexec(int fd)
Definition: io.c:245
rb_unexpected_type
void rb_unexpected_type(VALUE x, int t)
Definition: error.c:852
rb_str_comparable
int rb_str_comparable(VALUE, VALUE)
Definition: string.c:3203
rb_big_abs
VALUE rb_big_abs(VALUE x)
Definition: bignum.c:6762
__sFILE
Definition: vsnprintf.c:169
rb_block_min_max_arity
int rb_block_min_max_arity(int *max)
Definition: proc.c:1178
rb_global_entry
Definition: internal.h:1350
rb_xcalloc_mul_add_mul
void * rb_xcalloc_mul_add_mul(size_t, size_t, size_t, size_t) RUBY_ATTR_MALLOC
Definition: gc.c:10196
RB_INT_PARSE_UNDERSCORE
@ RB_INT_PARSE_UNDERSCORE
Definition: internal.h:2464
rb_hash_has_key
VALUE rb_hash_has_key(VALUE hash, VALUE key)
Definition: hash.c:3501
rb_xmalloc_mul_add_mul
void * rb_xmalloc_mul_add_mul(size_t, size_t, size_t, size_t) RUBY_ATTR_MALLOC
Definition: gc.c:10189
RSTRUCT
#define RSTRUCT(obj)
Definition: internal.h:966
rb_check_funcall_with_hook_kw
VALUE rb_check_funcall_with_hook_kw(VALUE recv, ID mid, int argc, const VALUE *argv, rb_check_funcall_hook *hook, VALUE arg, int kw_splat)
Definition: vm_eval.c:539
rb_float_cmp
int rb_float_cmp(VALUE x, VALUE y)
Definition: numeric.c:1487
RVALUE_EMBED_LEN_MAX
@ RVALUE_EMBED_LEN_MAX
Definition: ruby.h:910
min_argc
const rb_iseq_t const int const int min_argc
Definition: rb_mjit_min_header-2.7.1.h:13510
mjit_pause
VALUE mjit_pause(_Bool wait_p)
rb_int_minus
VALUE rb_int_minus(VALUE x, VALUE y)
Definition: numeric.c:3649
rb_big2str_poweroftwo
VALUE rb_big2str_poweroftwo(VALUE x, int base)
Definition: bignum.c:4921
RClass
Definition: internal.h:1048
RStruct::ary
const VALUE ary[RSTRUCT_EMBED_LEN_MAX]
Definition: internal.h:949
src
__inline__ const void *__restrict src
Definition: rb_mjit_min_header-2.7.1.h:2836
MISSING_PRIVATE
@ MISSING_PRIVATE
Definition: internal.h:2336
rb_source_location
VALUE rb_source_location(int *pline)
Definition: vm.c:1360
RHASH_LEV_MAX
@ RHASH_LEV_MAX
Definition: internal.h:836
name
const char * name
Definition: nkf.c:208
rb_execution_context_struct
Definition: vm_core.h:843
rb_fork_ruby
rb_pid_t rb_fork_ruby(int *status)
rb_str_upto_each
VALUE rb_str_upto_each(VALUE, VALUE, int, int(*each)(VALUE, VALUE), VALUE)
Definition: string.c:4263
PRINTF_ARGS
PRINTF_ARGS(void ruby_debug_printf(const char *,...), 1, 2)
rb_big_odd_p
VALUE rb_big_odd_p(VALUE)
Definition: bignum.c:6831