eval_intern.h File Reference

#include "ruby/ruby.h"
#include "vm_core.h"
#include <stdio.h>
#include <setjmp.h>
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
#include <sys/stat.h>

Go to the source code of this file.

Defines

#define PASS_PASSED_BLOCK_TH(th)
#define PASS_PASSED_BLOCK()
#define EXIT_FAILURE   1
#define ruby_setjmp(env)   RUBY_SETJMP(env)
#define ruby_longjmp(env, val)   RUBY_LONGJMP((env),(val))
#define SAVE_ROOT_JMPBUF_BEFORE_STMT
#define SAVE_ROOT_JMPBUF_AFTER_STMT
#define SAVE_ROOT_JMPBUF(th, stmt)
#define TH_PUSH_TAG(th)
#define TH_POP_TAG()
#define TH_POP_TAG2()   _th->tag = _tag.prev
#define TH_PUSH_TAG2()   (_th->tag = &_tag, 0)
#define TH_TMPPOP_TAG()   TH_POP_TAG2()
#define TH_REPUSH_TAG()   TH_PUSH_TAG2()
#define PUSH_TAG()   TH_PUSH_TAG(GET_THREAD())
#define POP_TAG()   TH_POP_TAG()
#define TH_EXEC_TAG()   (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(_th) : TH_PUSH_TAG2())
#define EXEC_TAG()   TH_EXEC_TAG()
#define TH_JUMP_TAG(th, st)   rb_threadptr_tag_jump(th, st)
#define JUMP_TAG(st)   TH_JUMP_TAG(GET_THREAD(), (st))
#define INTERNAL_EXCEPTION_P(exc)   FIXNUM_P(exc)
#define TAG_RETURN   RUBY_TAG_RETURN
#define TAG_BREAK   RUBY_TAG_BREAK
#define TAG_NEXT   RUBY_TAG_NEXT
#define TAG_RETRY   RUBY_TAG_RETRY
#define TAG_REDO   RUBY_TAG_REDO
#define TAG_RAISE   RUBY_TAG_RAISE
#define TAG_THROW   RUBY_TAG_THROW
#define TAG_FATAL   RUBY_TAG_FATAL
#define TAG_MASK   RUBY_TAG_MASK
#define NEW_THROW_OBJECT(val, pt, st)   ((VALUE)rb_node_newnode(NODE_LIT, (VALUE)(val), (VALUE)(pt), (VALUE)(st)))
#define SET_THROWOBJ_CATCH_POINT(obj, val)   (RNODE((obj))->u2.value = (val))
#define SET_THROWOBJ_STATE(obj, val)   (RNODE((obj))->u3.value = (val))
#define GET_THROWOBJ_VAL(obj)   ((VALUE)RNODE((obj))->u1.value)
#define GET_THROWOBJ_CATCH_POINT(obj)   ((VALUE*)RNODE((obj))->u2.value)
#define GET_THROWOBJ_STATE(obj)   ((int)RNODE((obj))->u3.value)
#define SCOPE_TEST(f)   (rb_vm_cref()->nd_visi & (f))
#define SCOPE_CHECK(f)   (rb_vm_cref()->nd_visi == (f))
#define SCOPE_SET(f)   (rb_vm_cref()->nd_visi = (f))
#define rb_thread_raised_set(th, f)   ((th)->raised_flag |= (f))
#define rb_thread_raised_reset(th, f)   ((th)->raised_flag &= ~(f))
#define rb_thread_raised_p(th, f)   (((th)->raised_flag & (f)) != 0)
#define rb_thread_raised_clear(th)   ((th)->raised_flag = 0)
#define CharNext(p)   ((p) + 1)

Enumerations

enum  ruby_tag_type {
  RUBY_TAG_RETURN = 0x1, RUBY_TAG_BREAK = 0x2, RUBY_TAG_NEXT = 0x3, RUBY_TAG_RETRY = 0x4,
  RUBY_TAG_REDO = 0x5, RUBY_TAG_RAISE = 0x6, RUBY_TAG_THROW = 0x7, RUBY_TAG_FATAL = 0x8,
  RUBY_TAG_MASK = 0xf
}
enum  { RAISED_EXCEPTION = 1, RAISED_STACKOVERFLOW = 2, RAISED_NOMEMORY = 4 }

Functions

char * strrchr (const char *, const char)
static int rb_threadptr_tag_state (rb_thread_t *th)
 NORETURN (static inline void rb_threadptr_tag_jump(rb_thread_t *, int))
static void rb_threadptr_tag_jump (rb_thread_t *th, int st)
void rb_thread_cleanup (void)
void rb_thread_wait_other_threads (void)
int rb_threadptr_set_raised (rb_thread_t *th)
int rb_threadptr_reset_raised (rb_thread_t *th)
VALUE rb_f_eval (int argc, VALUE *argv, VALUE self)
VALUE rb_make_exception (int argc, VALUE *argv)
 NORETURN (void rb_method_name_error(VALUE, VALUE))
 NORETURN (void rb_fiber_start(void))
 NORETURN (void rb_print_undef(VALUE, ID, int))
 NORETURN (void rb_vm_localjump_error(const char *, VALUE, int))
 NORETURN (void rb_vm_jump_tag_but_local_jump(int))
 NORETURN (void rb_raise_method_missing(rb_thread_t *th, int argc, VALUE *argv, VALUE obj, int call_status))
VALUE rb_vm_make_jump_tag_but_local_jump (int state, VALUE val)
NODE * rb_vm_cref (void)
VALUE rb_vm_call_cfunc (VALUE recv, VALUE(*func)(VALUE), VALUE arg, const rb_block_t *blockptr, VALUE filename)
void rb_vm_set_progname (VALUE filename)
void rb_thread_terminate_all (void)
VALUE rb_vm_top_self ()
VALUE rb_vm_cbase (void)

Define Documentation

#define CharNext (  )     ((p) + 1)

Definition at line 254 of file eval_intern.h.

Referenced by cmdglob(), dln_find_1(), push_include(), and rb_w32_cmdvector().

 
#define EXEC_TAG (  )     TH_EXEC_TAG()
#define EXIT_FAILURE   1
#define GET_THROWOBJ_CATCH_POINT ( obj   )     ((VALUE*)RNODE((obj))->u2.value)

Definition at line 206 of file eval_intern.h.

Referenced by rb_iterate(), vm_exec(), and vm_rewrite_ep_in_errinfo().

#define GET_THROWOBJ_STATE ( obj   )     ((int)RNODE((obj))->u3.value)

Definition at line 207 of file eval_intern.h.

Referenced by thread_join(), and vm_throw().

#define GET_THROWOBJ_VAL ( obj   )     ((VALUE)RNODE((obj))->u1.value)

Definition at line 205 of file eval_intern.h.

Referenced by rb_iterate(), thread_join(), and vm_exec().

#define INTERNAL_EXCEPTION_P ( exc   )     FIXNUM_P(exc)

Definition at line 175 of file eval_intern.h.

Referenced by setup_exception().

#define JUMP_TAG ( st   )     TH_JUMP_TAG(GET_THREAD(), (st))
#define NEW_THROW_OBJECT ( val,
pt,
st   )     ((VALUE)rb_node_newnode(NODE_LIT, (VALUE)(val), (VALUE)(pt), (VALUE)(st)))

Definition at line 198 of file eval_intern.h.

Referenced by rb_throw_obj(), vm_iter_break(), and vm_throw().

 
#define PASS_PASSED_BLOCK (  ) 
Value:
do { \
    rb_thread_t * const __th__ = GET_THREAD(); \
    PASS_PASSED_BLOCK_TH(__th__); \
} while (0)

Definition at line 12 of file eval_intern.h.

Referenced by rb_call_super(), and rb_obj_call_init().

#define PASS_PASSED_BLOCK_TH ( th   ) 
Value:
do { \
    (th)->passed_block = rb_vm_control_frame_block_ptr(th->cfp); \
    (th)->cfp->flag |= VM_FRAME_FLAG_PASSED; \
} while (0)

Definition at line 7 of file eval_intern.h.

Referenced by rb_funcall_passing_block(), and send_internal().

 
#define POP_TAG (  )     TH_POP_TAG()
 
#define PUSH_TAG (  )     TH_PUSH_TAG(GET_THREAD())
#define rb_thread_raised_clear ( th   )     ((th)->raised_flag = 0)

Definition at line 226 of file eval_intern.h.

Referenced by error_print(), rb_longjmp(), rb_memerror(), and rb_raise_jump().

#define rb_thread_raised_p ( th,
 )     (((th)->raised_flag & (f)) != 0)

Definition at line 225 of file eval_intern.h.

Referenced by rb_memerror(), ruby_stack_overflowed_p(), and stack_check().

#define rb_thread_raised_reset ( th,
 )     ((th)->raised_flag &= ~(f))

Definition at line 224 of file eval_intern.h.

#define rb_thread_raised_set ( th,
 )     ((th)->raised_flag |= (f))

Definition at line 223 of file eval_intern.h.

Referenced by error_print(), rb_memerror(), and stack_check().

#define ruby_longjmp ( env,
val   )     RUBY_LONGJMP((env),(val))

Definition at line 51 of file eval_intern.h.

Referenced by cont_restore_1(), and rb_threadptr_tag_jump().

#define ruby_setjmp ( env   )     RUBY_SETJMP(env)

Definition at line 50 of file eval_intern.h.

Referenced by cont_capture(), and fiber_store().

#define SAVE_ROOT_JMPBUF ( th,
stmt   ) 
Value:
do \
  if (ruby_setjmp((th)->root_jmpbuf) == 0) { \
      SAVE_ROOT_JMPBUF_BEFORE_STMT \
      stmt; \
      SAVE_ROOT_JMPBUF_AFTER_STMT \
  } \
  else { \
      rb_fiber_start(); \
  } while (0)

Definition at line 112 of file eval_intern.h.

Referenced by rb_protect(), ruby_cleanup(), ruby_exec_internal(), ruby_options(), and thread_start_func_2().

#define SAVE_ROOT_JMPBUF_AFTER_STMT

Definition at line 109 of file eval_intern.h.

#define SAVE_ROOT_JMPBUF_BEFORE_STMT

Definition at line 108 of file eval_intern.h.

#define SCOPE_CHECK (  )     (rb_vm_cref()->nd_visi == (f))

Definition at line 210 of file eval_intern.h.

Referenced by rb_attr().

#define SCOPE_SET (  )     (rb_vm_cref()->nd_visi = (f))

Definition at line 211 of file eval_intern.h.

Referenced by load_ext(), rb_mod_modfunc(), and set_visibility().

#define SCOPE_TEST (  )     (rb_vm_cref()->nd_visi & (f))

Definition at line 209 of file eval_intern.h.

Referenced by rb_attr().

#define SET_THROWOBJ_CATCH_POINT ( obj,
val   )     (RNODE((obj))->u2.value = (val))

Definition at line 200 of file eval_intern.h.

Referenced by vm_exec(), and vm_rewrite_ep_in_errinfo().

#define SET_THROWOBJ_STATE ( obj,
val   )     (RNODE((obj))->u3.value = (val))

Definition at line 202 of file eval_intern.h.

Referenced by vm_exec().

#define TAG_BREAK   RUBY_TAG_BREAK
#define TAG_FATAL   RUBY_TAG_FATAL
#define TAG_MASK   RUBY_TAG_MASK

Definition at line 196 of file eval_intern.h.

Referenced by error_handle().

#define TAG_NEXT   RUBY_TAG_NEXT
#define TAG_RAISE   RUBY_TAG_RAISE
#define TAG_REDO   RUBY_TAG_REDO
#define TAG_RETRY   RUBY_TAG_RETRY
#define TAG_RETURN   RUBY_TAG_RETURN
#define TAG_THROW   RUBY_TAG_THROW
 
#define TH_EXEC_TAG (  )     (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(_th) : TH_PUSH_TAG2())
#define TH_JUMP_TAG ( th,
st   )     rb_threadptr_tag_jump(th, st)
 
#define TH_POP_TAG (  ) 
 
#define TH_POP_TAG2 (  )     _th->tag = _tag.prev

Definition at line 132 of file eval_intern.h.

Referenced by vm_exec().

#define TH_PUSH_TAG ( th   ) 
 
#define TH_PUSH_TAG2 (  )     (_th->tag = &_tag, 0)

Definition at line 135 of file eval_intern.h.

 
#define TH_REPUSH_TAG (  )     TH_PUSH_TAG2()

Definition at line 139 of file eval_intern.h.

Referenced by rb_exec_end_proc().

 
#define TH_TMPPOP_TAG (  )     TH_POP_TAG2()

Definition at line 137 of file eval_intern.h.

Referenced by rb_exec_end_proc().


Enumeration Type Documentation

anonymous enum
Enumerator:
RAISED_EXCEPTION 
RAISED_STACKOVERFLOW 
RAISED_NOMEMORY 

Definition at line 216 of file eval_intern.h.

Enumerator:
RUBY_TAG_RETURN 
RUBY_TAG_BREAK 
RUBY_TAG_NEXT 
RUBY_TAG_RETRY 
RUBY_TAG_REDO 
RUBY_TAG_RAISE 
RUBY_TAG_THROW 
RUBY_TAG_FATAL 
RUBY_TAG_MASK 

Definition at line 177 of file eval_intern.h.


Function Documentation

NORETURN ( void   rb_raise_method_missingrb_thread_t *th, int argc, VALUE *argv, VALUE obj, int call_status  ) 
NORETURN ( void   rb_vm_jump_tag_but_local_jumpint  ) 
NORETURN ( void   rb_vm_localjump_errorconst char *, VALUE, int  ) 
NORETURN ( void   rb_print_undefVALUE, ID, int  ) 
NORETURN ( void   rb_fiber_startvoid  ) 
NORETURN ( void   rb_method_name_errorVALUE, VALUE  ) 
NORETURN ( static inline void   rb_threadptr_tag_jumprb_thread_t *, int  ) 
VALUE rb_f_eval ( int  argc,
VALUE *  argv,
VALUE  self 
)

Definition at line 1349 of file vm_eval.c.

References eval_string(), NIL_P, NUM2INT, Qundef, rb_scan_args(), SafeStringValue, and StringValue.

Referenced by bind_eval(), and Init_vm_eval().

VALUE rb_make_exception ( int  argc,
VALUE *  argv 
)

Definition at line 682 of file eval.c.

References make_exception(), and TRUE.

Referenced by parser_set_encode(), rb_f_raise(), and rb_threadptr_raise().

void rb_thread_cleanup ( void   ) 
void rb_thread_terminate_all ( void   ) 
void rb_thread_wait_other_threads ( void   ) 
int rb_threadptr_reset_raised ( rb_thread_t th  ) 
int rb_threadptr_set_raised ( rb_thread_t th  ) 
static void rb_threadptr_tag_jump ( rb_thread_t th,
int  st 
) [inline, static]
static int rb_threadptr_tag_state ( rb_thread_t th  )  [inline, static]

Definition at line 146 of file eval_intern.h.

References rb_thread_struct::state.

VALUE rb_vm_call_cfunc ( VALUE  recv,
VALUE(*)(VALUE)  func,
VALUE  arg,
const rb_block_t blockptr,
VALUE  filename 
)
VALUE rb_vm_cbase ( void   ) 
NODE* rb_vm_cref ( void   ) 
VALUE rb_vm_make_jump_tag_but_local_jump ( int  state,
VALUE  val 
)
void rb_vm_set_progname ( VALUE  filename  ) 
VALUE rb_vm_top_self (  ) 
char* strrchr ( const char *  ,
const   char 
)

Generated on 18 May 2020 for Ruby by  doxygen 1.6.1