aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
Commit message (Collapse)AuthorAgeFilesLines
* iseq.c: linear searchnobu2014-01-121-24/+20
| | | | | | | * iseq.c (iseq_type_from_id): linear search instead of hash lookup for small fixed number keys. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: potential memory leaknobu2014-01-121-0/+8
| | | | | | | * iseq.c (iseq_load): keep type_map to get rid of memory leak. based on a patch by Eric Wong at [ruby-core:59699]. [Bug #9399] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby/util.h: DECIMAL_SIZE_OF_BITSnobu2014-01-121-1/+2
| | | | | | | | | | | | | * include/ruby/util.h (DECIMAL_SIZE_OF_BITS): a preprocessor constant macro to approximate decimal representation size of n-bits integer. * iseq.c (register_label): use DECIMAL_SIZE_OF_BITS for better approximation. * ext/bigdecimal/bigdecimal.c (BigMath_s_log): ditto. * common.mk (iseq.o), ext/bigdecimal/depend (bigdecimal.o): add dependency to ruby/util.h for DECIMAL_SIZE_OF_BITS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: unnamed keyword rest checknobu2013-12-251-2/+4
| | | | | | | | | | | | | * compile.c (iseq_set_arguments): set arg_keyword_check from nd_cflag, which is set by parser. internal ID is used for unnamed keyword rest argument, which should be separated from no keyword check. * iseq.c (rb_iseq_parameters): if no keyword check, keyword rest is present. * parse.y (new_args_tail_gen): set keywords check to nd_cflag, which equals to that keyword rest is not present. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: fix parameter of unnamed rest keywords argumentnobu2013-12-251-4/+2
| | | | | | | * iseq.c (rb_iseq_parameters): push argument type symbol only for unnamed rest keywords argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: rename OBJ_WRITE and OBJ_WRITTEN intoko12013-12-201-25/+25
| | | | | | | | | | | | RB_OBJ_WRITE and RB_OBJ_WRITTEN. * array.c, class.c, compile.c, hash.c, internal.h, iseq.c, proc.c, process.c, re.c, string.c, variable.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: promote long-lived NODE_CREF objects to oldgentmm12013-12-081-3/+3
| | | | | | | | | | | | | | | * include/ruby/ruby.h: add RGENGC_WB_PROTECTED_NODE_CREF setting In a large app, this reduces the size of remembered_shady_object_count by 80%. [Bug #9225] [ruby-core:58947] * gc.c (rb_node_newnode): add FL_WB_PROTECTED flag to NODE_CREF * class.c (rewrite_cref_stack): insert OBJ_WRITE for NODE_CREF * iseq.c (set_relation): ditto * iseq.c (rb_iseq_clone): ditto * vm_eval.c (rb_yield_refine_block): ditto * vm_insnhelper.c (vm_cref_push): ditto * vm_insnhelper.h (COPY_CREF): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c: Use rb_fstring() to de-duplicate string literals in code. ↵tmm12013-11-261-2/+4
| | | | | | | | | | | [ruby-core:58599] [Bug #9159] [ruby-core:54405] * iseq.c (prepare_iseq_build): De-duplicate iseq labels and source locations. * re.c (rb_reg_initialize): Use rb_fstring() for regex string. * string.c (rb_fstring): Handle non-string and already-fstr arguments. * vm_eval.c (eval_string_with_cref): De-duplicate eval source filename. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: fix values for truenobu2013-11-151-1/+3
| | | | | | * iseq.c (make_compile_option): fill with 1 of int, not char if opt is true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * add RUBY_TYPED_FREE_IMMEDIATELY to data types which only useko12013-10-291-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | safe functions during garbage collection such as xfree(). On default, T_DATA objects are freed at same points as fianlizers. This approach protects issues such as reported by [ruby-dev:35578]. However, freeing T_DATA objects immediately helps heap usage. Most of T_DATA (in other words, most of dfree functions) are safe. However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default for safety. * cont.c: ditto. * dir.c: ditto. * encoding.c: ditto. * enumerator.c: ditto. * error.c: ditto. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * iseq.c: ditto. * marshal.c: ditto. * parse.y: ditto. * proc.c: ditto. * process.c: ditto. * random.c: ditto. * thread.c: ditto. * time.c: ditto. * transcode.c: ditto. * variable.c: ditto. * vm.c: ditto. * vm_backtrace.c: ditto. * vm_trace.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * ext/objspace/objspace.c: ditto. * ext/stringio/stringio.c: ditto. * ext/strscan/strscan.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_backtrace.c, include/ruby/debug.h: add new APIsko12013-10-081-0/+14
| | | | | | | | | | | | | * VALUE rb_profile_frame_method_name(VALUE frame) * VALUE rb_profile_frame_qualified_method_name(VALUE frame) * iseq.c (rb_iseq_klass), internal.h: add new internal function rb_iseq_method_name(). * ext/-test-/debug/profile_frames.c (profile_frames), test/-ext-/debug/test_profile_frames.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/debug.h: add backtrace collecting APIs for profiler.ko12013-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * int rb_profile_frames(int start, int limit, VALUE *buff, int *lines); Collect information of frame information. * VALUE rb_profile_frame_path(VALUE frame); * VALUE rb_profile_frame_absolute_path(VALUE frame); * VALUE rb_profile_frame_label(VALUE frame); * VALUE rb_profile_frame_base_label(VALUE frame); * VALUE rb_profile_frame_first_lineno(VALUE frame); * VALUE rb_profile_frame_classpath(VALUE frame); * VALUE rb_profile_frame_singleton_method_p(VALUE frame); Get information about each frame. These APIs are designed for profilers, for example, no objectallocation, and enough information for profilers. In this version, this API collects only collect Ruby level frames. This issue will be fixed after Ruby 2.1. * vm_backtrace.c: implement above APIs. * iseq.c (rb_iseq_klass): return local_iseq's class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c, internal.h: change to public (but internal) functionsko12013-10-071-21/+23
| | | | | | | | | | | | | | | | | | * VALUE rb_iseq_path(VALUE iseqval); * VALUE rb_iseq_absolute_path(VALUE iseqval); * VALUE rb_iseq_label(VALUE iseqval); * VALUE rb_iseq_base_label(VALUE iseqval); * VALUE rb_iseq_first_lineno(VALUE iseqval); And new (temporary) function: * VALUE rb_iseq_klass(VALUE iseqval); * iseq.c. vm_core.h (int rb_iseq_first_lineno): remove function `int rb_iseq_first_lineno(const rb_iseq_t *iseq)'. Use `VALUE rb_iseq_first_lineno(VALUE iseqval)' instead. * proc.c. vm_insnhelper.c, vm_method.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def: fix regexp's once option behavior.ko12013-08-201-8/+9
| | | | | | | | | | | | | | | | | fix [ruby-trunk - Bug #6701] * insns.def: remove `onceinlinecache' and introduce `once' instruction. `once' doesn't use `setinlinecache' insn any more. * vm_core.h: `union iseq_inline_storage_entry' to store once data. * compile.c: catch up above changes. * iseq.c: ditto. * vm.c, vm_insnhelper.c: ditto. fix `m_core_set_postexe()' which is depend on `onceinlinecache' insn. * test/ruby/test_regexp.rb: add tests. * iseq.c: ISEQ_MINOR_VERSION to 1 (should increment major?) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y, vm_eval.c: file encoding in evalnobu2013-07-291-16/+12
| | | | | | | | | | | | | | * parse.y (yycompile): store file name as String to keep the encoding. * parse.y (rb_parser_compile_string_path, rb_parser_compile_file_path): new functions to pass file name as a String. * parse.y (gettable_gen): return a copy of the original file name, not a copy in filesystem encoding. * vm_eval.c (eval_string_with_cref): use Qundef instead of "(eval)". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (OBJ_WRITE): cast to (VALUE *) for secondko12013-06-211-22/+22
| | | | | | | | | | parameter `slot'. You don't need to write a cast (VALUE *) any more. * class.c, compile.c, hash.c, iseq.c, proc.c, re.c, variable.c, vm.c, vm_method.c: remove cast expressions for OBJ_WRITE(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (struct rb_data_type_struct), gc.c: addko12013-06-191-33/+38
| | | | | | | | | | | | | rb_data_type_struct::flags. Now, this flags is passed at T_DATA object creation. You can specify FL_WB_PROTECTED on this flag. * iseq.c: making non-shady iseq objects. * class.c, compile.c, proc.c, vm.c: add WB for iseq objects. * vm_core.h, iseq.h: constify fields to detect WB insertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo2013-06-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (numberof): Gathered from various files.akr2013-06-071-2/+0
| | | | | | | | | | * array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c, load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c, error.c, ruby.c: Remove the definitions of numberof. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (prepare_iseq_build): remove additional line braek.ko12013-05-131-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: constify RBasic::klass and addko12013-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RBASIC_CLASS(obj) macro which returns a class of `obj'. This change is a part of RGENGC branch [ruby-trunk - Feature #8339]. * object.c: add new function rb_obj_reveal(). This function reveal interal (hidden) object by rb_obj_hide(). Note that do not change class before and after hiding. Only permitted example is: klass = RBASIC_CLASS(obj); rb_obj_hide(obj); .... rb_obj_reveal(obj, klass); TODO: API design. rb_obj_reveal() should be replaced with others. TODO: modify constified variables using cast may be harmful for compiler's analysis and optimizaton. Any idea to prohibt inserting RBasic::klass directly? If rename RBasic::klass and force to use RBASIC_CLASS(obj), then all codes such as `RBASIC(obj)->klass' will be compilation error. Is it acceptable? (We have similar experience at Ruby 1.9, for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)". * internal.h: add some macros. * RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal object. * RBASIC_SET_CLASS(obj, cls) set RBasic::klass. * RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS without write barrier (planned). * RCLASS_SET_SUPER(a, b) set super class of a. * array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c, file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c, parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c, string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c: Use above macros and functions to access RBasic::klass. * ext/coverage/coverage.c, ext/readline/readline.c, ext/socket/ancdata.c, ext/socket/init.c, * ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko12013-05-131-1/+1
| | | | | | | | instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq: reduce array allocations for simple sequencestmm12013-04-171-5/+13
| | | | | | | | | | | | | | | | | * compile.c (iseq_add_mark_object): Use new rb_iseq_add_mark_object(). * insns.def (setinlinecache): Ditto. * iseq.c (rb_iseq_add_mark_object): New function to allocate iseq->mark_ary on demand. [Bug #8142] * iseq.h (rb_iseq_add_mark_object): Ditto. * iseq.c (prepare_iseq_build): Avoid allocating mark_ary until needed. * iseq.c (rb_iseq_build_for_ruby2cext): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: remove duplicated strings for file pathstmm12013-04-171-1/+4
| | | | | | | * iseq.c (iseq_location_setup): re-use existing string when iseq has the same path and absolute_path. [Bug #8149] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (iseq_load): get rid of SEGV.nobu2013-03-261-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* required keyword argumentsnobu2013-03-121-1/+13
| | | | | | | | | | | | * compile.c (iseq_set_arguments, iseq_compile_each): support required keyword arguments. [ruby-core:51454] [Feature #7701] * iseq.c (rb_iseq_parameters): ditto. * parse.y (f_kw, f_block_kw): ditto. this syntax is still experimental, the notation may change. * vm_core.h (rb_iseq_struct): ditto. * vm_insnhelper.c (vm_callee_setup_keyword_arg): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: keyword argumentsnobu2013-03-071-1/+1
| | | | | | * iseq.c (rb_iseq_disasm): fix keyword arguments index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: keyword argumentsnobu2013-03-061-1/+2
| | | | | | | * iseq.c (rb_iseq_disasm): show keyword arguments info, in format "keyword: NUM@LIDX". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prefix global symbolsnobu2013-03-061-6/+6
| | | | | | | | | | | | | | * iseq.c (rb_insn_operand_intern): prefix global symbols. * numeric.c (ruby_num_interval_step_size): ditto. * vm_backtrace.c (rb_vm_backtrace_str_ary), (rb_vm_backtrace_location_ary, rb_vm_thread_backtrace), (rb_vm_thread_backtrace_locations): ditto. * vm_trace.c (rb_vm_trace_mark_event_hooks): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (iseq_data_to_ary): fix condition.ko12013-02-281-1/+1
| | | | | | | | | | r34303 introduces a bug to avoid all line information from a result of ISeq#to_a. This is a regression problem from 2.0.0p0. * test/ruby/test_iseq.rb: add a test of lines after ISeq#to_a. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* adjust stylenobu2012-12-291-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (RubyVM::InstructionSequence): rdoc formattingzzak2012-12-291-63/+92
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (RubyVM::InstructionSequence): Add rdoc for new iseq featureszzak2012-12-291-1/+121
| | | | | | | | added from r38085, this includes ::of, #path, #absolute_path, #label, #base_label, #first_lineno, and #inspect git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (rb_iseq_line_trace_all, rb_iseq_line_trace_specify): Addzzak2012-12-291-0/+17
| | | | | | | rdoc for experimental C level api of iseq, from r38076 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (Init_ISeq): remove definition of the following methods:ko12012-12-211-1/+7
| | | | | | | | | | | | ISeq#line_trace_all and ISeq#line_trace_specify because they are half baked. C APIs are remained as experimental. These functions will be renamed, removed their parameters may be changed. You can use these methods by C exts. Please give us your comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (rb_iseq_parameters): fix limit for optional arguments.eregon2012-12-111-6/+1
| | | | | | | | * test/ruby/test_keyword.rb: tests for above. * vm_core.h (struct rb_iseq_struct): update documentation with keyword arguments. [Bug #7540] [ruby-core:50735] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c, vm_insnhelper.c: flip-flop without hidden string keynobu2012-12-101-0/+4
| | | | | | | | | | | * compile.c (iseq_compile_each): count flip-flop state in local iseq not in each iseqs, so that the keys can be other than hidden strings. [ruby-core:47253] [Bug #6899] * vm_insnhelper.c (lep_svar_get, lep_svar_set, vm_getspecial): store flip-flop states in an array instead of a hash. * iseq.c (set_relation): main iseq also can has local scope. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (rb_iseq_line_trace_each): iterate `line' event only.ko12012-12-011-9/+13
| | | | | | | | * test/ruby/test_iseq.rb: add a test for this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c, time.c: make marshal methods privatenobu2012-12-011-2/+2
| | | | | | | | * complex.c (Init_Complex), time.c (Init_Time): make marshal methods private. [Feature #6539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c: add RubyVM::InstructionSequence (ISeq) inspection methods.ko12012-11-301-18/+73
| | | | | | | | | | | | | | | * ISeq#path returns path of this ISeq written. * ISeq#absolute_path returns absolute path. * ISeq#label returns label (method name and so on). * ISeq#base_label returns base label (see Thread::Backtrace::Location). * ISeq#first_lineno returns first line number of this ISeq. * ISeq.of(obj) returns ISeq object which obj (Proc or Method) is contains. * test/ruby/test_iseq.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [EXPERIMENTAL]ko12012-11-301-0/+105
| | | | | | | | | | | | | | | | | * iseq.c: add following two methods. * ISeq#line_trace_all returns all line traces (line numbers) * ISeq#line_trace_specify(pos, set) set `pos'th line event to specified_line event (if set is true). These features are introduced for debuggers (mainly to make breakpoint). * iseq.h: add decl. of C APIs. * test/ruby/test_iseq.rb: add tests. * vm_trace.c: add `specified_line' event. * include/ruby/ruby.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (make_compile_option_value): add trace_instruction option.ko12012-11-261-0/+1
| | | | | | | | | a patch by davidbalbert (David Albert). [Bug #6786] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: fix r37397nobu2012-11-011-1/+5
| | | | | | | | * iseq.c (set_relation): parent_iseq need to be set regardless iseq type. fix r37397. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: simplifynobu2012-11-011-14/+2
| | | | | | | * iseq.c (set_relation): simplify and merge same conditions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (rb_iseq_compile_with_option): Instead of testingshyouhei2012-10-271-1/+6
| | | | | | | | | | | respond_to, just check if the argument is actually a file, because by calling user-defined gets something weired can happen. Patch by Glass_saga. [ruby-dev:40202] [Bug #2861] * parse.y (ripper_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (VM_CALL_*): rename VM_CALL_*_BITko12012-10-151-8/+8
| | | | | | | | | | | to VM_CALL_* (remove `_BIT' suffix). Add comments on each macros. Remove unused macro VM_CALL_TAILRECURSION_BIT. * compile.c, iseq.c, insns.def, vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (send, invokesuper, invokeblock, opt_*), vm_core.h:ko12012-10-141-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | use only a `ci' (rb_call_info_t) parameter instead of using parameters such as `op_id', 'op_argc', `blockiseq' and flag. These information are stored in rb_call_info_t at the compile time. This technique simplifies parameter passings at related function calls (~10% speedups for simple mehtod invocation at my machine). `rb_call_info_t' also has new function pointer variable `call'. This `call' variable enables to customize method (block) invocation process for each place. However, it always call `vm_call_general()' at this changes. `rb_call_info_t' also has temporary variables for method (block) invocation. * vm_core.h, compile.c, insns.def: introduce VM_CALL_ARGS_SKIP_SETUP VM_CALL macro. This flag indicates that this call can skip caller_setup (block arg and splat arg). * compile.c: catch up above changes. * iseq.c: catch up above changes (especially for TS_CALLINFO). * tool/instruction.rb: catch up above chagnes. * vm_insnhelper.c, vm_insnhelper.h: ditto. Macros and functions parameters are changed. * vm_eval.c (vm_call0): ditto (it will be rewriten soon). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress warning: 'iseqval' may be used uninitialized in this functionnaruse2012-10-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (insn_operand_intern): cast op to rb_call_info_t* beforenaruse2012-10-101-1/+1
| | | | | | compare with iseq->callinfo_entries whose type is rb_call_info_t*. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (insn_operand_intern): add support disasm TS_CALLINFOko12012-10-101-0/+4
| | | | | | | | operands. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e