summaryrefslogtreecommitdiff
path: root/vm_exec.h
AgeCommit message (Collapse)Author
2013-12-18* vm_exec.h (VM_DEBUG_STACKOVERFLOW): added.ko1
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
2013-11-29 * vm_dump.c (rb_vmdebug_debug_print_pre): Bugfix. Get PC directly.tarui
PC is cached into local stack and cfp->pc is incorrent at next of branch or jump. * vm_exec.h (DEBUG_ENTER_INSN): catch up this change. * vm_core.h: update signature of rb_vmdebug_debug_print_pre. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-18vm_core.h: extract VM_STACK_OVERFLOWED_Pnobu
* 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
2013-07-26vm_exec.h: fix CHECK_VM_STACK_OVERFLOW_FOR_INSNnobu
* vm_exec.h (CHECK_VM_STACK_OVERFLOW_FOR_INSN): surround with do/while (0), and remove unnecessary casts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26* vm_exec.h, tool/instruction.rb: not an error, but a BUG if stackko1
overflow checking failed just before/after the beginning of an instruction. It should be treated as a BUG. Please tell us if your code cause BUG with this problem. This check will removed soon (for performance). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-22fix minor code comment typostmm1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-18* vm_exec.h (END_INSN): revert r39517 because the segv seems fixed bynaruse
r39806. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-27* vm_exec.h (END_INSN): llvm-gcc may optimize out reg_cfp and causenaruse
Stack/cfp consistency error when the instruction doesn't use reg_cfp. Usually instructions use PUSH() but for example trace doesn't. This hack cause speed down but you shouldn't use llvm-gcc, use clang. [Bug #7938] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-10vm_exec.h: fix typonobu
* vm_exec.h (DISPATCH_ARCH_DEPEND_WAY): fix typo. probably "inserted" or "insetted". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-10* vm_exec.h (DISPATCH_ARCH_DEPEND_WAY): use __asm__ __vilatile__kosaki
instead of asm volatile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-29adjust stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-15* vm_exec.h (GENTRY): GENTRY should be pointer size.ko1
A patch by yoshidam (Yoshida Masato) [Bug #7332]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-04* insns.def (getlocal, setlocal): remove old getlocal/setlocalko1
instructions and rename getdaynmic/setdynamic instructions to getlocal/setlocal. * compile.c: ditto. * iseq.c: remove TS_DINDEX. * vm_exec.h (dindex_t): remove type definition of `dindex_t'. * tool/instruction.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-04* vm.c (VM_COLLECT_USAGE_DETAILS): make new VM usage analysisko1
hooks (old macro name is COLLECT_USAGE_ANALYSIS). This feature is only for VM developers. (I'm not sure I can use `VM developers' (the plural form) in this sentence). If VM_COLLECT_USAGE_DETAILS is not 0, VM enables the following usage collection features: (1) insntruction: collect intruction usages. (2) operand: collect operand usages. (3) register: collect register usages. The results are stored in RubyVM::USAGE_ANALYSIS_INSN for (1, 2), RubyVM::USAGE_ANALYSIS_INSN_BIGRAM for (1) and RubyVM::USAGE_ANALYSIS_REGS for (3). You can stop collecting usages with RubyVM::USAGE_ANALYSIS_INSN_STOP(), RubyVM::USAGE_ANALYSIS_OPERAND_STOP(), RubyVM::USAGE_ANALYSIS_REGISTER_STOP() for (1), (2), (3) respectively. You can also change the hook functions by setting C level global variables `ruby_vm_collect_usage_func_(insn|operand|register)' for (1), (2), (3) respectively. See codes for more details. * tool/instruction.rb: fix macro names. * iseq.c (insn_operand_intern): make it export (used in vm.c). fix to skip several processes if not needed (pointer is 0). * vm_dump.c: move codes for collection features to vm.c. * vm_exec.h: rename macro and function names. * vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-25Suppress warnings.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11* vm_core.h: remove lfp (local frame pointer) and renameko1
dfp (dynamic frame pointer) to ep (environment pointer). This change make VM `normal' (similar to other interpreters). Before this commit: Each frame has two env pointers lfp and dfp. lfp points local environment which is method/class/toplevel frame. lfp[0] is block pointer. dfp is block local frame. dfp[0] points previous (parent) environment pointer. lfp == dfp when frame is method/class/toplevel. You can get lfp from dfp by traversing previous environment pointers. After this commit: Each frame has only `ep' to point respective enviornoment. If there is parent environment, then ep[0] points parent envioenment (as dfp). If there are no more environment, then ep[0] points block pointer (as lfp). We call such ep as `LEP' (local EP). We add some macros to get LEP and to detect LEP or not. In short, we replace dfp and lfp with ep and LEP. rb_block_t and rb_binding_t member `lfp' and `dfp' are removed and member `ep' is added. rename rb_thread_t's member `local_lfp' and `local_svar' to `root_lep' and `root_svar'. (VM_EP_PREV_EP(ep)): get previous environment pointer. This macro assume that ep is not LEP. (VM_EP_BLOCK_PTR(ep)): get block pointer. This macro assume that ep is LEP. (VM_EP_LEP_P(ep)): detect ep is LEP or not. (VM_ENVVAL_BLOCK_PTR(ptr)): make block pointer. (VM_ENVVAL_BLOCK_PTR_P(v)): detect v is block pointer. (VM_ENVVAL_PREV_EP_PTR(ptr)): make prev environment pointer. (VM_ENVVAL_PREV_EP_PTR_P(v)): detect v is prev env pointer. * vm.c: apply above changes. (VM_EP_LEP(ep)): get LEP. (VM_CF_LEP(cfp)): get LEP of cfp->ep. (VM_CF_PREV_EP(cfp)): utility function VM_EP_PREV_EP(cfp->ep). (VM_CF_BLOCK_PTR(cfp)): utility function VM_EP_BLOCK_PTR(cfp->ep). * vm.c, vm_eval.c, vm_insnhelper.c, vm_insnhelper.h, insns.def: apply above changes. * cont.c: ditto. * eval.c, eval_intern.h: ditto. * proc.c: ditto. * thread.c: ditto. * vm_dump.c: ditto. * vm_exec.h: fix function name (on vm debug mode). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-23* vm_exec.h: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* configure.in (RUBY_CHECK_PRINTF_PREFIX): check for printf formatnobu
specifier if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29468 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-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-01-19* vm_dump.c: add a prefix "rb_vmdebug_" toko1
vm_stack_dump_raw(), vm_stack_dump_raw_current(), vm_env_dump_raw(), vm_proc_dump_raw(), vm_stack_dump_th(), vm_debug_print_register(), vm_thread_dump_regs(), vm_debug_print_pre(), vm_debug_print_post(), vm_thread_dump_state(). This change also may affect core (in fact, user of above functions may be only ko1). * vm_core.h: ditto. * vm_exec.h (SDR2): remove duplicate definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-19* vm_exec.h (RUBY_VM_EXEC_H): fixed include guard.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* common.mk: clean upko1
- 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