Ruby  2.5.0dev(2017-10-22revision60238)
Macros | Enumerations | Functions
vm_insnhelper.c File Reference
#include "insns.inc"
#include <math.h>
#include "constant.h"
#include "internal.h"
#include "probes.h"
#include "probes_helper.h"
#include "ruby/config.h"
#include "debug_counter.h"
#include "vm_args.c"

Go to the source code of this file.

Macros

#define vm_check_frame(a, b, c, d)
 
#define USE_IC_FOR_IVAR   1
 
#define BUILTIN_CLASS_P(x, k)   (!SPECIAL_CONST_P(x) && RBASIC_CLASS(x) == k)
 
#define EQ_UNREDEFINED_P(t)   BASIC_OP_UNREDEFINED_P(BOP_EQ, t##_REDEFINED_OP_FLAG)
 
#define CHECK_CMP_NAN(a, b)   /* do nothing */
 
#define VM_PROFILE   0
 
#define VM_PROFILE_UP(x)
 
#define VM_PROFILE_ATEXIT()
 
#define CHECK_CFP_CONSISTENCY(func)
 
#define id_cmp   idCmp
 

Enumerations

enum  binop_operands_type { bot_others = 0, bot_fixnum, bot_flonum, bot_float }
 

Functions

VALUE ruby_vm_special_exception_copy (VALUE exc)
 
 NORETURN (static void threadptr_stack_overflow(rb_thread_t *, int))
 
 NORETURN (void rb_threadptr_stack_overflow(rb_thread_t *th, int crit))
 
void rb_threadptr_stack_overflow (rb_thread_t *th, int crit)
 
rb_control_frame_trb_vm_push_frame (rb_execution_context_t *ec, const rb_iseq_t *iseq, VALUE type, VALUE self, VALUE specval, VALUE cref_or_me, const VALUE *pc, VALUE *sp, int local_size, int stack_max)
 
void rb_vm_pop_frame (rb_thread_t *th)
 
void rb_error_arity (int argc, int min, int max)
 
 NOINLINE (static void vm_env_write_slowpath(const VALUE *ep, int index, VALUE v))
 
void rb_vm_env_write (const VALUE *ep, int index, VALUE v)
 
 PUREFUNC (static rb_callable_method_entry_t *check_method_entry(VALUE obj, int can_be_svar))
 
const rb_callable_method_entry_trb_vm_frame_method_entry (const rb_control_frame_t *cfp)
 
 PUREFUNC (static rb_cref_t *check_cref(VALUE, int))
 
void rb_vm_rewrite_cref (rb_cref_t *cref, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr)
 
 ALWAYS_INLINE (static VALUE vm_getivar(VALUE, ID, IC, struct rb_call_cache *, int))
 
VALUE rb_equal_opt (VALUE obj1, VALUE obj2)
 
VALUE rb_eql_opt (VALUE obj1, VALUE obj2)
 
 PUREFUNC (static rb_control_frame_t *current_method_entry(rb_thread_t *th, rb_control_frame_t *cfp))
 
rb_control_frame_t *FUNC_FASTCALL() rb_vm_opt_struct_aref (rb_thread_t *th, rb_control_frame_t *reg_cfp)
 
rb_control_frame_t *FUNC_FASTCALL() rb_vm_opt_struct_aset (rb_thread_t *th, rb_control_frame_t *reg_cfp)
 
 NORETURN (static void vm_stack_consistency_error(rb_thread_t *, const rb_control_frame_t *, const VALUE *))
 

Macro Definition Documentation

◆ BUILTIN_CLASS_P

#define BUILTIN_CLASS_P (   x,
 
)    (!SPECIAL_CONST_P(x) && RBASIC_CLASS(x) == k)

Definition at line 1352 of file vm_insnhelper.c.

◆ CHECK_CFP_CONSISTENCY

#define CHECK_CFP_CONSISTENCY (   func)
Value:
(LIKELY(vm_cfp_consistent_p(th, reg_cfp)) ? (void)0 : \
rb_bug(func ": cfp consistency error (%p, %p)", reg_cfp, th->ec.cfp+1))
void rb_bug(const char *fmt,...)
Definition: error.c:521
#define LIKELY(x)
Definition: internal.h:42

Definition at line 1864 of file vm_insnhelper.c.

◆ CHECK_CMP_NAN

#define CHECK_CMP_NAN (   a,
 
)    /* do nothing */

Definition at line 1492 of file vm_insnhelper.c.

◆ EQ_UNREDEFINED_P

#define EQ_UNREDEFINED_P (   t)    BASIC_OP_UNREDEFINED_P(BOP_EQ, t##_REDEFINED_OP_FLAG)

Definition at line 1353 of file vm_insnhelper.c.

◆ id_cmp

#define id_cmp   idCmp

Definition at line 3200 of file vm_insnhelper.c.

◆ USE_IC_FOR_IVAR

#define USE_IC_FOR_IVAR   1

Definition at line 924 of file vm_insnhelper.c.

◆ vm_check_frame

#define vm_check_frame (   a,
  b,
  c,
 
)

Definition at line 196 of file vm_insnhelper.c.

◆ VM_PROFILE

#define VM_PROFILE   0

Definition at line 1824 of file vm_insnhelper.c.

◆ VM_PROFILE_ATEXIT

#define VM_PROFILE_ATEXIT ( )

Definition at line 1849 of file vm_insnhelper.c.

◆ VM_PROFILE_UP

#define VM_PROFILE_UP (   x)

Definition at line 1848 of file vm_insnhelper.c.

Enumeration Type Documentation

◆ binop_operands_type

Enumerator
bot_others 
bot_fixnum 
bot_flonum 
bot_float 

Definition at line 3369 of file vm_insnhelper.c.

Function Documentation

◆ ALWAYS_INLINE()

ALWAYS_INLINE ( static VALUE   vm_getivarVALUE, ID, IC, struct rb_call_cache *, int)

◆ NOINLINE()

NOINLINE ( static void   vm_env_write_slowpathconst VALUE *ep, int index, VALUE v)

◆ NORETURN() [1/3]

NORETURN ( static void   threadptr_stack_overflowrb_thread_t *, int)

◆ NORETURN() [2/3]

NORETURN ( void   rb_threadptr_stack_overflowrb_thread_t *th, int crit)

◆ NORETURN() [3/3]

NORETURN ( static void   vm_stack_consistency_errorrb_thread_t *, const rb_control_frame_t *, const VALUE *)

◆ PUREFUNC() [1/3]

PUREFUNC ( static rb_callable_method_entry_t check_method_entryVALUE obj, int can_be_svar)

◆ PUREFUNC() [2/3]

PUREFUNC ( static rb_cref_t check_crefVALUE, int)

◆ PUREFUNC() [3/3]

PUREFUNC ( static rb_control_frame_t current_method_entryrb_thread_t *th, rb_control_frame_t *cfp)

◆ rb_eql_opt()

VALUE rb_eql_opt ( VALUE  obj1,
VALUE  obj2 
)

◆ rb_equal_opt()

VALUE rb_equal_opt ( VALUE  obj1,
VALUE  obj2 
)

◆ rb_error_arity()

void rb_error_arity ( int  argc,
int  min,
int  max 
)

Definition at line 325 of file vm_insnhelper.c.

◆ rb_threadptr_stack_overflow()

void rb_threadptr_stack_overflow ( rb_thread_t th,
int  crit 
)

◆ rb_vm_env_write()

void rb_vm_env_write ( const VALUE ep,
int  index,
VALUE  v 
)

Definition at line 357 of file vm_insnhelper.c.

◆ rb_vm_frame_method_entry()

const rb_callable_method_entry_t* rb_vm_frame_method_entry ( const rb_control_frame_t cfp)

◆ rb_vm_opt_struct_aref()

rb_control_frame_t* FUNC_FASTCALL() rb_vm_opt_struct_aref ( rb_thread_t th,
rb_control_frame_t reg_cfp 
)

Definition at line 2785 of file vm_insnhelper.c.

References GET_SELF, rb_struct_aref(), and TOPN.

◆ rb_vm_opt_struct_aset()

rb_control_frame_t* FUNC_FASTCALL() rb_vm_opt_struct_aset ( rb_thread_t th,
rb_control_frame_t reg_cfp 
)

Definition at line 2792 of file vm_insnhelper.c.

References GET_SELF, rb_struct_aset(), and TOPN.

◆ rb_vm_pop_frame()

void rb_vm_pop_frame ( rb_thread_t th)

Definition at line 302 of file vm_insnhelper.c.

◆ rb_vm_push_frame()

rb_control_frame_t* rb_vm_push_frame ( rb_execution_context_t ec,
const rb_iseq_t iseq,
VALUE  type,
VALUE  self,
VALUE  specval,
VALUE  cref_or_me,
const VALUE pc,
VALUE sp,
int  local_size,
int  stack_max 
)

Definition at line 273 of file vm_insnhelper.c.

◆ rb_vm_rewrite_cref()

void rb_vm_rewrite_cref ( rb_cref_t cref,
VALUE  old_klass,
VALUE  new_klass,
rb_cref_t **  new_cref_ptr 
)

Definition at line 713 of file vm_insnhelper.c.

◆ ruby_vm_special_exception_copy()

VALUE ruby_vm_special_exception_copy ( VALUE  exc)