From a3e1b1ce7ed7e7ffac23015fc2fde56511b30681 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 31 Dec 2006 15:02:22 +0000 Subject: * Merge YARV git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- node.h | 134 +++++++++++------------------------------------------------------ 1 file changed, 23 insertions(+), 111 deletions(-) (limited to 'node.h') diff --git a/node.h b/node.h index ddca63ab21..7deab9646d 100644 --- a/node.h +++ b/node.h @@ -124,6 +124,7 @@ enum node_type { NODE_ATTRASGN, NODE_PRELUDE, NODE_LAMBDA, + NODE_OPTBLOCK, NODE_LAST }; @@ -153,9 +154,6 @@ typedef struct RNode { } u3; } NODE; -extern NODE *ruby_cref; -extern NODE *ruby_top_cref; - #define RNODE(obj) (R_CAST(RNode)(obj)) /* 0..4:T_TYPES, 5:FL_MARK, 6:reserved, 7:NODE_NEWLINE */ @@ -169,7 +167,7 @@ extern NODE *ruby_top_cref; RNODE(n)->flags=((RNODE(n)->flags&~NODE_TYPEMASK)|(((t)<flags>>NODE_LSHIFT)&NODE_LMASK)) #define nd_set_line(n,l) \ RNODE(n)->flags=((RNODE(n)->flags&~(-1< -#define USE_CONTEXT -#endif -#include -#include "st.h" - -#ifdef USE_CONTEXT -typedef struct { - ucontext_t context; - volatile int status; -} rb_jmpbuf_t[1]; -#else -typedef jmp_buf rb_jmpbuf_t; -#endif - -enum thread_status { - THREAD_TO_KILL, - THREAD_RUNNABLE, - THREAD_STOPPED, - THREAD_KILLED, -}; - -typedef struct thread * rb_thread_t; - -struct thread { - struct thread *next, *prev; - rb_jmpbuf_t context; -#if (defined _WIN32 && !defined _WIN32_WCE) || defined __CYGWIN__ - unsigned long win32_exception_list; -#endif - - VALUE result; - - long stk_len; - long stk_max; - VALUE *stk_ptr; - VALUE *stk_pos; -#ifdef __ia64 - long bstr_len; - long bstr_max; - VALUE *bstr_ptr; - VALUE *bstr_pos; -#endif - - struct FRAME *frame; - struct SCOPE *scope; - struct RVarmap *dyna_vars; - struct BLOCK *block; - struct iter *iter; - struct tag *tag; - VALUE wrapper; - NODE *cref; - struct ruby_env *anchor; - - int flags; /* misc. states (rb_trap_immediate/raised) */ - - NODE *node; - - int tracing; - VALUE errinfo; - VALUE last_status; - VALUE last_line; - VALUE last_match; - - int safe; - - enum thread_status status; - int wait_for; - int fd; - rb_fdset_t readfds; - rb_fdset_t writefds; - rb_fdset_t exceptfds; - int select_value; - double delay; - rb_thread_t join; - - int abort; - int priority; - VALUE thgroup; - - st_table *locals; - - VALUE thread; - - VALUE sandbox; -}; - -extern VALUE (*ruby_sandbox_save)(struct thread *); -extern VALUE (*ruby_sandbox_restore)(struct thread *); -extern rb_thread_t curr_thread; -extern rb_thread_t main_thread; - #if defined(__cplusplus) } /* extern "C" { */ #endif -- cgit v1.2.3