summaryrefslogtreecommitdiffstats
path: root/iseq.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * thread.c (rb_enable_coverages): hide coverage array by setting 0 tomame2008-07-081-1/+1
| | | | | | | | | | | | | | | | | klass during measurement. * parse.y (coverage, yycompile0): ditto. * iseq.c (prepare_iseq_build): use rb_hash_lookup instead of rb_hash_aref. * thread.c (rb_coverage_result): restore klass of coverage array and return it. * theaad.c (update_coverage): chcek whether its klass is 0. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: remove prototypes about coverage.mame2008-07-031-1/+2
| | | | | | | | | | | | | | | | | | | * iseq.c (prepare_iseq_build): add prototype. * parse.y (coverage): ditto. * thread.c (clear_coverage): ditto. * thread.c (update_coverage): use rb_sourceline. * thread.c (rb_get_coverages): rename and move to vm.c. * vm.c (rb_vm_get_coverages): ditto. * ext/coverage/coverage.c: add rdoc. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/coverage/coverage.c, ext/coverage/extconf.rb: eliminatemame2008-07-031-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | COVERAGE__ and introduce coverage.so instead. How to measure coverage: (1) require "coverage.so", (2) require or load Ruby source file, and (3) Coverage.result will return the same hash as COVERAGE__. [ruby-dev:35324] * thread.c (rb_enable_coverages): start coverage measurement by using rb_add_event_hook. * thread.c (rb_get_coverages): returns current results of coverage measurement. * include/ruby/intern.h: add prototype for above two functions. * vm_core.h, vm.c: add field of coverages to rb_vm_t. * insns.def (trace): remove special handling for COVERAGE__. * iseq.c (prepare_iseq_build): switch COVERAGE__ to rb_get_coverages(). * parse.y (coverage): ditto. * thread.c (clear_coverage): ditto. * lib/coverage.rb: use coverage.so instead of COVERAGE__. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Add coverage measurement constant COVERAGE__. This constant is notmame2008-07-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for casual use. Usage: (1) assign {} to COVERAGE__, (2) require or load Ruby source file, and (3) COVERAGE__["sourcefilepath"] will return an array whose elements represent number of executions per line of source code. * vm_core.h: add field of coverage array to iseq. * iseq.c (prepare_iseq_build): ditto. * insns.def (trace): update coverage array. * parse.y (coverage): create and initialize coverage array. * compile.h (ADD_TRACE): add trace instruction to update covearge array. * thread.c (clear_coverage): delete coverage array when forking. Otherwise, double count of coverage may occur. * lib/coverage.rb: sample coverage measurement tool. * error.c: distinguish explicitly between parse_in_eval and mild_compile_error. * load.c: ditto. * vm_eval.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (COMPILE_OPTION_FALSE), time.c (timegm_noleapsecond),nobu2008-07-011-1/+1
| | | | | | | | thread.c (eKillSignal, eTerminateSignal), missing/vsnprintf.c (BSD_vfprintf): constified. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c, vm_core.h,vm_core.h, vm_dump.c, iseq.c: rename class nameko12008-06-291-1/+1
| | | | | | | | | | | | VM -> RubyVM, and rename rb_cVM -> rb_cRubyVM. "VM" is too short name for class. * test/ruby/test_method.rb, test/ruby/test_settracefunc.rb: ditto. * include/ruby/ruby.h: rb_cRubyVM, rb_cEnv, rb_cISeq should not be exposed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu2008-06-091-6/+6
| | | | | | | * *.c: no cache in init functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings on cygwin, mingw and mswin.nobu2008-06-011-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings with -Wwrite-string.nobu2008-05-311-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (rb_iseq_compile_with_option): get rid of segv.nobu2008-05-221-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (iseq_load, iseq_data_to_ary): supportmame2008-05-221-0/+4
| | | | | | | ISEQ_TYPE_DEFINED_GUARD. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (insn_operand_intern): remove Qundef related code.ko12008-05-141-8/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (insn_operand_intern): should handle Qundef embedded inmatz2008-05-051-3/+8
| | | | | | operand. [ruby-core:16656] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (rb_iseq_compile_with_option): check if src is a strring.nobu2008-04-211-1/+1
| | | | | | | [ruby-core:16453] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, compile.h (compile_debug): made runtime option.nobu2008-04-141-0/+10
| | | | | | | | | | | | | | | | | * debug.c (ruby_debug_print_indent): returns if debug_level exceeds the threashold. * debug.c (ruby_debug_printf): printf to stderr. * iseq.c (make_compile_option, make_compile_option_value): added debug_level option. * vm_core.h (rb_compile_option_t): added debug_level. * vm_core.h (struct iseq_compile_data): added node_level. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_set_sequence, iseq_insns_unification,nobu2008-04-031-3/+3
| | | | | | | | | | | | | insn_data_to_s_detail): constified. * iseq.c (insn_operand_intern, ruby_iseq_disasm_insn): ditto. * template/{insns_info,opt_sc,optunifs}.inc.tmpl: ditto. * tool/instruction.rb (OptUnifsIncGenerator): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_build_from_ary), iseq.c (iseq_load): fix for format change.nobu2008-01-081-16/+16
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * $Date$ keyword removed to avoid inclusion of locale dependentakr2008-01-061-1/+0
| | | | | | | string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c: all methods need $SAFE < 1.ko12007-12-251-0/+10
| | | | | | | | vm.c: comment out debug functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c, vm_core.h: comment out unused fields.ko12007-12-251-5/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (method_name): preserve Symbol's encoding.matz2007-12-241-1/+1
| | | | | | * numeric.c (fix_id2name): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (Init_ISeq): disable ISeq.load() because there is no verifier.ko12007-12-241-5/+25
| | | | | | | | * iseq.c, proc.c: add ISeq.disasm(method). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (find_line_no): return 0 if not found.ko12007-12-201-0/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each): add pop after throw as return.ko12007-12-191-13/+28
| | | | | | | | | * bootstraptest/test_knownbug.rb, test_syntax.rb: move resolved test. * vm_core.h, iseq.c, compile.h: add debug output code. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (ruby_iseq_disasm): fix to show arg_simple value.ko12007-08-161-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_dump.c (debug_print_pre): fix to show control frame count.ko12007-08-121-1/+7
| | | | | | | | | | | | | | | | * insns.def (opt_call_c_function): fix operand type. * lib/vm/instruction.rb: ditto. * insnhelper.ci (vm_push_frame, vm_pop_frame): fix to show control stack status on if VMDEBUG == 2. * vm.h: add a comment about VMDEBUG. * iseq.c (find_prev_line_no): fix to skip bug report if line is not found. * lib/vm/instruction.rb: fix to use build_string() on source code generators. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (iseq_s_compile_option_get, Init_ISeq): added a newnobu2007-08-061-4/+14
| | | | | | | method VM::InstructionSequence::compile_option. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (node_name.inc): auto-generate node name list.nobu2007-08-061-230/+1
| | | | | | | | | * iseq.c (ruby_node_name): ditto. * tool/node_name.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * blockinlining.c: remove "yarv" prefix.ko12007-07-121-29/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * array.c, numeric.c: ditto. * insnhelper.ci, insns.def, vm_evalbody.ci: ditto. * yarvcore.c: removed. * yarvcore.h: renamed to core.h. * cont.c, debug.c, error.c, process.c, signal.c : ditto. * ext/probeprofiler/probeprofiler.c: ditto. * id.c, id.h: added. * inits.c: ditto. * compile.c: rename internal functions. * compile.h: fix debug flag. * eval.c, object.c, vm.c: remove ruby_top_self. use rb_vm_top_self() instead. * eval_intern.h, eval_load: ditto. * gc.c: rename yarv_machine_stack_mark() to rb_gc_mark_machine_stack(). * insnhelper.h: remove unused macros. * iseq.c: add iseq_compile() to create iseq object from source string. * proc.c: rename a internal function. * template/insns.inc.tmpl: remove YARV prefix. * thread.c: * vm.c (rb_iseq_eval): added. * vm.c: move some functions from yarvcore.c. * vm_dump.c: fix to remove compiler warning. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,nobu2007-07-051-10/+14
| | | | | | | | | eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c, yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline, ruby_nerrs): purge global variables. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (set_relation): added.ko12007-07-031-34/+44
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c: rename iseq_translate_direct_threaded_code()ko12007-07-021-0/+10
| | | | | | | | | | | | | to iseq_translate_threaded_code(). * eval_intern.h, yarvcore.h: mv EXEC_EVENT_HOOK() and exec_event_hooks() to yarvcore.h. * insnhelper.ci, vm.c: mv yarv_finish_insn_seq to vm.c. * insns.def (opt_call_c_function): fix to use RESTORE_REGS(). * iseq.c (rb_iseq_build_for_ruby2cext): fix to allocate iseq. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_intern.h, yarvcore.h: move declaration of sysstack_errorko12007-07-011-17/+17
| | | | | | | | | | | to yarvcore.h. * iseq.c: fix symbol name (:toplevel -> :top). * lib/vm/instruction.rb, template/vm.inc.tmpl: replacable current file name. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, iseq.c: fix iseq some of load/store process.ko12007-07-011-19/+31
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * yarvcore.h, compile.c, insnhelper.ci, iseq.c, vm.c:ko12007-07-011-10/+51
| | | | | | | | | | | | rename structure names and field names. * insnhelper.h, insns.def: add GET_CONST_INLINE_CACHE(). * iseq.c: add rb_iseq_build_for_ruby2cext(). * yarvcore.h, vm.h: move declaration of rb_insn_func_t to yarvcore.h. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * yarvcore.h: some refactoring on rb_iseq_t.ko12007-06-301-5/+5
| | | | | | | | | rename some variable names, add comments, etc. * compile.c, iseq.c, proc.c, vm.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h, parse.y, gc.c, iseq.c: remove NODE_CREF.ko12007-06-271-2/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (ruby_node_name): update node names.ko12007-06-261-2/+18
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.h: add RUBY_ prefix to debug macros.ko12007-06-251-21/+21
| | | | | | | | | | | | * cont.c, proc.c, yarvcore.c, * gc.c: define ruby_gc_debug_indent variable to debug mark/free. * vm.c, insnhelper.ci: rename some functions to vm_* or rb_vm_*. move some functions, definitions, declarations to suitable files. * eval.c, yarvcore.h, eval_error.ci, insnhelper.ci: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * call_cfunc.ci: removed.ko12007-06-241-3/+0
| | | | | | | | | | | | | | | | * insnhelper.ci: added. this function includes all functions that vm insns need. * common.mk: ditto. * insnhelper.h, vm.h, vm.c: move some declaration. * gc.h: remove GC_CHECK() macro because GC.stress is more useful. * compile.c, iseq.c, vm_dump: ditto. * gc.h, thread.c: move a prototype decalaration. * debug.c, debug.h: rename some functions. * compile.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c: some refactoring.ko12007-06-241-1/+1
| | | | | | | | | | | | | | * rename th_* to vm_*. * remove unused variables functions. * add prototypes. * blockinlining.c, compile.c, cont.c, eval.c, eval_intern.h, eval_jump.h, eval_load.c, inits.c, insns.def, iseq.c, parse.y, proc.c, process.c, signal.c, thread.c, vm.c, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (callee_setup_arg): added. support correct post arg.ko12007-06-241-3/+5
| | | | | | | | | | | | | | * vm_macro.def (macro_eval_invoke_func): fix to use callee_setup_arg. * compile.c (set_arguments): adjust for above changes. * compile.c (iseq_compile_each): ditto. * iseq.c (ruby_iseq_disasm): ditto. * yarvcore.h: add rb_iseq_t#post_arg_start and arg_size. * bootstraptest/test_method.rb: add post arg tests. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby: moved public headers.nobu2007-06-101-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (prepare_iseq_build): freeze filename and name string.ko12007-06-071-1/+4
| | | | | | | | * variable.c: freeze class name string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, vm_macro.def: support tail call optimizationko12007-05-211-3/+8
| | | | | | | | | | | | | (on default, this feature is not enabled). * iseq.c, compile.c, vm_opts.h: add "tailcall_optimization" option. * sample/test.rb (test_ok): fix to adjust tailcall stack layout. * insns.def, vm.c, compile.c, yarvcore.c, yarvcore.h: add opt_gt, opt_le instructions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (ruby_iseq_disasm): fix to show post arg info.ko12007-05-171-2/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (iseq_data_to_ary): internal IDs must not be exposed.nobu2007-05-111-160/+160
| | | | | | | | | | [ruby-core:11073] * parse.y (internal_id_gen): now returns scope local ID instead of global one. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, node.h, thread.c, yarvcore.[ch], eval_intern.h:ko12007-04-191-0/+2
| | | | | | | | | | | | | | | | | support set_trace_func (incomplete. id and klass don't be passed). And support Thread#set_trace_func which hook only specified thread and Thread#add_trace_func which add new trace func instead of replace old one. C level API was modified. See thread.c (logic) and yarvcore.h (data structures). * vm.c, vm_macro.def: add hook points. * compile.c, insns.def: fix "trace" instruction. * iseq.c, vm_macro.h: add compile option "trace_instruction". * test/ruby/test_settracefunc.rb: hook "c-return" of set_trace_func. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,ko12007-03-211-13/+21
| | | | | | | | | | | | | proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h, debug.c, debug.h: merge half-baked-1.9 changes. The biggest change is to change node structure around NODE_SCOPE, NODE_ARGS. Every scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS represents more details of arguments information. I'll write a document about detail of node structure. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c: iseq_compile -> rb_iseq_compile.aamine2007-03-081-2/+2
| | | | | | | | | | | | | | | * iseq.c: ditto. * intern.h: provide function prototype of Init_jump. * eval_jump.h (Init_jump): declare function type. * thread.c: platform-dependent functions should be surrounded by #ifdef. * iseq.c (iseq_data_to_ary): remove unused variable. * compile.c (set_arguments): ditto. * thread.c (set_unblock_function): ditto. * thread_pthread.ci: reduce printf warning. * vm_dump.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e