summaryrefslogtreecommitdiff
path: root/vm_exec.c
Commit message (Collapse)AuthorAgeFilesLines
* * vm_core.h: constify rb_iseq_constant_body::iseq_encoded andko12015-07-231-4/+4
| | | | | | | | | | | rb_control_frame_t::pc. * compile.c (rb_iseq_translate_threaded_code): catch up this fix. * iseq.c: ditto. * vm_exec.c (vm_exec_core): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c: improve performance in ppc64 arch.hsbt2014-08-121-0/+8
| | | | | | [ruby-core:63437] [Feature #9997] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c (cfp): Fixes a SEGV issue in r44554.yugui2014-01-141-2/+2
| | | | | | | r11 can be broken by subroutine and sometimes causes SEGV at runtime. Use r13 instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c (cfp): Avoid generating invalid binary foryugui2014-01-101-0/+4
| | | | | | | | | NativeClient. r15 on x86_64 is reserved by NativeClient. So r15 to cfp used to generate invalid binary under some combinations of compiler optimization flags. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.h (VM_DEBUG_STACKOVERFLOW): added.ko12013-12-181-0/+2
| | | | | | | | | disable stack overflow check for every stack pushing as default. * vm_exec.c (vm_stack_overflow_for_insn): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h: extract VM_STACK_OVERFLOWED_Pnobu2013-11-181-0/+9
| | | | | | | | | | | | * vm_core.h (VM_STACK_OVERFLOWED_P, WHEN_VM_STACK_OVERFLOWED): extract condition from CHECK_VM_STACK_OVERFLOW. * vm_exec.c (vm_stack_overflow_for_insn): move rb_bug call. * vm_exec.h (CHECK_VM_STACK_OVERFLOW_FOR_INSN): share the condition with CHECK_VM_STACK_OVERFLOW. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c: Correct predefined macro name. This typo is introduced bynaruse2013-03-181-1/+1
| | | | | | r36534 and should be backported to ruby_2_0_0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c: check VM_COLLECT_USAGE_DETAILS.ko12012-12-031-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c: vm_analysis_insn should be statkc.ko12012-12-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * probes.d: add DTrace probe declarations. [ruby-core:27448]tenderlove2012-11-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * vm_exec.c, insns.def (leave): solve problems onko12012-08-071-15/+15
| | | | | | | | | | | | | OPT_CALL_THREADED_CODE. Catch up finish frame structure on OPT_CALL_THREADED_CODE. * vm_core.h: add rb_thread_t#retval for temporary space on OPT_CALL_THREADED_CODE. * vm.c (th_init): clear rb_thread_t#retval as Qundef. * vm_dump.c (rb_vmdebug_debug_print_pre): fix debug print format. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress warnings.naruse2012-07-251-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: remove VM_FRAME_MAGIC_FINISH (finish frame type).ko12012-06-151-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit: `finish frame' was place holder which indicates that VM loop needs to return function. If a C method calls a Ruby methods (a method written by Ruby), then VM loop will be (re-)invoked. When the Ruby method returns, then also VM loop should be escaped. `finish frame' has only one instruction `finish', which returns VM loop function. VM loop function executes `finish' instruction, then VM loop function returns itself. With such mechanism, `leave' instruction (which returns one frame from current scope) doesn't need to check that this `leave' should also return from VM loop function. Strictly, one branch can be removed from `leave' instructon. Consideration: However, pushing the `finish frame' needs costs because it needs several memory accesses. The number of pushing `finish frame' is greater than I had assumed. Of course, pushing `finish frame' consumes additional control frame. Moreover, recent processors has good branch prediction, with which we can ignore such trivial checking. After this commit: Finally, I decide to remove `finish frame' and `finish' instruction. Some parts of VM depend on `finish frame', so the new frame flag VM_FRAME_FLAG_FINISH is introduced. If this frame should escape from VM function loop, then the result of VM_FRAME_TYPE_FINISH_P(cfp) is true. `leave' instruction checks this flag every time. I measured performance on it. However on my environments, it improves some benchmarks and slows some benchmarks down. Maybe it is because of C compiler optimization parameters. I'll re-visit here if this cause problems. * insns.def (leave, finish): remove finish instruction. * vm.c, vm_eval.c, vm_exec.c, vm_backtrace.c, vm_dump.c: apply above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c: remove conditions for clangnaruse2011-05-311-4/+4
| | | | | | because clang version 3.0 (trunk 132165) doesn't need them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: pcc can't use __builtin_constant_p.naruse2011-04-231-3/+3
| | | | | | * vm_exec.c: change condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c (vm_exec_core): Treat clang as non gcc on thisnaruse2010-10-071-3/+3
| | | | | | context: It has __asm__ but doesn't works well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c (DECL_SC_REG): use __clang__.naruse2009-10-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c (DECL_SC_REG): check defined(__asm__) before use it.naruse2009-10-261-2/+2
| | | | | | LLVM/clang defines __GNUC__ but doesn't have __asm__.. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c: add a prefix "rb_" to exposed functionsko12009-01-191-2/+2
| | | | | | | | | | | | | | | | | vm_get_ruby_level_next_cfp(), rb_vm_make_env_object(), vm_stack_to_heap(), vm_make_proc(), vm_invoke_proc(), vm_get_sourceline(), vm_cref(), vm_localjump_error(), vm_make_jump_tag_but_local_jump(), vm_jump_tag_but_local_jump(). This changes may affect only core because most of renamed functions require a pointer of not-exposed struct such as rb_thread_t or NODE. In short, they are core functions. * cont.c, eval.c, eval_intern.h, load.c, proc.c, thread.c, vm_core.h, vm_dump.c, vm_eval.c, vm_exec.c, vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * README.EXT, README.EXT.ja, vm_exec.c, vm_insnhelper.c: updatemame2008-11-141-1/+1
| | | | | | | filenames. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_exec.c (vm_exec_core): add an UNLIKELY() hint.ko12008-09-281-1/+1
| | | | | | | | * vm_insnhelper.h (BASIC_OP_UNREDEFINED_P): add a LIKELY() hint. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk: clean upko12008-09-231-0/+156
- remove blockinlining.$(OBJEXT) to built - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h) - make VM_CORE_H_INCLUDES variable (vm_core.h) - simplify rules. - make depends rule to output depend status using gcc -MM. * include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h. * include/ruby.h: ditto. * load.c: add inclusion explicitly. * enumerator.c, object.c, parse.y, thread.c, vm_dump.c: remove useless inclusion. * eval_intern.h: cleanup inclusion. * vm_core.h: rb_thread_t should be defined in this file. * vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c. * vm.h, vm_exec.h: rename vm.h to vm_exec.h. * insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h. * vm.c, vm_insnhelper.c, vm_insnhelper.h: - rename vm_eval() to vm_exec_core(). - rename vm_eval_body() to vm_exec(). - cleanup include order. * vm_method.c: fix comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e