summaryrefslogtreecommitdiff
path: root/vm_insnhelper.h
AgeCommit message (Collapse)Author
2017-10-29* vm_insnhelper.h (GET_SP_COUNT): removed because nobody use it.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27vm_exec_core() accepts `ec` instead of `th`.ko1
* vm_exec.c (vm_exec_core): accepts `ec` instead of `th`. * vm_args.c (vm_caller_setup_arg_block): also accepts `ec`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27`vm_call_handler` and related functions accept `ec` instead of `th`.ko1
* vm_core.h (vm_call_handler): fix to accept `ec` instead of `th`. * vm_args.c: the following functions accept `ec` instead of `th`. * raise_argument_error * argument_arity_error * argument_kw_error * setup_parameters_complex * vm_eval.c: ditto. * vm_call0 * vm_call0_cfunc_with_frame * vm_call0_cfunc * vm_call0_body * vm_insnhelper.c: ditto * vm_call_iseq_setup_tailcall_0start * vm_call_iseq_setup_normal_0start * vm_callee_setup_arg * vm_call_iseq_setup * vm_call_iseq_setup_2 * vm_call_iseq_setup_normal * vm_call_iseq_setup_tailcall * vm_cfp_consistent_p * vm_call_cfunc_with_frame * vm_call_cfunc * vm_call_ivar * vm_call_attrset * vm_call_bmethod_body * vm_call_bmethod * vm_call_opt_send * vm_call_opt_call * vm_call_method_missing * vm_call_zsuper * current_method_entry * vm_call_method_each_type * vm_call_method_nome * vm_call_method * vm_call_general * vm_call_super_method * tool/mk_call_iseq_optimized.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26Use rb_execution_context_t instead of rb_thread_tko1
to represent execution context [Feature #14038] * vm_core.h (rb_thread_t): rb_thread_t::ec is now a pointer. There are many code using `th` to represent execution context (such as cfp, VM stack and so on). To access `ec`, they need to use `th->ec->...` (adding one indirection) so that we need to replace them by passing `ec` instead of `th`. * vm_core.h (GET_EC()): introduced to access current ec. Also remove `ruby_current_thread` global variable. * cont.c (rb_context_t): introduce rb_context_t::thread_ptr instead of rb_context_t::thread_value. * cont.c (ec_set_vm_stack): added to update vm_stack explicitly. * cont.c (ec_switch): added to switch ec explicitly. * cont.c (rb_fiber_close): added to terminate fibers explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21vm.c, vm_insnhelper.h: export symbols of VM serialsk0kubun
This change is for future JIT compiler introduction. See r60231 for the purpose. [close GH-1721] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21vm_core.h: export symbols of shared variablesk0kubun
vm_insnhelper.h: ditto. All changes are for reducing changes required to introduce JIT compiler. Unlike functions that can be inlined by header, those variables should be shared with JIT-ed code. This will help reducing cost of rebase against upstream. [close GH-1720] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-10rename rb_execution_context_t::stack(_size) to vm_stack(_size).ko1
* vm_core.h: Ruby processes run with two stacks, a machine stack and a VM stack. To make it clear, this fix renames rb_execution_context_t::stack(_size) to vm_stack(_size). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-09fixup r58614 for raspi3 and maybe other systems with odd compilenormal
[ruby-core:81048] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-09rb_execution_context_t: move stack, stack_size and cfp from rb_thread_tnormal
The goal is to reduce rb_context_t and rb_fiber_t size by removing the need to store the entire rb_thread_t in there. [ruby-core:81045] Work-in-progress: soon, we will move more fields here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07insert assertions for THROW_DATA_* macros.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-06fix TracePoint#return_value with non-local exitsko1
* vm.c: get return_value from imemo_throw_data object (THROW_DATA_VAL()). imemo_throw_data (TAG_BREAK) contains returned value. However, imemo_throw_data (TAG_BREAK) can skip several frames so that we need to use it only once (at most internal frame). To record it, we introduced THROW_DATA_CONSUMED and check it. * internal.h: define THROW_DATA_CONSUMED flag. * test/ruby/test_settracefunc.rb: add tests for [Bug #13369] * vm_insnhelper.h: add THROW_DATA_CONSUMED_P() and THROW_DATA_CONSUMED_SET(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-13insns.def: float comparisonnobu
* insns.def (opt_lt, opt_le, opt_gt, opt_ge): optimize flonum and on-heap float comparison. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05* vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....ko1
[Bug #12527] * vm_exec.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-28* vm_core.h: revisit the structure of frame, block and env.ko1
[Bug #12628] This patch introduce many changes. * Introduce concept of "Block Handler (BH)" to represent passed blocks. * move rb_control_frame_t::flag to ep[0] (as a special local variable). This flags represents not only frame type, but also env flags such as escaped. * rename `rb_block_t` to `struct rb_block`. * Make Proc, Binding and RubyVM::Env objects wb-protected. Check [Bug #12628] for more details. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-28NoMethodError#private_call?nobu
* error.c (nometh_err_initialize): add private_call? parameter. * error.c (nometh_err_private_call_p): add private_call? method, to tell if the exception raised in private form FCALL or VCALL. [Feature #12043] * vm_eval.c (make_no_method_exception): append private_call? argument. * vm_insnhelper.c (ci_missing_reason): copy FCALL flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-13vm_eval.c: fstring formatnobu
* vm_eval.c (make_no_method_exception): make format string fstring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-13* refactoring CREF related code.ko1
* eval_intern.h: remove unused setter functions. CREF_CLASS_SET() CREF_NEXT_SET() CREF_SCOPE_VISI_COPY() * eval_intern.h: rename flags: * NODE_FL_CREF_PUSHED_BY_EVAL_ -> CREF_FL_PUSHED_BY_EVAL * NODE_FL_CREF_OMOD_SHARED_ -> CREF_FL_OMOD_SHARED and use IMEMO_FL_USER1/2. * vm.c (vm_cref_new): accept push_by_eval parameter. * vm.c (vm_cref_new_use_prev): added for rb_vm_rewrite_cref(). * vm_insnhelper.c (vm_cref_push): accept pushed_by_eval parameter. * vm_insnhelper.h: remove unused macros: COPY_CREF_OMOD() and COPY_CREF(). * vm_eval.c, insns.def: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23* vm_core.h, vm_insnhelper.h: move definition of VMDEBUGko1
from vm_insnhelper.h to vm_core.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-19* vm_core.h: split rb_call_info_t into several structs.ko1
* rb_call_info (ci) has compiled fixed information. * if ci->flag & VM_CALL_KWARG, then rb_call_info is also rb_call_info_with_kwarg. This technique reduce one word for major rb_call_info data. * rb_calling_info has temporary data (argc, blockptr, recv). for each method dispatch. This data is allocated only on machine stack. * rb_call_cache is for inline method cache. Before this patch, only rb_call_info_t data is passed. After this patch, above three structs are passed. This patch improves: * data locarity (rb_call_info is now read-only data). * reduce memory consumption (rb_call_info_with_kwarg, rb_calling_info). * compile.c: use above data. * insns.def: ditto. * iseq.c: ditto. * vm_args.c: ditto. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. * vm_insnhelper.h: ditto. * iseq.h: add iseq_compile_data::ci_index and iseq_compile_data::ci_kw_indx. * tool/instruction.rb: introduce TS_CALLCACHE operand type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-02* vm_insnhelper.h (GET_PC_COUNT): remove unused macro.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03* method.h: split rb_method_definition_t::flag to several flags.ko1
`flag' contains several categories of attributes and it makes us confusion (at least, I had confused). * rb_method_visibility_t (flags::visi) * NOEX_UNDEF -> METHOD_VISI_UNDEF = 0 * NOEX_PUBLIC -> METHOD_VISI_PUBLIC = 1 * NOEX_PRIVATE -> METHOD_VISI_PRIVATE = 2 * NOEX_PROTECTED -> METHOD_VISI_PROTECTED = 3 * NOEX_SAFE(flag)) -> safe (flags::safe, 2 bits) * NOEX_BASIC -> basic (flags::basic, 1 bit) * NOEX_MODFUNC -> rb_scope_visibility_t in CREF * NOEX_SUPER -> MISSING_SUPER (enum missing_reason) * NOEX_VCALL -> MISSING_VCALL (enum missing_reason) * NOEX_RESPONDS -> BOUND_RESPONDS (macro) Now, NOEX_NOREDEF is not supported (I'm not sure it is needed). Background: I did not know what "NOEX" stands for. I asked Matz (who made this name) and his answer was "Nothing". "At first, it meant NO EXport (private), but the original meaning was gone." This is why I remove the mysterious word "NOEX" from MRI. * vm_core.h: introduce `enum missing_reason' to represent method_missing (NoMethodError) reason. * eval_intern.h: introduce rb_scope_visibility_t to represent scope visibility. It has 3 method visibilities (public/private/protected) and `module_function`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* node.h: remove NODE_IFUNC, NEW_IFUNC.ko1
* internal.h: use T_IMEMO for IFUNC. rename `struct IFUNC' to `struct vm_ifunc' and move the definition from vm_insnhelper.h. Add imemo_ifunc. * gc.c (gc_mark_children): mark imemo_ifunc type T_IMEMO object. * compile.c: catch up these changes. * proc.c: ditto. * vm_core.h (RUBY_VM_IFUNC_P): ditto. * vm_eval.c (rb_iterate): ditto. * vm_insnhelper.c: ditto. * ext/objspace/objspace.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* vm_insnhelper.h: use T_IMEMO to create THROW_DATA.ko1
Add THROW_DATA_NEW(). * internal.h: move defnition of `struct THROW_DATA' from vm_insnhelper.h to internal.h. Rename `THROW_DATA' to `vm_throw_data'. * eval_intern.h (THROW_DATA_P): move to internal.h. THROW_DATA is no longer T_NODE, so check T_IMEMO. * gc.c (gc_mark_children): mark THROW_DATA. * vm.c: catch up these changes. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* vm_insnhelper.c: use T_IMEMO to create SVAR.ko1
* internal.h, vm_insnhelper.h: move definition `struct SVAR' from vm_insnhelper.h to internal.h. And rename it to strcut vm_svar. new imemo_type imemo_svar is added. * gc.c (gc_mark_children): mark imemo_svar. * node.c (rb_gc_mark_node): remove useless marking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10* vm_insnhelper.h (THROW_DATA_STATE): return int, not VALUE.ko1
* vm_insnhelper.h (THROW_DATA_STATE_SET): accept int value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10* vm_insnhelper.h: define struct IFUNC.ko1
* vm_eval.c (rb_iterate): use it. * vm_insnhelper.c (vm_yield_with_cfunc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10* vm_insnhelper.h: define struct THROW_DATA to representko1
throwing data. Also define accessor functions. * eval_intern.h: move related changes into vm_insnhelper.h. Now these MACROs (functions) are only used in vm*.c. There is only THROW_DATA_P(err) to check this data type or not. * vm.c: catch up these changes. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-08* vm_insnhelper.h: define struct SVAR for SVAR.ko1
This data type is also same layout of NODE (NODE_IF). * vm_insnhelper.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-08* internal.h: define rb_cref_t and change to use it.ko1
rb_cref_t is data type of CREF. Now, the body is still NODE. It is easy to understand what is CREF and what is pure NODE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-08* vm_insnhelper.h (COPY_CREF_OMOD): fix translation miss.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-08* internal.h: define CREF accessor macros.ko1
* CREF_CLASS(cref) * CREF_NEXT(cref) * CREF_VISI(cref) * CREF_VISI_SET(cref, v) * CREF_REFINEMENTS(cref) * CREF_PUSHED_BY_EVAL(cref) * CREF_PUSHED_BY_EVAL_SET(cref) * CREF_OMOD_SHARED(cref) * CREF_OMOD_SHARED_SET(cref) * CREF_OMOD_SHARED_UNSET(cref) This is process to change CREF data type from NODE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-18vm_core.h: redefined_flag in rb_vm_tnobu
* vm_core.h (struct rb_vm_struct): move redefined_flag from ruby_vm_redefined_flag. * vm_core.h (BASIC_OP_UNREDEFINED_P): move from vm_insnhelper.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-20* include/ruby/ruby.h: rename OBJ_WRITE and OBJ_WRITTEN intoko1
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
2013-12-09* compile.c, insns.def, test/ruby/test_rubyvm.rb, vm.c, vm_core.h,charliesome
vm_insnhelper.c, vm_insnhelper.h, vm_method.c: Rename method_serial to global_method_state and constant_serial to global_constant_state after discussion with ko1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-08gc.c: promote long-lived NODE_CREF objects to oldgentmm1
* 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
2013-11-09* compile.c (iseq_compile_each): emit opt_str_freeze if the #freezecharliesome
method is called on a static string literal with no arguments. * defs/id.def (firstline): add freeze so idFreeze is available * insns.def (opt_str_freeze): add opt_str_freeze instruction which pushes a frozen string literal without allocating a new object if String#freeze is not overriden * string.c (Init_String): define String#freeze * vm.c (vm_init_redefined_flag): define BOP_FREEZE on String class as a basic operation * vm_insnhelper.h: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09* class.c: unify names of vm state version counters to 'serial'.charliesome
This includes renaming 'vm_state_version_t' to 'rb_serial_t', 'method_state' to 'method_serial', 'seq' to 'class_serial', 'vmstat' to 'constant_serial', etc. * insns.def: ditto * internal.h: ditto * vm.c: ditto * vm_core.h: ditto * vm_insnhelper.c: ditto * vm_insnhelper.h: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: splitcharliesome
ruby_vm_global_state_version into two separate counters - one for the global method state and one for the global constant state. This means changes to constants do not affect method caches, and changes to methods do not affect constant caches. In particular, this means inclusions of modules containing constants no longer globally invalidate the method cache. * class.c, eval.c, include/ruby/intern.h, insns.def, vm.c, vm_method.c: rename rb_clear_cache_by_class to rb_clear_method_cache_by_class * class.c, include/ruby/intern.h, variable.c, vm_method.c: add rb_clear_constant_cache * compile.c, vm_core.h, vm_insnhelper.c: rename vmstat field in rb_call_info_struct to method_state * vm_method.c: rename vmstat field in struct cache_entry to method_state git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28* vm.c: vm_clear_all_cache is not necessary now we use a 64 bit countercharliesome
for global state version. * vm_insnhelper.h: ruby_vm_global_state_version overflow is unnecessary git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26* insns.def (opt_regexpmatch1): check Regexp#=~ is not defined beforecharliesome
calling rb_reg_match() * test/ruby/test_regexp.rb: add test * vm.c (ruby_vm_redefined_flag): change type to short[] * vm.c (vm_redefinition_check_flag): return REGEXP_REDEFINED_OP_FLAG if klass == rb_cRegexp * vm.c (vm_init_redefined_flag): setup BOP flag for Regexp#=~ * vm_insnhelper.h: add REGEXP_REDEFINED_OP_FLAG [ruby-core:57385] [Bug #8953] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-04* class.c, compile.c, eval.c, gc.h, insns.def, internal.h, method.h,charliesome
variable.c, vm.c, vm_core.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: Implement class hierarchy method cache invalidation. [ruby-core:55053] [Feature #8426] [GH-387] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-31* vm_insnhelper.h (CALL_SIMPLE_METHOD): change name of 'recv' argumentcharliesome
so that other variable names may be used when calling this macro git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-27vm_insnhelper.h: RBASIC_CLASSnobu
* vm_insnhelper.c (opt_eq_func): use RBASIC_CLASS() instead of HEAP_CLASS_OF(). * insns.def (opt_plus, opt_minus, opt_mult, opt_div, opt_mod, opt_lt), (opt_gt, opt_ltlt, opt_aref, opt_aset, opt_length, opt_size), (opt_empty_p, opt_succ): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-22* vm_insnhelper.h: partly revert r37631 (DTrace support).naruse
"vm usage information is always collected, so uncomment the functions." causes performance impact. [Bug #7370] Off course this revert disables related probes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-12* probes.d: add DTrace probe declarations. [ruby-core:27448]tenderlove
* array.c (empty_ary_alloc, ary_new): added array create DTrace probe. * compile.c (rb_insns_name): allowing DTrace probes to access instruction sequence name. * Makefile.in: translate probes.d file to appropriate header file. * common.mk: declare dependencies on the DTrace header. * configure.in: add a test for existence of DTrace. * eval.c (setup_exception): add a probe for when an exception is raised. * gc.c: Add DTrace probes for mark begin and end, and sweep begin and end. * hash.c (empty_hash_alloc): Add a probe for hash allocation. * insns.def: Add probes for function entry and return. * internal.h: function declaration for compile.c change. * load.c (rb_f_load): add probes for `load` entry and exit, require entry and exit, and wrapping search_required for load path search. * object.c (rb_obj_alloc): added a probe for general object creation. * parse.y (yycompile0): added a probe around parse and compile phase. * string.c (empty_str_alloc, str_new): DTrace probes for string allocation. * test/dtrace/*: tests for DTrace probes. * vm.c (vm_invoke_proc): add probes for function return on exception raise, hash create, and instruction sequence execution. * vm_core.h: add probe declarations for function entry and exit. * vm_dump.c: add probes header file. * vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on function entry and return. * vm_exec.c: expose instruction number to instruction name function. * vm_insnshelper.c: add function entry and exit probes for cfunc methods. * vm_insnhelper.h: vm usage information is always collected, so uncomment the functions. 12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org> * configure.in (isinf, isnan): isinf() and isnan() are macros on DragonFly which cannot be found by AC_REPLACE_FUNCS(). This workaround enforces the fact that they exist on DragonFly. 12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org> * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo), vm_insnhelper.c (vm_search_method): revert r37616 because it's too slow. [ruby-dev:46477] * test/ruby/test_refinement.rb (test_inline_method_cache): skip the test until the bug is fixed efficiently. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-15* vm_insnhelper.h (CI_SET_FASTPATH): add new parameter `enabled'.ko1
If `enable' is 0 then CI_SET_FASTPATH() doesn't work. And add new configuration option OPT_CALL_FASTPATH. If this macro was defined by 0, then CI_SET_FASTPATH() doesn't work any more. * vm_insnhelper.c (vm_call_method): Pass `0' for `enabled' parameter of CI_SET_FASTPATH if this method is protected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-14* vm_insnhelper.h CI_SET_FASTPATH: introduce new macroko1
`CI_SET_FASTPATH(ci, func)'. This macro set `ci->call' as `func'. `func' (ci->call) is called at the last of `send' (and `invokesuper') instruction. `CI_SET_FASTPATH' does not set `ci->call' when the method (stored in `ci->me') is `protected'. * vm_insnhelper.c (vm_call_method): use `CI_SET_FASTPATH'. After several checking (visibility, argc checking), the result of checking can be reused until re-definition of this method with inline method cache. Note that this optimization is now experimental. If you find any problem about it, please tell us. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-14* insns.def (send, invokesuper, invokeblock, opt_*), vm_core.h:ko1
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
2012-10-09* vm_core.h (rb_call_info_t): add new type `rb_call_inf_t'.ko1
This data structure contains information including inline method cache. After that, `struct iseq_inline_cache_entry' does not need to contain inline cache for method invocation. Other information will be added to this data structure. * vm_core.h (rb_iseq_t): add `callinfo_entries' and `callinfo_size' members to `rb_iseq_t'. * insns.def, compile.c: Use CALL_INFO instead of IC. * tool/instruction.rb: support CALL_INFO as operand type. * vm_insnhelper.c, vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-08* eval.c, gc.c, iseq.c, node.h, vm_insnhelper.c, vm_insnhelper.h,shugo
vm_method.c: rename omod and overlaid modules to refinements. * eval.c (hidden_identity_hash_new): renamed from identity_hash_new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e