summaryrefslogtreecommitdiff
path: root/class.c
AgeCommit message (Collapse)Author
2015-06-06* class.c: ins_methods_push() needs rb_method_visibility_t type onko1
2nd arg. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06* class.c (ins_methods_push): Change type and name of parametersko1
to make more clear. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06class.c: suppress a warningnobu
* class.c (ins_methods_push): suppress a signed and unsigned comparison warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05* class.c (ins_methods_push): change 3rd parameter's typeko1
from long to rb_method_visibility_t. * class.c (ins_methods_i): catch up this fix. * class.c (method_entry_i): cast to st_data_t instead of `long'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04* method.h: constify rb_method_refined_t::orig_me.ko1
Also constify the following functions. * rb_resolve_refined_method() * rb_method_entry_with_refinements() * rb_method_entry_without_refinements() * rb_method_entry_copy()'s parameter. * class.c: catch up this fix. * vm_insnhelper.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03* method.h: introduce rb_method_refined_t for refined method entry.ko1
* class.c (move_refined_method): catch up this fix. * gc.c (mark_method_entry): ditto. * vm_eval.c (vm_call0_body): ditto. * vm_insnhelper.c (vm_call_method): ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03* class.c (method_entry_i): mtbl should not have `me' as NULL.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03* class.c (clone_method): do not use me->klass, but use explicitlyko1
passed argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03* vm_core.h (rb_vm_rewrite_cref_stack): rename to rb_vm_rewrite_cref().ko1
* class.c (clone_method): use renamed name. * vm_insnhelper.c (rb_vm_rewrite_cref): do not use `node' in variable names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03* class.c (clone_method): remove redundant check for me->def != NULL.ko1
Now, all `me` have `me->def`. * proc.c (rb_method_entry_location): ditto. * vm.c (rb_vm_check_redefinition_opt_method): ditto. * vm.c (add_opt_method): ditto. * vm_eval.c (vm_call0_body): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50748 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-06-02* method.h: remove rb_method_iseq_t::iseqval.ko1
While making a r50728, iseqval is needed (to mark correctly), but now just iseqptr is enough. * class.c: catch up this fix. * gc.c: ditto. * proc.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02* method.h: make rb_method_entry_t a VALUE.ko1
Motivation and new data structure are described in [Bug #11203]. This patch also solve the following issues. * [Bug #11200] Memory leak of method entries * [Bug #11046] __callee__ returns incorrect method name in orphan proc * test/ruby/test_method.rb: add a test for [Bug #11046]. * vm_core.h: remvoe rb_control_frame_t::me. me is located at value stack. * vm_core.h, gc.c, vm_method.c: remove unlinked_method... codes because method entries are simple VALUEs. * method.h: Now, all method entries has own independent method definititons. Strictly speaking, this change is not essential, but for future changes. * rb_method_entry_t::flag is move to rb_method_definition_t::flag. * rb_method_definition_t::alias_count is now rb_method_definition_t::alias_count_ptr, a pointer to the counter. * vm_core.h, vm_insnhelper.c (rb_vm_frame_method_entry) added to search the current method entry from value stack. * vm_insnhelper.c (VM_CHECK_MODE): introduced to enable/disable assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-01* class.c: remove needless include pragmra for method.h.ko1
* struct.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-31* class.c (rb_class_has_methods): added to reduce depenedencyko1
to internal class data structure. * internal.h: ditto. * hash.c (has_extra_methods): use added function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-23vm_eval.c: allow symbols to instance_eval/execnobu
* vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow symbols to just instance_eval/exec, execept for definition of singletons. [ruby-core:68961] [Bug #11086] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* gc.c: fix memory leak by prepend method.ko1
It is easy to reproduce with such script: module M; def bar; end; end loop{ Class.new do def foo; end prepend M end } * gc.c (obj_free): free T_ICLASS::m_tbl if it is created by prepend. To recognize it, check RICLASS_IS_ORIGIN flag. * gc.c (gc_mark_children): T_ICLASS objects only need to mark T_ICLASS::m_tbl if RICLASS_IS_ORIGIN is set. * gc.c (obj_memsize_of): count T_ICLASS if RICLASS_IS_ORIGIN is set. * internal.h (RCLASS_SET_ORIGIN): add to set RCLASS_SET_ORIGIN. TODO: The word `origin' seems not good name. We need to invent another good name. * class.c: use RCLASS_SET_ORIGIN(). * class.c (class_alloc): zero clear rb_classext_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49931 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-06* class.c (rb_prepend_module): need a WB for klass -> origin.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-06* fix namespace issue on singleton class expressions. [Bug #10943]ko1
* 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
2015-03-05* internal.h: remove struct method_table_wrapper.ko1
struct method_table_wrapper was introduced to avoid duplicate marking for method tables. For example, `module M1; def foo; end; end` make one method table (mtbl) contains a method `foo`. M1 (T_MODULE) points mtbl. Classes C1 and C2 includes M1, then two T_ICLASS objects are created and they points mtbl too. In this case, three objects (one T_MODULE and two T_ICLASS objects) points same mtbl. On marking phase, these three objects mark same mtbl. To avoid such duplication, struct method_table_wrapper was introduced. However, created two T_ICLASS objects have same or shorter lifetime than M1 (T_MODULE) object. So that we only need to mark mtbl from M1, not from T_ICLASS objects. This patch tries marking only from M1. Note that one `Module#prepend` call creates two T_ICLASS objects. One for refering to a prepending Module object, same as `Module#include`. We don't nedd to care this T_ICLASS. One for moving original mtbl from a prepending class. We need to mark such mtbl from this T_ICLASS object. To mark the mtbl, we need to use `RCLASS_ORIGIN(klass)` on marking from a prepended class `klass`. * class.c: ditto. * eval.c (rb_using_refinement): ditto. * gc.c: ditto. * include/ruby/ruby.h: define m_tbl directly. The definition of struct RClass should be moved to (srcdir)/internal.h. * method.h: remove decl of rb_free_m_tbl_wrapper(). * object.c: use RCLASS_M_TBL() directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-22* vm_insnhelper.c (rb_vm_rewrite_cref_stack): copy nd_refinementsktsj
of orignal crefs. It fixes segmentation fault when calling refined method in duplicate module. [ruby-dev:48878] [Bug #10885] * vm_core.h, class.c: change accordingly. * test/ruby/test_refinement.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16use rb_funcallvnobu
* use rb_funcallv() for no arguments call instead of variadic rb_funcall(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-05* class.c (rb_obj_singleton_methods): should use RTEST() to convertshugo
VALUE to int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-04* class.c (method_entry_i, class_instance_method_list,shugo
rb_obj_singleton_methods): should not include methods of superclasses if recur is false. [ruby-dev:48854] [Bug #10826] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-19class.c: add callback argumentnobu
* class.c (rb_class_foreach_subclass): add argument for callback function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-19class.c: prepend for each classesnobu
* class.c (include_modules_at): allow prepend each modules upto once for each classes. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-11* class.c (class_alloc): Strat from age == 2.ko1
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
2014-11-27* vm_args.c: fix backtrace location for keyword related exceptions.ko1
For example, the following program def foo(k1: 1); end # line 1 foo(k2: 2) # line 2 causes "unknown keyword: k2 (ArgumentError)". Before this patch, the backtrace location is only line 2. However, error should be located at line 1 (over line 2 in stack trace). This patch fix this problem. * class.c (rb_keyword_error_new): separate exception creation logic from rb_keyword_error(), to use in vm_args.c. * vm_insnhelper.c (rb_arg_error_new): rename to rb_arity_error_new(). * vm_args.c (argument_arity_error): rename to argument_arity_error(). * vm_args.c (arugment_kw_error): added to fix backtrace. * test/ruby/test_keyword.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-25rb_id2str over rb_id2namenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18* internal.h: Gather declarations in non-header files.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* internal.h: Include ruby.h and ruby/encoding.h to beakr
includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-02* rewrite method/block parameter fitting logic to optimizeko1
keyword arguments/parameters and a splat argument. [Feature #10440] (Details are described in this ticket) Most of complex part is moved to vm_args.c. Now, ISeq#to_a does not catch up new instruction format. * vm_core.h: change iseq data structures. * introduce rb_call_info_kw_arg_t to represent keyword arguments. * add rb_call_info_t::kw_arg. * rename rb_iseq_t::arg_post_len to rb_iseq_t::arg_post_num. * rename rb_iseq_t::arg_keywords to arg_keyword_num. * rename rb_iseq_t::arg_keyword to rb_iseq_t::arg_keyword_bits. to represent keyword bitmap parameter index. This bitmap parameter shows that which keyword parameters are given or not given (0 for given). It is refered by `checkkeyword' instruction described bellow. * rename rb_iseq_t::arg_keyword_check to rb_iseq_t::arg_keyword_rest to represent keyword rest parameter index. * add rb_iseq_t::arg_keyword_default_values to represent default keyword values. * rename VM_CALL_ARGS_SKIP_SETUP to VM_CALL_ARGS_SIMPLE to represent (ci->flag & (SPLAT|BLOCKARG)) && ci->blockiseq == NULL && ci->kw_arg == NULL. * vm_insnhelper.c, vm_args.c: rewrite with refactoring. * rewrite splat argument code. * rewrite keyword arguments/parameters code. * merge method and block parameter fitting code into one code base. * vm.c, vm_eval.c: catch up these changes. * compile.c (new_callinfo): callinfo requires kw_arg parameter. * compile.c (compile_array_): check the last argument Hash object or not. If Hash object and all keys are Symbol literals, they are compiled to keyword arguments. * insns.def (checkkeyword): add new instruction. This instruction check the availability of corresponding keyword. For example, a method "def foo k1: 'v1'; end" is cimpiled to the following instructions. 0000 checkkeyword 2, 0 # check k1 is given. 0003 branchif 9 # if given, jump to address #9 0005 putstring "v1" 0007 setlocal_OP__WC__0 3 # k1 = 'v1' 0009 trace 8 0011 putnil 0012 trace 16 0014 leave * insns.def (opt_send_simple): removed and add new instruction "opt_send_without_block". * parse.y (new_args_tail_gen): reorder variables. Before this patch, a method "def foo(k1: 1, kr1:, k2: 2, **krest, &b)" has parameter variables "k1, kr1, k2, &b, internal_id, krest", but this patch reorders to "kr1, k1, k2, internal_id, krest, &b". (locate a block variable at last) * parse.y (vtable_pop): added. This function remove latest `n' variables from vtable. * iseq.c: catch up iseq data changes. * proc.c: ditto. * class.c (keyword_error): export as rb_keyword_error(). * common.mk: depend vm_args.c for vm.o. * hash.c (rb_hash_has_key): export. * internal.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-22class.c: delete expected keywords directlynobu
* class.c (unknown_keyword_error): delete expected keywords directly from raw table, so that the given block is not called. [ruby-core:65837] [Bug #10413] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-19class.c: do not freeze class of hidden objectnobu
* class.c (rb_freeze_singleton_class): get rid of freeze class of hidden object to fix segfaults. * include/ruby/ruby.h (rb_obj_freeze_inline): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-19class.c: do not freeze meta-meta-classnobu
* class.c (rb_freeze_singleton_class): should not propagate to meta-meta-class, and so on, which is shared with the original class. fix occational exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-13class.c: simplifynobu
* class.c (singleton_class_of): use local variable and remove duplicated member access. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-13class.c: freeze meta class onlynobu
* class.c (singleton_class_of): should not propagete freezing to meta meta class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-13class.c: use ALLOC(rb_subclass_entry_t)normal
It is easier to search for allocations by type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-11* class.c (rb_prepend_module): fix typos in a comment.nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-05* class.c: [DOC] mention about prepended modules.ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-03Init functions don't need ID cachesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-18constify parametersnobu
* include/ruby/intern.h: constify `argv` parameters. * include/ruby/ruby.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25* class.c: [DOC] Fixed grammar and examples of instance_methods.zzak
By @alex-frost via documenting-ruby/ruby#31 [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-08class.c: always clear tables firstnobu
* class.c (rb_mod_init_copy): always clear instance variable, constant and method tables first, regardless the source tables. [ruby-dev:48182] [Bug #9813] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-09class.c: check for malloc failuresnormal
* class.c (rb_class_subclass_add): use xmalloc * class.c (rb_module_add_to_subclasses_list): ditto * class.c (rb_class_remove_from_super_subclasses): use xfree * class.c (rb_class_remove_from_module_subclasses): ditto [Bug #9616] xmalloc does OOM checking and helps GC accounting when used with xfree. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-27adjust indent and stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21class.c: do nothing if copying selfnobu
* class.c (rb_mod_init_copy): do nothing if copying self. [ruby-dev:47989] [Bug #9535] * hash.c (rb_hash_initialize_copy): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-25class.c: allow nil keyword_hashnobu
* class.c (rb_extract_keywords): treat nil keyword_hash same as 0, for the case rb_scan_args returns nil if no keyword hash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-25class.c: simplifynobu
* class.c (rb_obj_methods): simplify without jump. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e