mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
8ee7d0767f
eval_intern.h, eval_jump.h, eval_load.c, eval_method.h, eval_safe.h, gc.c, insnhelper.h, insns.def, iseq.c, proc.c, process.c, signal.c, thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h, vm_dump.c, vm_evalbody.ci, vm_macro.def, yarv.h, yarvcore.h, yarvcore.c: change type and macro names: * yarv_*_t -> rb_*_t * yarv_*_struct -> rb_*_struct * yarv_tag -> rb_vm_tag * YARV_* -> RUBY_VM_* * proc.c, vm.c: move functions about env object creation from proc.c to vm.c. * proc.c, yarvcore.c: fix rb_cVM initialization place. * inits.c: change Init_ISeq() order (after Init_VM). * ruby.h, proc.c: change declaration place of rb_cEnv from proc.c to ruby.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
104 lines
2.1 KiB
C
104 lines
2.1 KiB
C
/**********************************************************************
|
|
|
|
yarv.h -
|
|
|
|
$Author$
|
|
$Date$
|
|
|
|
Copyright (C) 2004-2006 Koichi Sasada
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
#include <ruby.h>
|
|
#include <node.h>
|
|
#include "yarvcore.h"
|
|
|
|
#ifndef _YARV_H_INCLUDED_
|
|
#define _YARV_H_INCLUDED_
|
|
|
|
|
|
VALUE yarv_yield(VALUE val);
|
|
|
|
/* original API */
|
|
|
|
#if YARVEXT
|
|
RUBY_EXTERN int yarvIsWorking;
|
|
#define IS_YARV_WORKING() (yarvIsWorking)
|
|
#define SET_YARV_START() (yarvIsWorking = 1)
|
|
#define SET_YARV_STOP() (yarvIsWorking = 0)
|
|
#else
|
|
#define IS_YARV_WORKING() 1
|
|
#define SET_YARV_START()
|
|
#define SET_YARV_STOP()
|
|
#endif
|
|
|
|
|
|
#if RUBY_VM_THREAD_MODEL == 2
|
|
|
|
extern rb_thead_t *yarvCurrentThread;
|
|
extern rb_vm_t *theYarvVM;
|
|
|
|
static inline VALUE
|
|
yarv_get_current_running_thread_value(void)
|
|
{
|
|
return yarvCurrentThread->self;
|
|
}
|
|
|
|
static inline rb_thead_t *
|
|
yarv_get_current_running_thread(void)
|
|
{
|
|
return yarvCurrentThread;
|
|
}
|
|
|
|
#define GET_VM() theYarvVM
|
|
#define GET_THREAD() yarvCurrentThread
|
|
|
|
static inline void
|
|
rb_thread_set_current_raw(rb_thead_t *th)
|
|
{
|
|
yarvCurrentThread = th;
|
|
}
|
|
|
|
static inline void
|
|
rb_thread_set_current(rb_thead_t *th)
|
|
{
|
|
rb_thread_set_current_raw(th);
|
|
th->vm->running_thread = th;
|
|
}
|
|
|
|
#else
|
|
#error "unsupported thread model"
|
|
#endif
|
|
|
|
void rb_vm_change_state();
|
|
|
|
VALUE th_invoke_yield(rb_thead_t *th, int argc, VALUE *argv);
|
|
|
|
VALUE th_call0(rb_thead_t *th, VALUE klass, VALUE recv,
|
|
VALUE id, ID oid, int argc, const VALUE *argv,
|
|
NODE * body, int nosuper);
|
|
|
|
VALUE *yarv_svar(int);
|
|
|
|
VALUE th_call_super(rb_thead_t *th, int argc, const VALUE *argv);
|
|
|
|
VALUE yarv_backtrace(int lev);
|
|
|
|
VALUE yarvcore_eval_parsed(NODE *node, VALUE file);
|
|
|
|
VALUE th_invoke_proc(rb_thead_t *th, rb_proc_t *proc,
|
|
VALUE self, int argc, VALUE *argv);
|
|
VALUE th_make_proc(rb_thead_t *th, rb_control_frame_t *cfp,
|
|
rb_block_t *block);
|
|
VALUE th_make_env_object(rb_thead_t *th, rb_control_frame_t *cfp);
|
|
VALUE yarvcore_eval(VALUE self, VALUE str, VALUE file, VALUE line);
|
|
|
|
int yarv_block_given_p(void);
|
|
|
|
VALUE yarv_load(char *);
|
|
int th_get_sourceline(rb_control_frame_t *);
|
|
VALUE th_backtrace(rb_thead_t *, int);
|
|
void yarv_bug(void);
|
|
|
|
#endif
|