Permalink
Browse files

* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,

  eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
  insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
  range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
  vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
  fixed indents and non-C90 comments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent d08112a commit 205f310c2963edec5fabebdce6aaae076d8af5fb @nobu nobu committed Feb 2, 2007
Showing with 186 additions and 204 deletions.
  1. +10 −1 ChangeLog
  2. +1 −1 call_cfunc.ci
  3. +14 −14 compile.c
  4. +1 −1 compile.h
  5. +1 −1 debug.h
  6. +19 −13 eval.c
  7. +11 −11 eval_error.h
  8. +1 −1 eval_jump.h
  9. +2 −2 eval_load.c
  10. +1 −1 eval_thread.c
  11. +2 −2 gc.c
  12. +1 −1 insnhelper.h
  13. +1 −1 insns.def
  14. +3 −3 iseq.c
  15. +4 −3 main.c
  16. +1 −1 numeric.c
  17. +3 −3 parse.y
  18. +1 −1 range.c
  19. +31 −59 regenc.h
  20. +6 −6 ruby.h
  21. +25 −25 signal.c
  22. +2 −2 thread.c
  23. +4 −4 thread_win32.ci
  24. +5 −6 vm.c
  25. +2 −7 vm.h
  26. +11 −11 vm_dump.c
  27. +1 −1 vm_evalbody.ci
  28. +5 −5 yarvcore.c
  29. +17 −17 yarvcore.h
View
@@ -1,7 +1,16 @@
-Sat Feb 3 00:49:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 3 01:25:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* proc.c (yarv_proc_alloc): needs return.
+ * call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
+ eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
+ insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
+ range.c, ruby.h, signal.c, thread.c, thread_win32.ci, vm.c,
+ vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
+ fixed indents and non-C90 comments.
+
+ * regenc.h: revert to before YARV.
+
Fri Feb 2 23:39:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* common.mk (bin): add more dependency. a patch from Tadashi
View
@@ -9,7 +9,7 @@ call_cfunc(func, recv, len, argc, argv)
int len, argc;
const VALUE *argv;
{
- // printf("len: %d, argc: %d\n", len, argc);
+ /* printf("len: %d, argc: %d\n", len, argc); */
if (len >= 0 && argc != len) {
rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)",
View
@@ -702,7 +702,7 @@ new_child_iseq(yarv_iseq_t *iseq, NODE *node,
static int
iseq_setup(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
{
- // debugs("[compile step 2] (iseq_array_to_linkedlist)\n");
+ /* debugs("[compile step 2] (iseq_array_to_linkedlist)\n"); */
GC_CHECK();
if (CPDEBUG > 5)
@@ -1256,7 +1256,7 @@ set_sequence(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
}
}
- // fprintf(stderr, "insn: %-16s, sp: %d\n", insn_name(iobj->insn_id), sp);
+ /* fprintf(stderr, "insn: %-16s, sp: %d\n", insn_name(iobj->insn_id), sp); */
operands = iobj->operands;
insn = iobj->insn_id;
@@ -1274,7 +1274,7 @@ set_sequence(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
for (j = 0; types[j]; j++) {
char type = types[j];
- // printf("--> [%c - (%d-%d)]\n", type, k, j);
+ /* printf("--> [%c - (%d-%d)]\n", type, k, j); */
switch (type) {
case TS_OFFSET:{
/* label(destination position) */
@@ -1448,7 +1448,7 @@ set_exception_table(yarv_iseq_t *iseq)
entry->cont = 0;
}
}
- //
+
iseq->compile_data->catch_table_ary = 0; /* free */
return COMPILE_OK;
}
@@ -1600,8 +1600,8 @@ iseq_peephole_optimize(yarv_iseq_t *iseq, LINK_ELEMENT *list)
if (piobj->insn_id == BIN(send)) {
/* TODO: tail call optimization */
if (piobj->operands[2] == 0) {
- //piobj->operands[3] = INT2FIX(FIX2INT(piobj->operands[3]) | VM_CALL_TAILCALL_BIT);
- //piobj->operands[3] = INT2FIX(FIX2INT(piobj->operands[3]) | VM_CALL_TAILRECURSION_BIT);
+ /* piobj->operands[3] = INT2FIX(FIX2INT(piobj->operands[3]) | VM_CALL_TAILCALL_BIT); */
+ /* piobj->operands[3] = INT2FIX(FIX2INT(piobj->operands[3]) | VM_CALL_TAILRECURSION_BIT); */
}
}
}
@@ -1869,7 +1869,7 @@ set_sequence_stackcaching(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
/* initialize */
state = SCS_XX;
list = FIRST_ELEMENT(anchor);
- // dump_disasm_list(list);
+ /* dump_disasm_list(list); */
/* for each list element */
while (list) {
@@ -1879,7 +1879,7 @@ set_sequence_stackcaching(yarv_iseq_t *iseq, LINK_ANCHOR *anchor)
INSN *iobj = (INSN *)list;
insn_id = iobj->insn_id;
- // dump_disasm_list(list);
+ /* dump_disasm_list(list); */
switch (insn_id) {
case BIN(nop):{
@@ -2133,11 +2133,11 @@ make_masgn_lhs(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
default:{
DECL_ANCHOR(anchor);
COMPILE_POPED(anchor, "masgn lhs", node);
- // dump_disasm_list(FIRST_ELEMENT(anchor));
+ /* dump_disasm_list(FIRST_ELEMENT(anchor)); */
REMOVE_ELEM(FIRST_ELEMENT(anchor));
- // dump_disasm_list(FIRST_ELEMENT(anchor));
+ /* dump_disasm_list(FIRST_ELEMENT(anchor)); */
ADD_SEQ(ret, anchor);
- // ADD_ELEM(ret, LAST_ELEMENT(anchor));
+ /* ADD_ELEM(ret, LAST_ELEMENT(anchor)); */
}
}
@@ -2249,7 +2249,7 @@ compile_massign(yarv_iseq_t *iseq, LINK_ANCHOR *ret,
COMPILE(ret, "rhs to ary (splat/default)", rhsn);
ADD_INSN2(ret, nd_line(rhsn), expandarray, INT2FIX(llen),
INT2FIX(lhs_splat));
- // rb_bug("unknown rhs: %s", node_name(nd_type(rhsn)));
+ /* rb_bug("unknown rhs: %s", node_name(nd_type(rhsn))); */
}
}
else {
@@ -2464,7 +2464,7 @@ defined_expr(yarv_iseq_t *iseq, LINK_ANCHOR *ret,
ADD_CATCH_ENTRY(CATCH_TYPE_ENSURE, lstart, lend, ensure, lfinish);
return 1;
- // rb_bug("unimplemented defined: %s", node_name(nd_type(node)));
+ /* rb_bug("unimplemented defined: %s", node_name(nd_type(node))); */
} /* end of default */
}
@@ -4791,7 +4791,7 @@ iseq_build_body(yarv_iseq_t *iseq, LINK_ANCHOR *anchor,
VALUE insn_id;
if (st_lookup(insn_table, rb_ary_entry(obj, 0), &insn_id) == 0) {
- // TODO: exception
+ /* TODO: exception */
rb_bug("unknown instruction: ");
}
View
@@ -213,4 +213,4 @@ r_value(VALUE value)
LINK_ANCHOR name##_body__ = {{0,}, &name##_body__.anchor}; \
LINK_ANCHOR *name = & name##_body__
-#endif // _COMPILER_H_INCLUDED_
+#endif /* _COMPILER_H_INCLUDED_ */
View
@@ -44,4 +44,4 @@ void gc_check_func();
#endif
-#endif // _DEBUG_H_INCLUDED_
+#endif /* _DEBUG_H_INCLUDED_ */
View
32 eval.c
@@ -514,7 +514,7 @@ rb_remove_event_hook(rb_event_hook_func_t func)
static void
rb_clear_trace_func(void)
{
- // TODO: fix me
+ /* TODO: fix me */
}
/*
@@ -575,8 +575,8 @@ set_trace_func(VALUE obj, VALUE trace)
rb_raise(rb_eTypeError, "trace_func needs to be Proc");
}
- // register trace func
- // trace_func = trace;
+ /* register trace func */
+ /* trace_func = trace; */
for (hook = event_hooks; hook; hook = hook->next) {
if (hook->func == call_trace_func)
@@ -614,7 +614,7 @@ get_event_name(rb_event_t event)
static void
call_trace_func(rb_event_t event, NODE *node, VALUE self, ID id, VALUE klass)
{
- // TODO: fix me
+ /* TODO: fix me */
#if 0
int state, raised;
NODE *node_save;
@@ -905,9 +905,11 @@ rb_longjmp(tag, mesg)
VALUE at;
yarv_thread_t *th = GET_THREAD();
+ /*
//while (th->cfp->pc == 0 || th->cfp->iseq == 0) {
//th->cfp++;
//}
+ */
if (thread_set_raised(th)) {
th->errinfo = exception_error;
@@ -955,7 +957,7 @@ rb_longjmp(tag, mesg)
rb_trap_restore_mask();
if (tag != TAG_FATAL) {
- // EXEC_EVENT_HOOK(RUBY_EVENT_RAISE ...)
+ /* EXEC_EVENT_HOOK(RUBY_EVENT_RAISE ...) */
}
thread_reset_raised(th);
JUMP_TAG(tag);
@@ -1072,7 +1074,7 @@ void
rb_raise_jump(mesg)
VALUE mesg;
{
- // TODO: fix me
+ /* TODO: fix me */
rb_longjmp(TAG_RAISE, mesg);
}
@@ -1271,7 +1273,7 @@ rb_iterate(VALUE (*it_proc) (VALUE), VALUE data1,
th->cfp = cfp;
}
else{
- // SDR(); printf("%p, %p\n", cdfp, escape_dfp);
+ /* SDR(); printf("%p, %p\n", cdfp, escape_dfp); */
}
}
else if (state == TAG_RETRY) {
@@ -1432,8 +1434,8 @@ rb_ensure(VALUE (*b_proc)(ANYARGS), VALUE data1, VALUE (*e_proc)(ANYARGS), VALUE
result = (*b_proc) (data1);
}
POP_TAG();
- // TODO: fix me
- // retval = prot_tag ? prot_tag->retval : Qnil; /* save retval */
+ /* TODO: fix me */
+ /* retval = prot_tag ? prot_tag->retval : Qnil; */ /* save retval */
(*e_proc) (data2);
if (state)
JUMP_TAG(state);
@@ -1646,18 +1648,22 @@ rb_call(VALUE klass, VALUE recv, ID mid, int argc, const VALUE *argv, int scope)
{
VALUE val;
+ /*
//static int level;
//int i;
//for(i=0; i<level; i++){printf(" ");}
//printf("invoke %s (%s)\n", rb_id2name(mid), node_name(nd_type(body)));
//level++;
//printf("%s with %d args\n", rb_id2name(mid), argc);
+ */
val =
th_call0(GET_THREAD(), klass, recv, mid, id, argc, argv, body,
noex & NOEX_NOSUPER);
+ /*
//level--;
//for(i=0; i<level; i++){printf(" ");}
//printf("done %s (%s)\n", rb_id2name(mid), node_name(nd_type(body)));
+ */
return val;
}
}
@@ -1958,7 +1964,7 @@ eval(VALUE self, VALUE src, VALUE scope, char *file, int line)
th->parse_in_eval--;
th_set_eval_stack(th, iseqval);
th->base_block = 0;
- if (0) { // for debug
+ if (0) { /* for debug */
printf("%s\n", RSTRING_PTR(iseq_disasm(iseqval)));
}
@@ -2075,7 +2081,7 @@ exec_under(VALUE (*func) (VALUE), VALUE under, VALUE self, VALUE args)
pcfp->self = self;
if ((blockptr = GC_GUARDED_PTR_REF(*th->cfp->lfp)) != 0) {
/* copy block info */
- // TODO: why?
+ /* TODO: why? */
block = *blockptr;
block.self = self;
*th->cfp->lfp = GC_GUARDED_PTR(&block);
@@ -2956,9 +2962,9 @@ rb_dvar_defined(ID id)
iseq->type == ISEQ_TYPE_ENSURE ||
iseq->type == ISEQ_TYPE_EVAL) {
int i;
- // printf("local size: %d\n", iseq->local_size);
+ /* printf("local size: %d\n", iseq->local_size); */
for (i = 0; i < iseq->local_size; i++) {
- // printf("id (%4d): %s\n", i, rb_id2name(iseq->local_tbl[i]));
+ /* printf("id (%4d): %s\n", i, rb_id2name(iseq->local_tbl[i])); */
if (iseq->local_tbl[i] == id) {
return Qtrue;
}
View
@@ -203,45 +203,45 @@ error_handle(int ex)
if (thread_set_raised(th))
return EXIT_FAILURE;
switch (ex & TAG_MASK) {
- case 0:
+ case 0:
status = EXIT_SUCCESS;
break;
- case TAG_RETURN:
+ case TAG_RETURN:
error_pos();
warn_print(": unexpected return\n");
break;
- case TAG_NEXT:
+ case TAG_NEXT:
error_pos();
warn_print(": unexpected next\n");
break;
- case TAG_BREAK:
+ case TAG_BREAK:
error_pos();
warn_print(": unexpected break\n");
break;
- case TAG_REDO:
+ case TAG_REDO:
error_pos();
warn_print(": unexpected redo\n");
break;
- case TAG_RETRY:
+ case TAG_RETRY:
error_pos();
warn_print(": retry outside of rescue clause\n");
break;
- case TAG_THROW:
- // TODO: fix me
+ case TAG_THROW:
+ /* TODO: fix me */
error_pos();
warn_printf(": unexpected throw\n");
break;
- case TAG_RAISE:
- case TAG_FATAL:
+ case TAG_RAISE:
+ case TAG_FATAL:
if (rb_obj_is_kind_of(GET_THREAD()->errinfo, rb_eSystemExit)) {
status = sysexit_status(GET_THREAD()->errinfo);
}
else {
error_print();
}
break;
- default:
+ default:
rb_bug("Unknown longjmp status %d", ex);
break;
}
View
@@ -266,7 +266,7 @@ static void call_end_proc _((VALUE data));
static void
call_end_proc(VALUE data)
{
- // TODO: fix me
+ /* TODO: fix me */
proc_invoke(data, rb_ary_new2(0), Qundef, 0);
}
View
@@ -211,7 +211,7 @@ load_wait(char *ftptr)
return Qfalse;
}
- // TODO: write wait routine
+ /* TODO: write wait routine */
return Qtrue;
}
@@ -376,7 +376,7 @@ rb_require_safe(VALUE fname, int safe)
ruby_current_node = 0;
ruby_sourcefile = rb_source_filename(RSTRING_PTR(path));
ruby_sourceline = 0;
- //SCOPE_SET(NOEX_PUBLIC);
+ /* SCOPE_SET(NOEX_PUBLIC); */
handle = (long)dln_load(RSTRING_PTR(path));
rb_ary_push(ruby_dln_librefs, LONG2NUM(handle));
break;
View
@@ -359,7 +359,7 @@ void
rb_thread_fd_close(fd)
int fd;
{
- // TODO: fix me
+ /* TODO: fix me */
}
VALUE
View
4 gc.c
@@ -487,7 +487,7 @@ rb_fill_value_cache(yarv_thread_t *th)
int i;
VALUE rv;
- // LOCK
+ /* LOCK */
for (i=0; i<YARV_VALUE_CACHE_SIZE; i++) {
VALUE v = rb_newobj_from_heap();
@@ -496,7 +496,7 @@ rb_fill_value_cache(yarv_thread_t *th)
}
th->value_cache_ptr = &th->value_cache[0];
rv = rb_newobj_from_heap();
- // UNLOCK
+ /* UNLOCK */
return rv;
}
#endif
View
@@ -143,4 +143,4 @@
#define BASIC_OP_UNREDEFINED_P(op) ((yarv_redefined_flag & (op)) == 0)
#define HEAP_CLASS_OF(obj) RBASIC(obj)->klass
-#endif // _INSNHELPER_H_INCLUDED_
+#endif /* _INSNHELPER_H_INCLUDED_ */
Oops, something went wrong.

0 comments on commit 205f310

Please sign in to comment.