summaryrefslogtreecommitdiff
path: root/iseq.c
AgeCommit message (Collapse)Author
2009-12-23* iseq.c (iseq_s_disasm): return nil for native methods.nobu
[ruby-core:27226], [Bug#2499] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-19* iseq.c (prepare_iseq_build, rb_iseq_build_for_ruby2cext):nobu
untrust mark array. [ruby-core:26137] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16* gc.h (rb_gc_debug_body): constified.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-08* compile.c (ADD_TRACE): fire coverage event in ensure clause.mame
[ruby-dev:39303] * iseq.h, iseq.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-07* iseq.c (iseq_s_disasm): accept proc objects. [ruby-core:18762]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25* iseq.c (compile_string): rename to parse_string(), becauseko1
this function only parse String to NODE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c, vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl, tool/instruction.rb: fixed types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09* include/ruby/ruby.h (rb_data_type_struct): constified dsize.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08* iseq.c (iseq_mark): use preprocessor.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08* iseq.c (iseq_mark): no need to mark inline cache entries.ko1
* 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
2009-08-28* iseq.c (iseq_mark): skip outdated cache entries.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-28* iseq.c (iseq_mark): made invariant expressions constant references.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-10* gc.c: reject unused longlife gc.nari
* debug.c: ditto. * include/ruby/intern.h: ditto. * include/ruby/ruby.h: ditto. * iseq.c: ditto. * node.h: ditto. * vm_insnhelper.c: ditto. * vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-22* vm_core.h (struct rb_iseq_t): add a new field line_no. This fieldmame
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
2009-07-16* node.h, vm_core.h, variable.c: rename global_entry to rb_global_entry.ko1
* compile.c, insns.def, iseq.c, vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-15* method.h, vm_core.h: add rb_method_entry_t. Remove nodes aroundko1
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
2009-07-13* vm_core.h, compile.c: declare struct iseq_inline_cache_entry.ko1
Inline cache (IC) entries are no longer GC managed object. IC entries are freed when ISeq is freed. * iseq.c: fix mark, free, memsize functions for above change. * insns.def: remove rb_gc_write_barrier(). * vm_insnhelper.c (vm_method_search): ditto. * tool/instruction.rb, template/insns_info.inc.tmpl (insn_iclen): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-13* insns.def, vm_insnhelper.c (getinstancevariable):ko1
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
2009-07-07* include/ruby/ruby.h:ko1
rename "...TypeStruct" and "typed_struct" to "TypedData..." and "typeddata", respectively. rename rb_data_type_t#name to rb_data_type_t#wrap_struct_name. * error.c, gc.c, iseq.c, vm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07* iseq.c: provisional type fixes.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16* iseq.c (iseq_memsize): added. Use RTypedData instead of RDatako1
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
2009-05-16* iseq.c (rb_iseq_clone): use longlife object and insert write barrier.nari
* vm_insnhelper.c (vm_cref_push): ditto. * vm_insnhelper.h (COPY_CREF): insert write barrier. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-13* gc.c: add longlife garbage collection. [ruby-dev:38423]nari
(NORMAL_HEAPS_USED): new macro. (LONGLIFE_ALLOCATE_HEAPS_MIN): ditto. (add_longlife_heaps_slot): new function. (rb_newobj_from_longlife_heap): ditto. (rb_newobj_longlife): ditto. (rb_node_newnode_longlife): ditto. (rb_gc_write_barrier): ditto. (remembered_set_recycle): ditto. (rb_gc_mark_remembered_set): ditto. (clear_mark_longlife_heaps): ditto. (gc_sweep_for_longlife): ditto. (assign_heap_slot): new argumnent to longlife heaps slot. (add_freelist): ditto. (gc_sweep): avoid lonlife heap slot. set longlife_collection flag at add heap. (rb_gc_force_recycle): avoid mark object and remembered_set object. (garbage_collect): add longlife collection. (rb_gc_start): invoke longlife collection. (gc_profile_record_get): for longlife collction profile. (gc_profile_result): ditto. * include/ruby/intern.h (rb_gc_write_barrier): declared. * include/ruby/ruby.h (FL_REMEMBERED_SET): renamed from FL_RESERVED. * debug.c (FL_REMEMBERED_SET): ditto. * insns.def (setinlinecache): insert write barrier. * vm_insnhelper.c (vm_method_search): ditto. * set_relation (set_relation): use longlife object. * vm.c (vm_define_method): ditto. * vm_core.h (NEW_INLINE_CACHE_ENTRY): ditto. * vm_method.c (rb_add_method): ditto. * class.c (rb_add_method): ditto. * node.h (NEW_NODE_LONGLIFE): new macro. (rb_node_newnode_longlife): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-11* iseq.c (rb_iseq_disasm): RSTRING_LEN() returns long.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-10* iseq.c (prepare_iseq_build): too few arguments to functionnobu
rb_ary_tmp_new(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-10* iseq.c (rb_iseq_compile_with_option): argument may be converted.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-26* iseq.c (cdhash_each): resurrects internal literals.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22stripped trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-18* array.c (rb_ary_resurrect), string.c (rb_str_resurrect): newnobu
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
2009-02-14* iseq.c: remove nil parameter from Proc#parameterstakano32
after rest appeared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-13* iseq.c (simple_default_value): removed. default values of optionalnobu
parameters are not available still now. [ruby-dev:37980] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12* compile.c (compile_array_, defined_expr, iseq_compile_each): hidenobu
and freeze internal literal objects, to prevent from modifying. [ruby-dev:37959] * iseq.c (insn_operand_intern): copy internal literal objects. * insns.def (putstring, duparray): ditto. * string.c (rb_str_replace): exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12* iseq.c (simple_default_value): allow plain strings as defaultmatz
values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19* iseq.c:ko1
rename ruby_iseq_disasm_insn() -> rb_iseq_disasm_insn(). rename ruby_iseq_disasm() -> rb_iseq_disasm(). * compile.c: rename ruby_iseq_compile() -> rb_iseq_compile_node(). rename ruby_iseq_translate_threaded_code() -> rb_iseq_translate_threaded_code(). rename ruby_insns_name_array() -> rb_insns_name_array(). rename ruby_iseq_build_from_ary() -> rb_iseq_build_from_ary(). * iseq.c, compile.c: remove ruby_insn_make_insn_table() and make static function insn_make_insn_table(). * iseq.h, ruby.c, vm.c, vm_core.h, vm_eval.c, vm_dump.c, blockinlining.c: ditto. Rename strange "ruby_" prefix to "rb_" prefix. This changes may affect only core because renamed functions require a pointer of rb_iseq_t which is not exposed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18* iseq.c (rb_iseq_load): renamed from ruby_iseq_load, since it isnobu
for C extensions or the ruby core. [ruby-core:21407] Index: compile.c =================================================================== --- compile.c (revision 21649) +++ compile.c (working copy) @@ -5078,5 +5078,5 @@ iseq_build_exception(rb_iseq_t *iseq, st } else { - eiseqval = ruby_iseq_load(ptr[1], iseq->self, Qnil); + eiseqval = rb_iseq_load(ptr[1], iseq->self, Qnil); } @@ -5162,5 +5162,5 @@ iseq_build_body(rb_iseq_t *iseq, LINK_AN if (op != Qnil) { if (TYPE(op) == T_ARRAY) { - argv[j] = ruby_iseq_load(op, iseq->self, Qnil); + argv[j] = rb_iseq_load(op, iseq->self, Qnil); } else if (CLASS_OF(op) == rb_cISeq) { Index: iseq.c =================================================================== --- iseq.c (revision 21649) +++ iseq.c (working copy) @@ -448,5 +448,5 @@ iseq_s_load(int argc, VALUE *argv, VALUE VALUE -ruby_iseq_load(VALUE data, VALUE parent, VALUE opt) +rb_iseq_load(VALUE data, VALUE parent, VALUE opt) { return iseq_load(rb_cISeq, data, parent, opt); Index: iseq.h =================================================================== --- iseq.h (revision 21649) +++ iseq.h (working copy) @@ -21,5 +21,5 @@ VALUE ruby_iseq_build_from_ary(rb_iseq_t /* iseq.c */ -VALUE ruby_iseq_load(VALUE data, VALUE parent, VALUE opt); +VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt); struct st_table *ruby_insn_make_insn_table(void); git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27* iseq.h, iseq.c (rb_iseq_new_main): add a type ISEQ_TYPE_MAIN.ko1
[ruby-dev:37619] * compile.c (rb_dvar_defined, ruby_iseq_compile): ditto. * iseq.c (iseq_data_to_ary, iseq_load): ditto. * compile.c (iseq_compile_each): fix to check ip->compile_data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27* vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.ko1
* 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
2008-12-05* iseq.c (rb_iseq_parameters): proc arguments are always optional.nobu
* proc.c (get_proc_iseq, rb_proc_parameters): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05* compile.c (ruby_iseq_compile, ruby_iseq_translate_threaded_code),nobu
(ruby_insns_name_array, ruby_iseq_build_from_ary): prefixed with ruby_. * iseq.c (ruby_iseq_load, ruby_insn_make_insn_table): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03* iseq.c (simple_default_value): returns simplest assignment only.nobu
[ruby-core:20237] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-28* iseq.c (simple_default_value): extracts simplest defaultnobu
argument value. * iseq.c (rb_iseq_parameters): returns parameter list. * proc.c (get_proc_iseq, get_method_iseq): handles ifunc and bmethod. * proc.c (rb_proc_parameters, rb_method_parameters): added Proc#parameters and Method#parameters. [ruby-core:19759] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* include/ruby/node.h, node.h: move node.h from include path.ko1
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
2008-09-23* include/ruby/node.h, vm_core.h: move definition ofko1
RUBY_VM_METHOD_NODE to node.h. * class.c, common.mk: remove useless inclusion. * compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h. move some definitions from vm_core.h to iseq.h. * compile.c, iseq.c, vm.c: ditto. * eval.c, compile.c: move some functions for parser from eval.c to compile.c. * eval_intern.h, vm_core.h: move va_init_list() macro to vm_core.h. * iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added. * load.c, ruby.c: use rb_iseq_new_top() instead of rb_iseq_new() with ISEQ_TYPE_TOP constant directly. * proc.c: use rb_iseq_first_lineno() instead of accessing iseq structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-12* iseq.c (iseq_s_compile_file): use rb_file_open_str.akr
* io.c (rb_file_open_generic): call validate_enc_binmode. (rb_file_open_str): call FilePathValue. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* iseq.c (iseq_data_to_ary): make it static.ko1
* thread.c (thgroup_enclose): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21* iseq.c (iseq_inspect): don't raise on uninitialized object.akr
show real class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11* iseq.c (rb_iseq_clone): should preserve cref_stack link.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11* class.c (clone_method): should copy cbase in cref as well.matz
[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
2008-07-31* iseq.c (ruby_iseq_disasm_insn): suppress warnings on platforms whichnobu
int size differs from pointer size. * ext/openssl/ossl_asn1.c (ossl_asn1_get_asn1type): ditto * ext/syck/rubyext.c (rb_syck_err_handler), (syck_default_error_handler): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22* compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),nobu
iseq.c (ruby_iseq_disasm_insn, ruby_iseq_disasm), process.c (pst_message), re.c (match_inspect): use rb_str_catf. * dir.c (dir_inspect), iseq.c (iseq_inspect, insn_operand_intern): use rb_sprintf. * error.c (rb_name_error, rb_raise, rb_loaderror, rb_fatal): use rb_vsprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e