aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
Commit message (Collapse)AuthorAgeFilesLines
* [Feature #12005] Unify Fixnum and Bignum into Integerakr2016-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [Feature #12005] Unify Fixnum and Bignum into Integer * include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums. * insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG. * vm_core.h: Ditto. * vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead of FIXNUM_REDEFINED_OP_FLAG. * vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of rb_cFixnum and rb_cBignum. (C): Use Integer instead of Fixnum and Bignum. * numeric.c (fix_succ): Removed. (Init_Numeric): Define Fixnum as Integer. * bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum. (rb_int_coerce): replaced from rb_big_coerce and return fixnums as-is. (Init_Bignum): Define Bignum as Integer. Don't define ===. * error.c (builtin_class_name): Return "Integer" for fixnums. * sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum. * ext/-test-/testutil: New directory to test. Currently it provides utilities for fixnum and bignum. * ext/json/generator/generator.c: Define mInteger_to_json. * lib/mathn.rb (Fixnum#/): Redefinition removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: deprecated constant in classnobu2016-05-151-0/+2
| | | | | | | * vm_insnhelper.c (vm_get_ev_const): warn deprecated constant even in the class context. [ruby-core:75505] [Bug #12382] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_getivar): describe fast-path explicittarui2016-05-111-22/+18
| | | | | | | (compiler frindly). [Bug #12274]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: check function attirbute const and pure,naruse2016-05-081-0/+5
| | | | | | | | | | | | and define CONSTFUNC and PUREFUNC if available. Note that I don't add those options as default because it still shows many false-positive (it seems not to consider longjmp). * vm_eval.c (stack_check): get rb_thread_t* as an argument to avoid duplicate call of GET_THREAD(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "vm_insnhelper.c: INLINE condition" [Bug #12316]naruse2016-04-241-1/+1
| | | | | | | | | This reverts commit r54747. !__clang__ is also essential. Anyway clang inlines vm_getivar into both vm_call_ivar and vm_getinstancevariable, which r54728 originally intended to. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: INLINE conditionnobu2016-04-241-1/+1
| | | | | | | * vm_insnhelper.c (INLINE): works with __NO_INLINE__ only, __clang__ is not the point. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (INLINE): cosmetic change.ktsj2016-04-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (INLINE): disbale r54738 if __NO_INLINE__ is defined.ktsj2016-04-241-1/+1
| | | | | | It caused "undefined reference to `vm_getivar'". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Disable r54738 if clangnobu2016-04-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (INLINE): define as `inline` when it is optimized.naruse2016-04-231-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | define as `static inline` when it is not optimized to keep the symbol generated. * vm_insnhelper.c (vm_getivar): use `INLINE` to force inline so that a compiler inlines it into vm_getinstancevariable and optimizes out is_attr and related branches. * vm_insnhelper.c (vm_getivar): use `inline` to recommend inline. Without this vm1_ivar_set is degraded. benchmark results: minimum results in each 5 measurements. Execution time (sec) name ruby 2.4.0dev (2016-04-23 trunk 54727) [x86_64-linux] ruby 2.4.0dev (2016-04-23 trunk 54733) [x86_64-linux] built-ruby loop_whileloop 0.641 0.642 0.646 vm1_ivar* 1.002 0.999 0.831 vm1_ivar_set* 0.369 1.106 0.362 Speedup ratio: compare with the result of `ruby 2.4.0dev (2016-04-23 trunk 54727) [x86_64-linux]' (greater is better) name ruby 2.4.0dev (2016-04-23 trunk 54733) [x86_64-linux] built-ruby loop_whileloop 0.998 0.991 vm1_ivar* 1.003 1.205 vm1_ivar_set* 0.334 1.018 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: getivar setivar optimizationnobu2016-04-231-6/+5
| | | | | | | | | * vm_insnhelper.c (vm_getivar, vm_setivar): remove inline. * vm_insnhelper.c (vm_call_ivar, vm_call_attrset): tweak the order tail-call-optimization friendly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: missing static to inlinenobu2016-04-231-1/+1
| | | | | | | | * vm_insnhelper.c (vm_getivar): add missing static to inline, otherwise external symbol is referred and link fails when optimization is disabled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_getivar): specify inline instead of static inline.naruse2016-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | vm_getivar is called by vm_call_ivar and vm_getinstancevariable. At least with GCC 4.8 and 5.3 on Linux, they are inlining it into vm_call_ivar but not vm_getinstancevariable. By `inline`, they correctly inline it and gains performance. Speedup ratio: compare with the result of `ruby 2.4.0dev (2016-04-23 trunk 54727) [x86_64-linux]' (greater is better) name built-ruby loop_whileloop 1.001 vm1_ivar* 1.189 vm1_ivar_set* 1.024 Note tha `inline`'s meaning is different between old GCC and C99. Old GCC's inline means C99's extern inline. https://gcc.gnu.org/onlinedocs/gcc/Inline.html Since Ruby specify -std=iso9899:1999, it works like C99. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c: use uint32_t instead of long to avoid confusion aboutnaruse2016-04-221-6/+5
| | | | | | the type of ivtbl->numiv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_marks_finish): fix syntax error.ko12016-03-311-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NoMethodError#private_call?nobu2016-02-281-1/+3
| | | | | | | | | | | | * 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
* vm_insnhelper.c (vm_check_if_namespace): tiny size reductionnormal2016-01-241-4/+1
| | | | | | | | | | | | | Take advantage of "%+" modifier in the format string instead of explicitly calling rb_inspect to reduce object size. On x86 32-bit: text data bss dec hex filename before: 2949572 12448 30680 2992700 2daa3c miniruby after: 2949464 12448 30680 2992592 2da9d0 miniruby git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: fstring formatnobu2016-01-131-1/+2
| | | | | | | * 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
* * vm_insnhelper.c: move vm_callee_setup_block_arg() (and relatedko12015-12-221-82/+82
| | | | | | | | | | | functions) to the latter location. This moving recovers performance a little. [Bug #11829] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method_each_type): should not set fastpathko12015-12-161-1/+1
| | | | | | | | | | | | | | | with keyword arguments for VM_METHOD_TYPE_ATTRSET type methods. Normally, we can not use keyword arguments for this kind of methods, (obj.foo = 1), but we can set alias names for them. [Bug #11657] * test/ruby/test_keyword.rb: add a test for this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c: fix typos.hsbt2015-12-141-1/+1
| | | | | | | | | | | | | [ci skip][fix GH-1140] Patch by @jutaz * dir.c: ditto. * gc.c: ditto. * io.c: ditto. * node.h: ditto. * thread_pthread.c: ditto. * vm_insnhelper.c: ditto. * vsnprintf.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: adjust indent [ci skip]nobu2015-12-121-1/+1
| | | | | | | * vm_insnhelper.c (vm_call_method_missing): remove spaces just before a tab to adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method_missing): method_missing shouldshugo2015-12-121-1/+3
| | | | | | | not be refined. [ruby-core:72080] [Bug #11809] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * introduce new ISeq binary format serializer/de-serializerko12015-12-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and a pre-compilation/runtime loader sample. [Feature #11788] * iseq.c: add new methods: * RubyVM::InstructionSequence#to_binary_format(extra_data = nil) * RubyVM::InstructionSequence.from_binary_format(binary) * RubyVM::InstructionSequence.from_binary_format_extra_data(binary) * compile.c: implement body of this new feature. * load.c (rb_load_internal0), iseq.c (rb_iseq_load_iseq): call RubyVM::InstructionSequence.load_iseq(fname) with loading script name if this method is defined. We can return any ISeq object as a result value. Otherwise loading will be continue as usual. This interface is not matured and is not extensible. So that we don't guarantee the future compatibility of this method. Basically, you should'nt use this method. * iseq.h: move ISEQ_MAJOR/MINOR_VERSION (and some definitions) from iseq.c. * encoding.c (rb_data_is_encoding), internal.h: added. * vm_core.h: add several supports for lazy load. * add USE_LAZY_LOAD macro to specify enable or disable of this feature. * add several fields to rb_iseq_t. * introduce new macro rb_iseq_check(). * insns.def: some check for lazy loading feature. * vm_insnhelper.c: ditto. * proc.c: ditto. * vm.c: ditto. * test/lib/iseq_loader_checker.rb: enabled iff suitable environment variables are provided. * test/runner.rb: enable lib/iseq_loader_checker.rb. * sample/iseq_loader.rb: add sample compiler and loader. $ ruby sample/iseq_loader.rb [dir] will compile all ruby scripts in [dir]. With default setting, this compile creates *.rb.yarb files in same directory of target .rb scripts. $ ruby -r sample/iseq_loader.rb [app] will run with enable to load compiled binary data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (rb_vm_cref_replace_with_duplicated_cref): added.ko12015-11-201-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | CREFs should not be shared by methods between `using'. [Bug #11247] * vm_insnhelper.c (vm_cref_replace_with_duplicated_cref): ditto. * vm.c (vm_cref_dup): should copy refinements correctly. * eval.c: use rb_vm_cref_replace_with_duplicated_cref(). * eval_intern.h: add a decl. of rb_vm_cref_replace_with_duplicated_cref(). * vm_eval.c (eval_string_with_cref): do not need to pass scope's CREF because VM can find out CREF from stack frames. * test/ruby/test_refinement.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h: introduce the folliwing field and macros.ko12015-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * rb_method_definition_t::complemented_count to count shared method entries because of complemented method entries and separate from alias_count. Shared `def' only by complemented method entries should not prevent method re-definition warning. * METHOD_ENTRY_COMPLEMENTED(me) to represent complemented method entry. * METHOD_ENTRY_COMPLEMENTED_SET(me) to check it as complemented me. * vm_insnhelper.c (aliased_callable_method_entry): should also check me->def->complemented_count. * vm_method.c (method_definition_addref_complement): add to count complemented method entries number. * vm_method.c (rb_method_definition_release): release `def' iff alias_count == 0 and complemented_count == 0. * test/ruby/test_module.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * refactoring CREF related code.ko12015-11-131-16/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* revert r52402ko12015-10-311-4/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: get rid of copying garbagenobu2015-10-311-2/+2
| | | | | | | * vm_insnhelper.c (vm_call_method_missing): get rid of extra garbage after argv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_search_super_method): do not touch `ci' here.ko12015-10-311-3/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (getinlinecache/setinlinecache): compare ic->ic_cref andko12015-10-291-0/+17
| | | | | | | | | | | | | | | | | | | | current cref only when cached CREF list includes singleton class. Singleton classes have own namespaces, so that we need to check cref as a key (#10943). However, if current CREF list does not include singleton class, no need to check CREF beacuse it should be same name space. * vm_insnhelper.c (vm_get_const_key_cref): add a function returns CREF only when it includes singleton class. * vm_core.h: constify iseq_inline_cache_entry::ic_cref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_env_cref): make it inline for performance.ko12015-10-291-4/+5
| | | | | | | | | * vm_insnhelper.c (rb_vm_get_cref): use NULL instead of 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_check_frame_detail): should require me forko12015-10-291-2/+6
| | | | | | | | | VM_FRAME_FLAG_BMETHOD type frame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: use enum and fix typonobu2015-10-291-9/+16
| | | | | | | | | * vm_insnhelper.c (VM_PROFILE_UP): use enum. * vm_insnhelper.c (vm_profile_show_result): fix typo, "r->c" at the last should be "c->c". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: improved error message for "wrong numberduerst2015-10-241-3/+3
| | | | | | | | of arguments", distinguishing given and expected argument numbers clearly. [Feature #9025] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c: remove the typedef redeclaration ofshugo2015-10-241-1/+0
| | | | | | vm_call_handler. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c: introduce new call handler for simple ISeqs.ko12015-10-231-38/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vm_call_iseq_setup_normal_0start() is simple, however it has some loops/conditions depends on ISeq::param.size and ISeq::local_size (in vm_push_frame(), inlined into this function). There are many simple methods which has a few parameters and local variables. So that this patch introduces several special functions generated in vm_call_iseq_optimized.inc by tool/mk_call_iseq_optimized.rb. This script makes vm_call_iseq_setup_normal_0start_Xparams_Ylocals() where X is 0 to 3 and Y is 1 to 6 (as current setting). In this case, X * Y = 24 functions are created. These functions creates fast method dispatch by inlining vm_push_frame() with immediate params/locals sizes. On my laptop, we can have the following results. vm2_method* 1.083 (8.3% faster) vm2_poly_method* 0.961 (3.4% slower) It shows 8.3% faster for inner loop method dispatch (hit inline cache), but 3.4% slower when inline cache miss because we need to find a suitable call handler. * common.mk: add a rule for vm_call_iseq_optimized.inc. * tool/mk_call_iseq_optimized.rb: added. * vm.c: include vm_call_iseq_optimized.inc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: suppress a warningnobu2015-10-171-1/+1
| | | | | | | * vm_insnhelper.c (vm_yield_with_cfunc): cast to suppress a warning by VC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_args.c: symbol procnobu2015-10-161-3/+13
| | | | | | | * vm_args.c (vm_caller_setup_arg_block): store symbols instead of ifuncs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_push_frame): initialize other than sp (and ep)ko12015-10-101-6/+9
| | | | | | | | first for performance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_iseq_setup_normal): setup sp firstko12015-10-101-2/+1
| | | | | | | | for performance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (invoke_block_from_c): split this function into severalko12015-10-101-12/+5
| | | | | | | | | | functions. * vm_insnhelper.c (vm_yield_callee_setup_arg): remove this function beacuse it is only delegation function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (newobj_of_slowpass): fix typo (pass -> path).ko12015-10-101-1/+1
| | | | | | | | | Pointed out by Yukihiro Matsumoto <matz@ruby-lang.org>. * gc.c (newobj_of_...): `of' is unnecessary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method0): do not propagate enable_fastpath,ko12015-10-101-51/+49
| | | | | | | | but pass dummy CC to prevent wrong caching. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method0): use switch() for visibilitiesko12015-10-061-11/+13
| | | | | | | | (for readability). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h: remove METHOD_ENTRY_SAFE(me) and related codeko12015-10-061-6/+1
| | | | | | | | | | because $SAFE = 3 and 4 is not available. Now, $SAFE is not checked on method dispatch at all. * vm_eval.c, vm_insnhelper.c, vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c: solve goto spaghetti.ko12015-10-051-174/+164
| | | | | | | | Change all goto statement across blocks to tail call functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_args.c: fix marking symbol ifuncnobu2015-10-011-2/+1
| | | | | | | | | | * vm_args.c (vm_caller_setup_arg_block): store new ifunc for symbol in control frame proc to be marked. * proc.c (proc_new), vm_insnhelper.c (vm_yield_with_cfunc): block->proc may be an ifunc now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: split rb_call_info_t into several structs.ko12015-09-191-264/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * vm_insnhelper.c (vm_call_iseq_setup_normal): do not clear localko12015-09-121-40/+42
| | | | | | | | | | | | | | variables here. vm_push_frame() clears. * vm_insnhelper.c (vm_call_iseq_setup_tailcall): ditto. * vm_insnhelper.c (vm_push_frame): move check code to vm_check_frame(). Reorder initialization timing to reuse same values (sp). * compile.c (rb_iseq_compile_node): use iseq_set_exception_local_table() for ISEQ_TYPE_DEFINED_GUARD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e