summaryrefslogtreecommitdiff
path: root/iseq.c
AgeCommit message (Collapse)Author
2011-09-25suppress warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-15* iseq.c (get_line_info, rb_iseq_line_no): fix indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-29Use PRIdSIZE.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-26* iseq.c (iseq_data_to_ary): fix type of variableko1
(long -> unsigned long) to suppress a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24* iseq.h, iseq.c, compile.c: Change the line number data structureko1
to solve an issue reported at [ruby-dev:44413] [Ruby 1.9 - Bug #5217]. Before this fix, each instruction has an information including line number (iseq::iseq_insn_info_table). Instead of this data structure, recording only line number changing places (iseq::iseq_line_info_table). The order of entries in iseq_line_info_table is ascending order of iseq_line_info_table_entry::position. You can get a line number by an iseq and a program counter with this data structure. This fix reduces memory consumption of iseq (bytecode). On my measurement, a rails application consumes 21.8MB for iseq with this fix on the 32bit CPU. Without this fix, it consumes 24.7MB for iseq [ruby-dev:44415]. * proc.c: ditto. * vm_insnhelper.c: ditto. * vm_method.c: ditto. * vm.c (rb_vm_get_sourceline): change to use rb_iseq_line_no(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-21* iseq.c (iseq_s_disasm): remove variable which is no longer usedktsj
since r33013. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-20* iseq.c (iseq_s_disasm): fix a bug that may cause SEGV.ktsj
* test/ruby/test_method.rb (test_body): add a test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* method.h, internal.h iseq.h: declare internal functions.akr
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c, thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't declare internal functions. Note that rb_method_entry_eq() is defined in vm_method.c but there was a declaration in proc.c with different const-ness. Now it is declared in method.h with same const-ness to the definition. * object.c (rb_mod_module_exec): don't declare functions declared in include/ruby/intern.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* internal.h: declare more internal functions.akr
* iseq.h (rb_method_get_iseq): declared. * compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c, ruby.c, time.c, util.c, vm.c: don't declare internal functions. * eval.c, parse.y, thread_pthread.c: non-existing function declarations removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-17 * iseq.c (prepare_iseq_build): initialize iseq_compile_data::err_infonagachika
with nil. this fix exception in rb_iseq_load(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-16* iseq.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-15* iseq.c (set_relation), vm_insnhelper.c (vm_cref_push): nd_filenobu
is always zero-cleared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-31* compile.c (new_child_iseq): adjust argument types.nobu
* iseq.c (prepare_iseq_build, rb_iseq_new), (rb_iseq_new_with_bopt_and_opt, rb_iseq_new_with_opt), (rb_iseq_new_with_bopt): ditto. * compile.c (iseq_set_exception_table): suppress warnings. * insns.def (putspecialobject, defined): ditto. * iseq.c (iseq_load): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-31* vm_core.h: some refactoring.ko1
- move decl. of rb_compile_option_struct to iseq.h. - define enum iseq_type. - define enum vm_special_object_type. * compile.c: some refactoring. - apply above changes. - (struct iseq_link_element): change value of type. - remove unused decl. - fix comment. - rename iseq_build_body and iseq_build_exception to iseq_build_from_ary_body and iseq_build_from_ary_exception. * iseq.h: define enum catch_type and enum defined_type. * insns.def: apply above changes. * iseq.c: define ISEQ_MAJOR_VERSION and ISEQ_MINOR_VERSION. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-29* iseq.c (iseq_s_compile): fix optional argument.ko1
a patch from Yutaka HARA [ruby-core:32953] [Ruby 1.9-Bug#4001] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-15* iseq.c (insn_operand_intern): fix format specifier.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-14* insns.def, iseq.c, vm_insnhelper.c: rename variable nameko1
(ip -> iseq). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* iseq.c (insn_operand_intern, rb_iseq_disasm): fix format specifiers.nobu
* vm.c (thread_free): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu
(syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer), (run_final), hash.c (rb_hash_aref, rb_hash_lookup2), (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i), iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink), thread.c (rb_thread_local_aref), variable.c (generic_ivar_remove, ivar_get, rb_const_get_0), (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method), vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method), ext/iconv/iconv.c (map_charset): use st_data_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* compile.c (iseq_build_body), insns.def (getglobal, setglobal),nobu
iseq.c (iseq_load, iseq_data_to_ary), util.c (valid_filename): use VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27* class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:naruse
clean unused-value warnings. * cont.c, process.c, vm_exec.h: clean cast warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu
add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-17* load.c (rb_load_internal): remove call to rb_realpath_internalmame
within rb_load_internal which caused big performance degradation. Instead, call rb_realpath_internal in the caller of rb_load_internal. [ruby-dev:41502] [ruby-dev:41610] * vm.c (rb_vm_call_cfunc): ditto. * eval_intern.h (rb_vm_call_cfunc): ditto. * ruby.c (process_options): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-16* cont.c (fiber_set_stack_location), iseq.c (prepare_iseq_build),nobu
node.c (dump_node): suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-02* iseq.c (iseq_load): allow filepath to be nil.wanabe
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-27* iseq.c (set_relation): do not use top_wrapper as bottom of cref,mame
which caused constant lookup error when "wrapped load" is used; instead, use Object as bottom, and push top_wrapper on Object. [ruby-core:25039] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-16* compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolutemame
path field into rb_iseq_t. The field contains a string representing a path to corresponding source file. or nil when the iseq is created from -e, stdin, eval, etc. This field is used for require_relative. [ruby-dev:40004] * load.c (rb_f_require_relative): add C implementation of require_relative. * prelude.rb (require_relative): get rid of Ruby implementation of require_relative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-14* compile.c (insn_data_to_s_detail), iseq.c (insn_operand_intern):nobu
fixed format specifiers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-10* iseq.c (rb_iseq_clone): sets local_iseq and klass properly.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-24* insns.def: Change the operand type of setinlinecacheko1
(OFFSET to IC). This IC must be same as corresponding getinlinecache instruction's IC operand. This change is for a little performance improvement (getting IC directly) and is for the AOT compilation development. * compile.c, iseq.c, insns.def: Change the approach to handling inline cahce (IC) type operand to enable the above change. This change also affects ISeq#to_a method. The inline cache operand will be dumped by fixnum, the index of inline cache, in other words, inline cache identity. * template/insns_info.inc.tmpl, tool/instruction.rb: No need to count inline cache size (insn_iclen()). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-20* iseq.c (iseq_s_disasm): check for proc first. based on thenobu
patch by Roger Pack in [ruby-core:27626]. [ruby-core:27227] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-05removes the dtrace support. reverts r26239, r26238 and r26235.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-03* trace.h: new file. wraps tracing mechanisms.yugui
* defs/dtrace.d: new file. defined a dtrace provider "ruby". * include/ruby/ruby.h (LIKELY): moved from vm.c. (UNLIKELY): ditto. (OBJSETUP): probe "object-create". (RUBY_EVENT_RESCUE): new event. * vm_exec.c (DEBUG_ENTER_INSN): embeded a probe insn-entry into it. (DEBUG_END_INSN): insn-return. * vm.c (LIKELY): moved into ruby.h. (UNLIKELY): ditto. (Init_BareVM): embeded a probe "raise" into it. * variable.c (rb_class2name_without_alloc): new utility function. * tool/rbinstall.rb (install?(:ext, :arch, :'ext-arch')): installs dtrace.d if necessary. * thread_pthread.c (add_signal_thread_list): probe "raise". (rb_thread_create_timer_thread): ditto. * thread.c (rb_thread_schedule_rec): probes "thread-enter" and "thread-leave", (thread_start_func_2): ditto. (thread_cleanup_func): probe "thread-term" * lib/mkmf.rb: supports dtrace postprocessor on making an extension. * iseq.c (rb_vm_insn_name): new utility function. (rb_vm_insn_len): ditto. * insns.def (hook): probes "method-etnry", "method-return", "line", and "rescue". * compile.c (iseq_compile_each): adds a trace op for "rescue" probe. * gc.c (garbage_collect): probes "gc-begin" and "gc-end". (obj_free): probe "object-free" (garbage_collect_with_gvl): probe "raise" (negative_size_allocation_error): ditto. (rb_memerror): ditto. * eval.c (rb_rescue2): probe "rescue" (rb_longjmp): probe "raise" * ext/probe/probe.c: new extension for application defined probes. * ext/probe/extconf.rb: ditto. * configure.in (--with-tracing-model): new option to choose a tracing mechanism. (DTRACE): new substitution. name of dtrace(1). (RUBY_TRACING_MODEL): new substitution. (DTRACE_OBJ): ditto. (MINIDTRACE_OBJ): ditto. (GOLFDTRACE_OBJ): ditto. (LIBRUBY_DTRACE_OBJ): ditto. (RUBY_DTRACE_POSTPROCESS): new macro. checks whether the dtrace on the system needs postprocessing. (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether the dtrace supports USDT. * Makefile.in: (DTRACE): new variable. name of dtrace(1). (TRACING_MODEL): new variable. name of the chosen tracing mechanism. (DTRACE_OBJ): same as the one in configure.in. (MINIDTRACE_OBJ): ditto. (GOLFDTRACE_OBJ): ditto. (LIBRUBY_DTRACE_OBJ): ditto. (CPPOUTFILE): new substitution. necessary for generating dtrace.d (trace_none.h): new target for TRACING_MODEL=none (RUBY_H_INCLUDES): appended a header for tracing. (distclean-local): also removes preprocessed version of dtrace.d ($(LIBRUBY_A)): needs $(LIBRUBY_DTRACE_OBJ) if dtrace needs postprocessing. ($(PROGRAM)): ditto. (golf): ditto. (miniruby): ditto. ($(arch_hdrdir)/ruby/dtrace.d): new target. preprocessed verson of defs/dtrace.d. generated if necessary. ($(arch_hdrdir)/ruby/trace_dtrace.h): new target. definition of probes. ($(LIBRUBY_DTRACE_OBJ)): new target. generated if dtrace needs postprocessing. ($(DTRACE_OBJ)): ditto. ($(MINIDTRACE_OBJ)): ditto. ($(GOLFDTRACE_OBJ)): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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