Skip to content

Commit

Permalink
* blockinlining.c, error.c, eval.c, eval_error.h, eval_intern.h,
Browse files Browse the repository at this point in the history
  eval_jump.h, eval_load.c, eval_safe.h, gc.c, proc.c, signal.c,
  thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h,
  vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
  fix typo (rb_thead_t -> rb_thread_t).

* eval_intern.h: remove unused definitions.

* common.mk: fix around vm_opts.h path
  and remove harmful argument passed to insns2vm.rb.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ko1 committed Feb 8, 2007
1 parent 522f948 commit 9c57438
Show file tree
Hide file tree
Showing 23 changed files with 243 additions and 247 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Thu Feb 8 15:00:14 2007 Koichi Sasada <ko1@atdot.net>

* blockinlining.c, error.c, eval.c, eval_error.h, eval_intern.h,
eval_jump.h, eval_load.c, eval_safe.h, gc.c, proc.c, signal.c,
thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h,
vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fix typo (rb_thead_t -> rb_thread_t).

* eval_intern.h: remove unused definitions.

* common.mk: fix around vm_opts.h path
and remove harmful argument passed to insns2vm.rb.

Wed Feb 7 23:25:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>

* eval.c (specific_eval): suppress warning.
Expand Down
6 changes: 3 additions & 3 deletions blockinlining.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ build_Integer_times_node(rb_iseq_t *iseq, NODE * node, NODE * lnode,
VALUE
yarv_invoke_Integer_times_special_block(VALUE num)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);

if (orig_block && BUILTIN_TYPE(orig_block->iseq) != T_NODE) {
Expand Down Expand Up @@ -300,7 +300,7 @@ VALUE
yarv_invoke_Range_each_special_block(VALUE range,
VALUE beg, VALUE end, int excl)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);

if (BUILTIN_TYPE(orig_block->iseq) != T_NODE) {
Expand Down Expand Up @@ -431,7 +431,7 @@ build_Array_each_node(rb_iseq_t *iseq, NODE * node, NODE * lnode,
VALUE
yarv_invoke_Array_each_special_block(VALUE ary)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_block_t *orig_block = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);

if (BUILTIN_TYPE(orig_block->iseq) != T_NODE) {
Expand Down
4 changes: 2 additions & 2 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ MATZRUBY = $(MATZRUBYDIR)ruby
INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc \
vmtc.inc vm.inc vm_macro.inc

INSNS2VMOPT = $(CPPFLAGS) --srcdir="$(srcdir)"
INSNS2VMOPT = --srcdir="$(srcdir)"

minsns.inc: $(srcdir)/template/minsns.inc.tmpl

Expand All @@ -563,7 +563,7 @@ vm.inc: $(srcdir)/template/vm.inc.tmpl

vm_macro.inc: $(srcdir)/vm_macro.def

$(INSNS): $(srcdir)/insns.def vm_opts.h
$(INSNS): $(srcdir)/insns.def {$(VPATH)}vm_opts.h
$(BASERUBY) $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT)

incs: $(INSNS)
Expand Down
2 changes: 1 addition & 1 deletion error.c
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ Init_syserr(void)
static void
err_append(const char *s)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
if (th->parse_in_eval) {
if (NIL_P(th->errinfo)) {
th->errinfo = rb_exc_new2(rb_eSyntaxError, s);
Expand Down
40 changes: 20 additions & 20 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ rb_mod_protected_method_defined(VALUE mod, VALUE mid)
return Qfalse;
}

NORETURN(void th_iter_break _((rb_thead_t *)));
NORETURN(void th_iter_break _((rb_thread_t *)));

void
rb_iter_break()
Expand All @@ -888,7 +888,7 @@ rb_longjmp(tag, mesg)
VALUE mesg;
{
VALUE at;
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();

/*
//while (th->cfp->pc == 0 || th->cfp->iseq == 0) {
Expand Down Expand Up @@ -1073,7 +1073,7 @@ rb_jump_tag(tag)
int
rb_block_given_p()
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
if (GC_GUARDED_PTR_REF(th->cfp->lfp[0])) {
return Qtrue;
}
Expand Down Expand Up @@ -1113,7 +1113,7 @@ rb_iterator_p()
VALUE
rb_f_block_given_p()
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = th->cfp;
cfp = th_get_ruby_level_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp));
if (GC_GUARDED_PTR_REF(cfp->lfp[0])) {
Expand Down Expand Up @@ -1230,7 +1230,7 @@ rb_iterate(VALUE (*it_proc) (VALUE), VALUE data1,
int state;
volatile VALUE retval = Qnil;
NODE *node = NEW_IFUNC(bl_proc, data2);
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = th->cfp;

TH_PUSH_TAG(th);
Expand Down Expand Up @@ -1505,7 +1505,7 @@ rb_method_missing(int argc, const VALUE *argv, VALUE obj)
VALUE exc = rb_eNoMethodError;
char *format = 0;
NODE *cnode = ruby_current_node;
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
int last_call_status = th->method_missing_reason;
if (argc == 0 || !SYMBOL_P(argv[0])) {
rb_raise(rb_eArgError, "no id given");
Expand Down Expand Up @@ -1697,7 +1697,7 @@ VALUE
rb_f_send(int argc, VALUE *argv, VALUE recv)
{
int scope = NOEX_PUBLIC;
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);

if (SPECIAL_CONST_P(cfp->sp[0])) {
Expand Down Expand Up @@ -1860,7 +1860,7 @@ rb_frame_this_func(void)
ID
rb_frame_callee(void)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
/* check if prev_cfp can be accessible */
if ((void *)(th->stack + th->stack_size) == (void *)(prev_cfp)) {
Expand All @@ -1872,7 +1872,7 @@ rb_frame_callee(void)
void
rb_frame_pop(void)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
}

Expand All @@ -1895,7 +1895,7 @@ rb_sourcefile(void)
int
rb_sourceline(void)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
return th_get_sourceline(th->cfp);
}

Expand All @@ -1906,7 +1906,7 @@ eval(VALUE self, VALUE src, VALUE scope, char *file, int line)
VALUE result = Qundef;
VALUE envval;
rb_binding_t *bind = 0;
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_env_t *env = NULL;
NODE *stored_cref_stack = 0;

Expand Down Expand Up @@ -2051,7 +2051,7 @@ static VALUE
exec_under(VALUE (*func) (VALUE), VALUE under, VALUE self, VALUE args)
{
VALUE val = Qnil; /* OK */
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = th->cfp;
rb_control_frame_t *pcfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
VALUE stored_self = pcfp->self;
Expand Down Expand Up @@ -2707,7 +2707,7 @@ VALUE rb_f_untrace_var();
static VALUE
get_errinfo(void)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = th->cfp;
rb_control_frame_t *end_cfp = RUBY_VM_END_CONTROL_FRAME(th);

Expand Down Expand Up @@ -2790,13 +2790,13 @@ errat_setter(VALUE val, ID id, VALUE *var)
* local_variables #=> ["fred", "i"]
*/

int th_collect_local_variables_in_heap(rb_thead_t *th, VALUE *dfp, VALUE ary);
int th_collect_local_variables_in_heap(rb_thread_t *th, VALUE *dfp, VALUE ary);

static VALUE
rb_f_local_variables(void)
{
VALUE ary = rb_ary_new();
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp =
th_get_ruby_level_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp));
int i;
Expand Down Expand Up @@ -2940,7 +2940,7 @@ Init_eval(void)
VALUE
rb_dvar_defined(ID id)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_iseq_t *iseq;
if (th->base_block && (iseq = th->base_block->iseq)) {
while (iseq->type == ISEQ_TYPE_BLOCK ||
Expand All @@ -2964,7 +2964,7 @@ rb_dvar_defined(ID id)
void
rb_scope_setup_top_local_tbl(ID *tbl)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
if (tbl) {
if (th->top_local_tbl) {
xfree(th->top_local_tbl);
Expand All @@ -2980,7 +2980,7 @@ rb_scope_setup_top_local_tbl(ID *tbl)
int
rb_scope_base_local_tbl_size(void)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
if (th->base_block) {
return th->base_block->iseq->local_iseq->local_size +
2 /* $_, $~ */ - 1 /* svar */ ;
Expand All @@ -2993,7 +2993,7 @@ rb_scope_base_local_tbl_size(void)
ID
rb_scope_base_local_tbl_id(int i)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
switch (i) {
case 0:
return rb_intern("$_");
Expand All @@ -3008,7 +3008,7 @@ rb_scope_base_local_tbl_id(int i)
int
rb_dvar_current(void)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
if (th->base_block) {
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion eval_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static int
error_handle(int ex)
{
int status = EXIT_FAILURE;
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();

if (thread_set_raised(th))
return EXIT_FAILURE;
Expand Down
37 changes: 10 additions & 27 deletions eval_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ char *strrchr _((const char *, const char));
#include <sys/stat.h>

#define TH_PUSH_TAG(th) do { \
rb_thead_t * const _th = th; \
rb_thread_t * const _th = th; \
struct rb_vm_tag _tag; \
_tag.tag = 0; \
_tag.prev = _th->tag; \
Expand Down Expand Up @@ -183,32 +183,15 @@ char *strrchr _((const char *, const char));
{ \
ruby_cref()->nd_visi = (f); \
}

struct ruby_env {
struct ruby_env *prev;
struct FRAME *frame;
struct SCOPE *scope;
struct BLOCK *block;
struct iter *iter;
struct tag *tag;
NODE *cref;
};

typedef struct thread *rb_thread_t;

extern VALUE rb_cBinding;
extern VALUE rb_eThreadError;
extern VALUE rb_eLocalJumpError;
extern VALUE rb_eSysStackError;
extern VALUE exception_error;
extern VALUE sysstack_error;


void rb_thread_cleanup _((void));
void rb_thread_wait_other_threads _((void));

int thread_set_raised(rb_thead_t *th);
int thread_reset_raised(rb_thead_t *th);
int thread_set_raised(rb_thread_t *th);
int thread_reset_raised(rb_thread_t *th);

VALUE rb_f_eval(int argc, VALUE *argv, VALUE self);
VALUE rb_make_exception _((int argc, VALUE *argv));
Expand All @@ -218,14 +201,14 @@ NORETURN(void print_undef _((VALUE, ID)));
NORETURN(void th_localjump_error(const char *, VALUE, int));
NORETURN(void th_jump_tag_but_local_jump(int, VALUE));

VALUE th_compile(rb_thead_t *th, VALUE str, VALUE file, VALUE line);
VALUE th_compile(rb_thread_t *th, VALUE str, VALUE file, VALUE line);

NODE *th_get_cref(rb_thead_t *th, rb_iseq_t *iseq, rb_control_frame_t *cfp);
NODE *th_cref_push(rb_thead_t *th, VALUE, int);
NODE *th_set_special_cref(rb_thead_t *th, VALUE *lfp, NODE * cref_stack);
NODE *th_get_cref(rb_thread_t *th, rb_iseq_t *iseq, rb_control_frame_t *cfp);
NODE *th_cref_push(rb_thread_t *th, VALUE, int);
NODE *th_set_special_cref(rb_thread_t *th, VALUE *lfp, NODE * cref_stack);

static rb_control_frame_t *
th_get_ruby_level_cfp(rb_thead_t *th, rb_control_frame_t *cfp)
th_get_ruby_level_cfp(rb_thread_t *th, rb_control_frame_t *cfp)
{
rb_iseq_t *iseq = 0;
while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)) {
Expand All @@ -244,12 +227,12 @@ th_get_ruby_level_cfp(rb_thead_t *th, rb_control_frame_t *cfp)
static inline NODE *
ruby_cref()
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = th_get_ruby_level_cfp(th, th->cfp);
return th_get_cref(th, cfp->iseq, cfp);
}

VALUE th_get_cbase(rb_thead_t *th);
VALUE th_get_cbase(rb_thread_t *th);
VALUE rb_obj_is_proc(VALUE);
void rb_vm_check_redefinition_opt_method(NODE *node);
void rb_thread_terminate_all(void);
Expand Down
4 changes: 2 additions & 2 deletions eval_jump.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static VALUE
rb_f_throw(int argc, VALUE *argv)
{
VALUE tag, value;
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
struct rb_vm_tag *tt = th->tag;

rb_scan_args(argc, argv, "11", &tag, &value);
Expand Down Expand Up @@ -94,7 +94,7 @@ rb_f_catch(VALUE dmy, VALUE tag)
{
int state;
VALUE val = Qnil; /* OK */
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();

tag = ID2SYM(rb_to_id(tag));
PUSH_TAG(tag);
Expand Down
4 changes: 2 additions & 2 deletions eval_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ rb_load_internal(char *file)
{
NODE *node;
VALUE iseq;
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();

{
th->parse_in_eval++;
Expand Down Expand Up @@ -365,7 +365,7 @@ rb_require_safe(VALUE fname, int safe)
{
VALUE result = Qnil;
volatile VALUE errinfo = GET_THREAD()->errinfo;
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();
int state;
char *volatile ftptr = 0;

Expand Down
4 changes: 2 additions & 2 deletions eval_safe.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static void safe_setter _((VALUE val));
void
rb_set_safe_level(int level)
{
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();

if (level > th->safe_level) {
if (level > SAFE_LEVEL_MAX) {
Expand All @@ -56,7 +56,7 @@ static void
safe_setter(VALUE val)
{
int level = NUM2INT(val);
rb_thead_t *th = GET_THREAD();
rb_thread_t *th = GET_THREAD();

if (level < th->safe_level) {
rb_raise(rb_eSecurityError,
Expand Down
Loading

0 comments on commit 9c57438

Please sign in to comment.