aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * vm_core.h: constify rb_iseq_constant_body::local_table andko12015-07-231-1/+1
| | | | | | | | | | | rb_iseq_param_keyword::table and rb_iseq_param_keyword::default_values. * compile.c: catch up this fix. * iseq.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: constify rb_iseq_constant_body::iseq_encoded andko12015-07-231-9/+11
| | | | | | | | | | | rb_control_frame_t::pc. * compile.c (rb_iseq_translate_threaded_code): catch up this fix. * iseq.c: ditto. * vm_exec.c (vm_exec_core): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: separate rb_iseq_body into rb_iseq_constant_body andko12015-07-221-7/+11
| | | | | | | | | | | | rb_iseq_variable_body (rb_iseq_t::variable_body). rb_iseq_variable_body can be modified after compilation. * compile.c: use rb_iseq_t::variable_body. * iseq.c: ditto. * thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * make rb_iseq_t T_IMEMO object (type is imemo_iseq).ko12015-07-211-425/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data. * compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE). * eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq). * ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq. * gc.c: check T_IMEMO/iseq. * internal.h: add imemo_type::imemo_iseq. * iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_.... * load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq). * method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq). * vm_core.h (GetISeqPtr): removed because it is not T_DATA now. * vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: constify rb_call_info_t::kw_arg,ko12015-07-211-2/+2
| | | | | | | | | | | rb_control_frame_t::iseq and rb_control_frame_t::block_iseq. * iseq.c (iseq_free): catch up this fix. * vm.c: ditto. * vm_dump.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: constify rb_call_info_t::blockiseq and rb_iseq_t::iseq.ko12015-07-211-5/+4
| | | | | | | | | | * vm.c, vm_insnhelper.c: catch up this fix. * iseq.c (iseq_data_to_ary): constify the first iseq parameter. * vm_insnhelper.c (vm_make_proc_with_iseq): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c: constify the first parameter (iseq).ko12015-07-211-1/+1
| | | | | | | | | | * iseq_add_mark_object() * iseq_add_mark_object_compile_time() * iseq.c, iseq.h (rb_iseq_add_mark_object): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* avoid redundant GET_THREAD() callsnormal2015-07-161-1/+1
| | | | | | | | | | | | | | | | | | This reduces binary size slightly on my 32-bit system: text data bss dec hex filename 2847705 12360 30632 2890697 2c1bc9 ruby.orig 2847641 12360 30632 2890633 2c1b89 ruby * iseq.c (rb_iseq_compile_with_option): reuse result of previous GET_THREAD() call * thread.c (thread_create_core): ditto (rb_mutex_trylock): ditto (rb_mutex_lock): ditto * process.c (rb_waitpid): avoid multiple eval from RUBY_VM_CHECK_INTS * thread.c (rb_thread_check_ints): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: constify rb_iseq_t::parent_iseq.ko12015-07-161-3/+3
| | | | | | | | | | | | rb_iseq_t::local_iseq is not constant data because local_iseq::flip_cnt can be modified (commentted). * compile.c: catch up this fix. * iseq.c: ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (rb_iseq_disasm): rename rb_iseq_t *iseqdat to iseqko12015-07-161-38/+38
| | | | | | | | | and VALUE *iseq to code. * iseq.c (rb_iseq_disasm_insn): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove redundant NULL check in mark functionsnormal2015-07-151-16/+15
| | | | | | | | | | | | | gc.c (gc_mark_children)only calls mark_func if the T_DATA ptr is non-NULL, so avoid redundantly checking for that in each mark function. * iseq.c (iseq_mark): remove check for data pointer * proc.c (binding_mark): ditto * vm.c (rb_thread_mark): ditto * vm_trace.c (tp_mark): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (iseq_data_to_ary): dump kw_arg as symbolnormal2015-07-071-1/+1
| | | | | | | | | | | | | Fix RubyVM::InstructionSequence#to_a after r49517 Keywords were made symbols to fix [Bug #10831] [ruby-core:68031], so we should dump symbols as-is instead of attempting to convert them from IDs * iseq.c (iseq_data_to_ary): dump kw_arg as symbol * test/-ext-/iseq_load/test_iseq_load.rb: test kw_arg roundtrip [ruby-core:69891] [Bug #11338] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: remove rb_iseq_t::orig because rb_iseq_clone()ko12015-07-071-65/+52
| | | | | | | | | no longer exists. * iseq.c: don't use rb_iseq_t::orig. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c, internal.h (rb_iseq_clone): removed because we don't need toko12015-07-071-24/+0
| | | | | | | | | | clone iseq any more. * class.c (clone_method): share iseq between cloned methods. All of method dependent information are able to refer from method entry. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: remove rb_iseq_t::defined_method_id because it is notko12015-07-061-1/+0
| | | | | | | | | | | | | | needed. * eval.c (frame_func_id): simplify. rb_callable_method_entry_t has enough information. * eval.c (frame_called_id): ditto. * iseq.c (prepare_iseq_build): catch up this fix. * proc.c (rb_mod_define_method): ditto. * vm.c (vm_define_method): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: remove rb_iseq_t::klass to reduce dynamic data.ko12015-07-061-18/+0
| | | | | | | | | | | | | | | | | | | | | | * internal.h, iseq.c (rb_iseq_klass): remove it because rb_iseq_t::klass is removed. * vm_insnhelper.c (vm_super_outside): do not see cfp->iseq, but check callable method entry on a frame. This fix simplify the logic to search super class. * test/ruby/test_method.rb: support super() from Proc. Now, [Bug #4881] and [Bug #3136] was solved. * proc.c (rb_mod_define_method): catch up this change. * vm.c (vm_define_method): ditto. * vm_backtrace.c (rb_profile_frames): now, each `frame' objects are rb_callable_method_entry_t data or iseq VALUEs. This fix introduce minor compatibility issue that rb_profile_frame_label() always returns rb_profile_frame_base_label(). * test/-ext-/debug/test_profile_frames.rb: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* move RB_GC_GUARD responsibility to rb_add_method_iseqnormal2015-06-301-0/+2
| | | | | | | | | | | | | | | | | | | This simplifies all the callers and makes code easier to use and review. I was confused about the need for RB_GC_GUARD in define_{aset,aref}_method of struct.c without reading rb_add_method_iseq. Likewise, do the same for rb_iseq_clone, where the GC guard only seems neccesary iff RGenGC is disabled. * vm_method.c (rb_add_method_iseq): add RB_GC_GUARD * class.c (clone_method): remove RB_GC_GUARD * struct.c (define_aref_method): ditto (define_aset_method): ditto * vm.c (vm_define_method): * iseq.c (rb_iseq_clone): add RB_GC_GUARD git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c: constify.ko12015-05-211-1/+1
| | | | | | | | | | | * iseq.h: ditto. * method.h: ditto. * proc.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (rb_method_get_iseq): rename to rb_method_iseq.ko12015-05-211-1/+1
| | | | | | | | * iseq.c: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (exception_type2symbol): show correct bug message.ko12015-05-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: check srouce typenobu2015-05-191-0/+1
| | | | | | | * iseq.c (rb_iseq_compile_with_option): check srouce type, must be an IO or a String. [ruby-core:69219] [Bug #11159] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (iseq_mark): skip some marking if iseq->orig is available.ko12015-03-181-8/+15
| | | | | | | | | * iseq.c (rb_iseq_clone): need WB for iseq1->klass = iseq0->klass (done in MEMCPY). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * fix namespace issue on singleton class expressions. [Bug #10943]ko12015-03-061-24/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * vm_core.h, method.h: remove rb_iseq_t::cref_stack. CREF is stored to rb_method_definition_t::body.iseq_body.cref. * vm_insnhelper.c: modify SVAR usage. When calling ISEQ type method, push CREF information onto method frame, SVAR located place. Before this fix, SVAR is simply nil. After this patch, CREF (or NULL == Qfalse for not iseq methods) is stored at the method invocation. When SVAR is requierd, then put NODE_IF onto SVAR location, and NDOE_IF::nd_reserved points CREF itself. * vm.c (vm_cref_new, vm_cref_dump, vm_cref_new_toplevel): added. * vm_insnhelper.c (vm_push_frame): accept CREF. * method.h, vm_method.c (rb_add_method_iseq): added. This function accepts iseq and CREF. * class.c (clone_method): use rb_add_method_iseq(). * gc.c (mark_method_entry): mark method_entry::body.iseq_body.cref. * iseq.c: remove CREF related codes. * insns.def (getinlinecache/setinlinecache): CREF should be cache key because a different CREF has a different namespace. * node.c (rb_gc_mark_node): mark NODE_IF::nd_reserved for SVAR. * proc.c: catch up changes. * struct.c: ditto. * insns.def: ditto. * vm_args.c (raise_argument_error): ditto. * vm_eval.c: ditto. * test/ruby/test_class.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: struct accessorsnobu2014-12-171-122/+0
| | | | | | | * compile.c (rb_method_for_self_aref, rb_method_for_self_aset): move from iseq.c to build from node instead of arrays. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: default optionnobu2014-12-171-0/+1
| | | | | | | * iseq.c (rb_iseq_new_with_opt): allow NULL option as COMPILE_OPTION_DEFAULT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: absolute_pathnobu2014-12-171-5/+12
| | | | | | * iseq.c (caller_location): separate absolute_path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: remove useless codenobu2014-12-161-1/+0
| | | | | | * iseq.c (rb_method_for_self_aref): remove unused declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: struct accessorsnobu2014-12-161-28/+21
| | | | | | | | | | | * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset): call accessor functions directly, not to be affected by [] and []= methods. [ruby-core:66846] [Bug #10601] * struct.c (define_aref_method, define_aset_method): ditto. * vm_insnhelper.c (rb_vm_opt_struct_aref, rb_vm_opt_struct_aset): direct accessors of Struct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: wrap funcptrnobu2014-12-161-1/+8
| | | | | | | | | * compile.c (iseq_build_from_ary_body): enclose funcptr with Integer as raw pointer cannot appear in an Array. * iseq.c (iseq_data_to_ary): extract funcptr from Integer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: show function name if possiblenobu2014-12-161-1/+14
| | | | | | | | | * iseq.c (rb_insn_operand_intern): show the name of the nearest run-time symbol if possible. * compile.c (insn_data_to_s_detail): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: check funcptrnobu2014-12-161-0/+3
| | | | | | | | * compile.c (iseq_build_from_ary_body): cannot load dumped funcptr. * iseq.c (iseq_data_to_ary): cannot dump funcptr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: use caller locationnobu2014-12-151-4/+18
| | | | | | | * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset): set same location as the caller. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: intermediate arraysnobu2014-12-151-19/+27
| | | | | | | * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset): hide and clear intermediate array objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (class_alloc): Strat from age == 2.ko12014-12-111-1/+1
| | | | | | | | | | | | | | | Class and Module objects can be living long life. * iseq.c: Same for ISeq objects. * gc.c (RVALUE_AGE_RESET): added. * gc.c (newobj_of): allow to generate (age != 0) objects. * gc.c (rb_copy_wb_protected_attribute): reset age for wb unprotected objects. * include/ruby/ruby.h: add RUBY_TYPED_PROMOTED1 as an unrecommended flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* struct.c: use iseqvalnobu2014-12-101-4/+4
| | | | | | | | * struct.c (define_aref_method, define_aset_method): use iseq VALUE instead of rb_iseq_t to prevent from GC, as RB_GC_GUARD makes sense only for local variables. [Feature #10575] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* struct: avoid all O(n) behavior on accessnormal2014-12-091-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids O(n) on lookups with structs over 10 members. This also avoids O(n) behavior on all assignments on Struct members. Members 0..9 still use existing C methods to read in O(1) time Benchmark results: vm2_struct_big_aref_hi* 1.305 vm2_struct_big_aref_lo* 1.157 vm2_struct_big_aset* 3.306 vm2_struct_small_aref* 1.015 vm2_struct_small_aset* 3.273 Note: I chose use loading instructions from an array instead of writing directly to linked-lists in compile.c for ease-of-maintainability. We may move the method definitions to prelude.rb-like files in the future. I have also tested this patch with the following patch to disable the C ref_func methods and ensured the test suite and rubyspec works --- a/struct.c +++ b/struct.c @@ -209,7 +209,7 @@ setup_struct(VALUE nstr, VALUE members) ID id = SYM2ID(ptr_members[i]); VALUE off = LONG2NUM(i); - if (i < N_REF_FUNC) { + if (0 && i < N_REF_FUNC) { rb_define_method_id(nstr, id, ref_func[i], 0); } else { * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset): new methods to generate bytecode for struct.c [Feature #10575] * struct.c (rb_struct_ref, rb_struct_set): remove (define_aref_method, define_aset_method): new functions (setup_struct): use new functions * test/ruby/test_struct.rb: add test for struct >10 members * benchmark/bm_vm2_struct_big_aref_hi.rb: new benchmark * benchmark/bm_vm2_struct_big_aref_lo.rb: ditto * benchmark/bm_vm2_struct_big_aset.rb: ditto * benchmark/bm_vm2_struct_small_aref.rb: ditto * benchmark/bm_vm2_struct_small_aset.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: remove unused rb_iseq_new_with_boptnormal2014-12-051-26/+10
| | | | | | | | | | | * iseq.c (prepare_iseq_build): remove unused block_opt param (rb_iseq_new_with_bopt_and_opt): remove (rb_iseq_new_with_opt): inline removed function (rb_iseq_new_with_bopt): remove (iseq_load): adjust prepare_iseq_build call [Feature #10565] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mostly fix rb_iseq_loadnormal2014-12-031-18/+38
| | | | | | | | | | | | | | | | | | | | | | | | | This allows reporters commenters of [Feature #8543] to load instruction sequences directly. Some test cases are still failing but documented in test/-ext-/iseq_load/test_iseq_load.rb. * compile.c (rb_iseq_build_from_exception): entry->sp is unsigned (iseq_build_callinfo_from_hash): account for kw_arg (iseq_build_from_ary_body): update for r35459 (CHECK_STRING, CHECK_INTEGER): remove unused checks (int_param): new function for checking new `params' hash (iseq_build_kw): new function for loading rb_iseq_param_keyword (rb_iseq_build_from_ary): account for `misc' entry and general structure changes [Feature #8543] * iseq.c (CHECK_HASH): new macro (for `misc' and `param' entries) (iseq_load): account for `misc' and `params' hashes (iseq_data_to_ary): add final opt to arg_opt_labels, fix kw support, account for unsigned entry->sp * ext/-test-/iseq_load/iseq_load.c: new ext for test * ext/-test-/iseq_load/extconf.rb: ditto * test/-ext-/iseq_load/test_iseq_load.rb: new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: avoid segfault on incomplete iseqnormal2014-12-031-5/+7
| | | | | | | | | | | Compile failures will trigger iseq_free before iseq->callinfo_entries are allocated at all. * iseq.c (iseq_free): avoid segfault on incomplete iseq * test/ruby/test_syntax.rb (test_invalid_next): new test for syntax error, not segfault git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: use lvar indexnobu2014-12-021-1/+1
| | | | | | | * iseq.c (iseq_data_to_ary): use local variable indexes for hidden variable instead of meaningless ID values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (iseq_data_to_ary): keep hidden variablesnormal2014-12-011-1/+6
| | | | | | | We must not ignore hidden variables when rb_id2str fails. Thanks to wanabe [ruby-core:66566] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use 0 for reservednobu2014-12-011-1/+1
| | | | | | | use 0 for rb_data_type_t::reserved instead of NULL, since its type may be changed in the future and possibly not a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (iseq_data_to_ary): add missing GC guardnormal2014-11-271-0/+1
| | | | | | | | It seems possible for a compiler to optimize away nbody because we only access it via RARRAY_AREF and RARRAY_LEN macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (iseq_s_compile_file): close IO when donenormal2014-11-261-0/+3
| | | | | | This will prevent some leaked FD warnings in future tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: preserve encoding at disassemblingnobu2014-11-231-1/+1
| | | | | | | * iseq.c (rb_insn_operand_intern): preserve encoding of method name in CALL_INFO at disassembling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: Include ruby.h and ruby/encoding.h to beakr2014-11-151-2/+1
| | | | | | | | includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (iseq_free): resolve memory leak.ko12014-11-031-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (iseq_memsize): catch up recent changes.ko12014-11-031-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: change semantics of opt_num and opt_table.ko12014-11-031-7/+6
| | | | | | | | | | | | | | | | | `opt_num' was the number of optional parameters + 1. `opt_table' has "opt_num" entries. Change them to: `opt_num' is the number of optional parameters. `opt_talbe' has "opt_num + 1" entries. This change simplify parameter fitting logics. * compile.c: catch up this change. * iseq.c: ditto. * proc.c: ditto. * vm_args.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: change iseq parameter data structure.ko12014-11-021-93/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugs.ruby-lang.org/issues/10440#change-49694 * change terminology `arg' to `param'. * move rb_iseq_t::arg_* to rb_iseq_t::param. * move rb_iseq_t::arg_size to rb_iseq_t::param::size. * move rb_iseq_t::argc to rb_iseq_t::param::lead_num. * move rb_iseq_t::arg_opts to rb_iseq_t::param::opt_num. * move rb_iseq_t::arg_rest to rb_iseq_t::param::rest_start. * move rb_iseq_t::arg_post_num to rb_iseq_t::param::post_num. * move rb_iseq_t::arg_post_start to rb_iseq_t::param::post_start. * move rb_iseq_t::arg_block to rb_iseq_t::param::block_start. * move rb_iseq_t::arg_keyword* to rb_iseq_t::param::keyword. rb_iseq_t::param::keyword is allocated only when keyword parameters are available. * introduce rb_iseq_t::param::flags to represent parameter availability. For example, rb_iseq_t::param::flags::has_kw represents that this iseq has keyword parameters and rb_iseq_t::param::keyword is allocated. We don't need to compare with -1 to check availability. * remove rb_iseq_t::arg_simple. * compile.c: catch up this change. * iseq.c: ditto. * proc.c: ditto. * vm.c, vm_args.c, vm_dump.c, vm_insnhelper.c: ditto. * iseq.c (iseq_data_to_ary): support keyword argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e