* insns.def (onceinlinecache, setinlinecache): save a value
to mark cached value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
represents line number from which the original code of the iseq
starts. [ruby-dev:38698]
* iseq.c, compile.c: ditto.
* parse.y: line number hack (for Proc#source_location) is no longer
needed.
* test/ruby/test_settracefunc.rb: line number of set_trace_func is now
compatible with 1.8's.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
method management. This change affect some VM control stack structure.
* vm.c, vm_insnhelper.c, vm_method.c, vm_eval.c: ditto. and make some
refactoring.
* insns.def, class.c, eval.c, proc.c, vm_dump.c : ditto.
* vm_core.h, compile.c (iseq_specialized_instruction): remove
VM_CALL_SEND_BIT. use another optimization tech for Kernel#send.
* node.h: remove unused node types.
* ext/objspace/objspace.c (count_nodes): ditto.
* gc.c: add mark/free functions for method entry.
* include/ruby/intern.h: remove decl of
rb_define_notimplement_method_id(). nobody can use it
because noex is not opend.
* iseq.c (iseq_mark): fix to check ic_method is available.
* iseq.c (rb_iseq_disasm): fix to use rb_method_get_iseq().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
fix to use inline cache.
* compile.c: fix to skip inline cache entry (IC). IC is added
automatically by compiler.
* insns.def, vm_insnhelper.h: fix IC positions.
* iseq.c: increment minor_version of ISeq because of above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for ISeq.
* vm.c (env_memsize, vm_memsize, thread_memsize): added. Use
RTypedData instead of RData for Env, VM, Thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
functions based on [ruby-dev:37983]
* insns.def (putstring, duparray): use rb_{ary,str}_resurrect().
* iseq.c (iseq_data_to_ary): needs to result TS_VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c (vm_set_main_stack, rb_iseq_eval_main): added.
* parse.y (rb_parser_compile_file): fix to check parse_in_eval flag.
* eval.c (ruby_exec_node): use rb_iseq_eval_main()
instead of rb_iseq_eval().
* iseq.c (rb_iseq_new_main), vm_core.h: added.
main script (specified by -e or script name) should be run
under TOPLEVEL_BINDING using Kernel#eval. Above changes
simulate Kernel#eval behaviour. [ruby-dev:37240]
* compile.c (make_name_for_block): skip iseq except block type.
this fix is needed for [ruby-dev:37240], and also fixes
[ruby-dev:35392].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This change stop to install node.h beacuase of saving ABI
(node.h will be changed. Extensions should not depends on
this file).
* blockinlining.c, class.c, compile.c, debug.h, enum.c,
gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c,
vm.c, vm_core.h, vm_dump.c: ditto.
* ext/ripper/depend: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-dev:35116]
* iseq.c (iseq_mark): mark original iseq object.
* iseq.c (iseq_free): do not free internal data if they have
original iseq to belong.
* iseq.c (rb_iseq_clone): a new function to clone iseq value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@17959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@17857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@17781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@17723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@12922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@12680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@12677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@12605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-core:11073]
* parse.y (internal_id_gen): now returns scope local ID instead of
global one.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@12195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
object.c, string.c, variable.c, vm_macro.def: revert private
instance variable feature, which is postponed until next major
release.
* marshal.c: TYPE_SYMBOL2 removed; MARSHAL_MINOR reverted back to
8th version.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
moving definitions place, add/remove prototypes, deleting
unused variables and removing yarv.h.
This commit doesn't change any behavior of ruby/vm.
* yarv.h, common.mk: remove yarv.h (contents are moved to yarvcore.h).
* error.c, eval_intern.h: include yarvcore.h instead yarv.h
* rename some functions:
* debug.[ch]: debug_*() -> ruby_debug_*()
* iseq.c: iseq_*() -> rb_iseq_*(), ruby_iseq_disasm()
* iseq.c: node_name() -> ruby_node_name()
* vm.c: yarv_check_redefinition_opt_method() ->
rb_vm_check_redefinition_opt_method()
* some refactoring with checking -Wall.
* array.c: remove rb_ary_ptr() (unused) and remove unused
local variables.
* object.c: add a prototype of rb_mod_module_exec().
* eval_intern.h (ruby_cref): set it inline.
* eval_load.c (rb_load), yarvcore.c: yarv_load() -> rb_load_internal().
* parse.y: add a prototype of rb_parse_in_eval() (in eval.c).
* process.c: add a prototype of rb_thread_stop_timer_thread() (in thread.c).
* thread.c: remove raw_gets() function (unused) and fix some format
mismatch (format mismatchs have remained yet. this is todo).
* thread.c (rb_thread_wait_fd_rw): fix typo on label name.
* thread_pthread.ci: comment out codes with USE_THREAD_CACHE.
* vm.c (rb_svar, rb_backref_get, rb_backref_get,
rb_lastline_get, rb_lastline_set) : moved from yarvcore.c.
* vm.c (yarv_init_redefined_flag): add a prototype and rename
yarv_opt_method_table to vm_opt_method_table.
* vm.c (rb_thread_eval): moved from yarvcore.c.
* yarvcore.c: remove unused global variables and fix to use nsdr().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
symbol from a symbol and a class. back-ported from matzruby.
* parse.y (rb_decompose_ivar2): reverse function of
rb_compose_ivar2().
* marshal.c (w_symbol): support class local instance variables.
* marshal.c (r_object0): ditto.
* compile.c (defined_expr): ditto.
* compile.c (iseq_compile_each): ditto.
* insns.def: add two new instructions: getinstancevariable2 and
setinstancevariable2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_proc.c: renamed to proc.c.
* common.mk: ditto.
* yarvcore.h, yarvcore.c: rename or remove some global variables
removed: mYarvCore, mYarvInsns
renamed: cYarvISeq -> rb_cISeq,
cYarvProc -> rb_cProc, cYarvBinding -> rb_cBinding
::YarvCore module is removed and ::YarvCore::VM class becomes ::VM.
And change/remove some functions which added with YARV.
* compile.c: ditto.
* eval.c: ditto.
* iseq.c: ditto.
* vm.c: ditto.
* inits.c: rename Init_yarvcore to Init_vm.
* yarvcore.c, proc.c: move some functions and initialization
from yarvcore.c to proc.c.
* intern.h, proc.c: add global function rb_binding_new(void).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e