Ruby  3.1.0dev(2021-09-10revisionb76ad15ed0da636161de0243c547ee1e6fc95681)
Data Structures | Macros | Typedefs | Enumerations | Functions
imemo.h File Reference

(b76ad15ed0da636161de0243c547ee1e6fc95681)

IMEMO: Internal memo object. More...

#include "ruby/internal/config.h"
#include <stddef.h>
#include "internal/array.h"
#include "internal/gc.h"
#include "ruby/internal/stdbool.h"
#include "ruby/ruby.h"
Include dependency graph for imemo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vm_svar
 SVAR (Special VARiable) More...
 
struct  vm_throw_data
 THROW_DATA. More...
 
struct  vm_ifunc_argc
 
struct  vm_ifunc
 IFUNC (Internal FUNCtion) More...
 
struct  rb_imemo_tmpbuf_struct
 
struct  MEMO
 MEMO. More...
 

Macros

#define IMEMO_DEBUG   0
 
#define IMEMO_MASK   0x0f
 
#define IMEMO_FL_USHIFT   (FL_USHIFT + 4)
 
#define IMEMO_FL_USER0   FL_USER4
 
#define IMEMO_FL_USER1   FL_USER5
 
#define IMEMO_FL_USER2   FL_USER6
 
#define IMEMO_FL_USER3   FL_USER7
 
#define IMEMO_FL_USER4   FL_USER8
 
#define IMEMO_FL_USER5   FL_USER9
 
#define THROW_DATA_CONSUMED   IMEMO_FL_USER0
 
#define THROW_DATA_P(err)   imemo_throw_data_p((VALUE)err)
 
#define MEMO_CAST(m)   ((struct MEMO *)(m))
 
#define MEMO_NEW(a, b, c)   ((struct MEMO *)rb_imemo_new(imemo_memo, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0))
 
#define MEMO_FOR(type, value)   ((type *)RARRAY_PTR(value))
 
#define NEW_MEMO_FOR(type, value)   ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value))
 
#define NEW_PARTIAL_MEMO_FOR(type, value, member)
 
#define IMEMO_TYPE_P(v, t)   imemo_type_p((VALUE)v, t)
 

Typedefs

typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t
 

Enumerations

enum  imemo_type {
  imemo_env = 0, imemo_cref = 1, imemo_svar = 2, imemo_throw_data = 3,
  imemo_ifunc = 4, imemo_memo = 5, imemo_ment = 6, imemo_iseq = 7,
  imemo_tmpbuf = 8, imemo_ast = 9, imemo_parser_strterm = 10, imemo_callinfo = 11,
  imemo_callcache = 12, imemo_constcache = 13
}
 

Functions

VALUE rb_imemo_new (enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
 
rb_imemo_tmpbuf_trb_imemo_tmpbuf_parser_heap (void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt)
 
struct vm_ifuncrb_vm_ifunc_new (rb_block_call_func_t func, const void *data, int min_argc, int max_argc)
 
void rb_strterm_mark (VALUE obj)
 
const char * rb_imemo_name (enum imemo_type type)
 

Detailed Description

IMEMO: Internal memo object.

Author
Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Definition in file imemo.h.

Macro Definition Documentation

◆ IMEMO_DEBUG

#define IMEMO_DEBUG   0

Definition at line 20 of file imemo.h.

◆ IMEMO_FL_USER0

#define IMEMO_FL_USER0   FL_USER4

Definition at line 27 of file imemo.h.

◆ IMEMO_FL_USER1

#define IMEMO_FL_USER1   FL_USER5

Definition at line 28 of file imemo.h.

◆ IMEMO_FL_USER2

#define IMEMO_FL_USER2   FL_USER6

Definition at line 29 of file imemo.h.

◆ IMEMO_FL_USER3

#define IMEMO_FL_USER3   FL_USER7

Definition at line 30 of file imemo.h.

◆ IMEMO_FL_USER4

#define IMEMO_FL_USER4   FL_USER8

Definition at line 31 of file imemo.h.

◆ IMEMO_FL_USER5

#define IMEMO_FL_USER5   FL_USER9

Definition at line 32 of file imemo.h.

◆ IMEMO_FL_USHIFT

#define IMEMO_FL_USHIFT   (FL_USHIFT + 4)

Definition at line 26 of file imemo.h.

◆ IMEMO_MASK

#define IMEMO_MASK   0x0f

Definition at line 23 of file imemo.h.

◆ IMEMO_TYPE_P

#define IMEMO_TYPE_P (   v,
  t 
)    imemo_type_p((VALUE)v, t)

Definition at line 178 of file imemo.h.

◆ MEMO_CAST

#define MEMO_CAST (   m)    ((struct MEMO *)(m))

Definition at line 121 of file imemo.h.

◆ MEMO_FOR

#define MEMO_FOR (   type,
  value 
)    ((type *)RARRAY_PTR(value))

Definition at line 123 of file imemo.h.

◆ MEMO_NEW

#define MEMO_NEW (   a,
  b,
 
)    ((struct MEMO *)rb_imemo_new(imemo_memo, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0))

Definition at line 122 of file imemo.h.

◆ NEW_MEMO_FOR

#define NEW_MEMO_FOR (   type,
  value 
)    ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value))

Definition at line 124 of file imemo.h.

◆ NEW_PARTIAL_MEMO_FOR

#define NEW_PARTIAL_MEMO_FOR (   type,
  value,
  member 
)
Value:
rb_ary_set_len((value), offsetof(type, member) / sizeof(VALUE)), \
MEMO_FOR(type, value))

Definition at line 126 of file imemo.h.

◆ THROW_DATA_CONSUMED

#define THROW_DATA_CONSUMED   IMEMO_FL_USER0

Definition at line 71 of file imemo.h.

◆ THROW_DATA_P

#define THROW_DATA_P (   err)    imemo_throw_data_p((VALUE)err)

Definition at line 120 of file imemo.h.

Typedef Documentation

◆ rb_imemo_tmpbuf_t

Definition at line 131 of file imemo.h.

Enumeration Type Documentation

◆ imemo_type

enum imemo_type
Enumerator
imemo_env 
imemo_cref 

class reference

imemo_svar 

special variable

imemo_throw_data 
imemo_ifunc 

iterator function

imemo_memo 
imemo_ment 
imemo_iseq 
imemo_tmpbuf 
imemo_ast 
imemo_parser_strterm 
imemo_callinfo 
imemo_callcache 
imemo_constcache 

Definition at line 34 of file imemo.h.

Function Documentation

◆ rb_imemo_name()

const char* rb_imemo_name ( enum imemo_type  type)

Definition at line 2628 of file gc.c.

References env, and IMEMO_NAME.

◆ rb_imemo_new()

VALUE rb_imemo_new ( enum imemo_type  type,
VALUE  v1,
VALUE  v2,
VALUE  v3,
VALUE  v0 
)

Definition at line 2655 of file gc.c.

References FL_USHIFT, heap_page::flags, size, and T_IMEMO.

Referenced by rb_vm_ifunc_new().

◆ 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 at line 2677 of file gc.c.

◆ rb_strterm_mark()

void rb_strterm_mark ( VALUE  obj)

◆ 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 
)
rb_ary_tmp_new_fill
VALUE rb_ary_tmp_new_fill(long capa)
Definition: array.c:859
offsetof
#define offsetof(p_type, field)
Definition: addrinfo.h:186
rb_ary_set_len
void rb_ary_set_len(VALUE ary, long len)
Definition: array.c:2223
VALUE
unsigned long VALUE
Definition: value.h:38
type_roomof
#define type_roomof(x, y)
Definition: bits.h:20
ruby::backward::cxxanyargs::type
VALUE type(ANYARGS)
ANYARGS-ed function type.
Definition: cxxanyargs.hpp:56