Граф коммитов

13 Коммитов

Автор SHA1 Сообщение Дата
tenderlove 4c740bae97 * probes.d: add DTrace probe declarations. [ruby-core:27448]
* 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-11-12 21:52:12 +00:00
ko1 0d1a905edb * vm_exec.c, insns.def (leave): solve problems on
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
2012-08-07 11:13:57 +00:00
naruse 131f694330 Suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-25 06:49:35 +00:00
ko1 745c23b2d9 * vm_core.h: remove VM_FRAME_MAGIC_FINISH (finish frame type).
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
2012-06-15 10:22:34 +00:00
naruse 70c97ec805 * vm_exec.c: remove conditions for clang
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
2011-05-31 02:08:58 +00:00
naruse 60aa9c809b * include/ruby/intern.h: pcc can't use __builtin_constant_p.
* vm_exec.c: change condition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-23 17:34:58 +00:00
naruse fba68f4c31 * vm_exec.c (vm_exec_core): Treat clang as non gcc on this
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
2010-10-07 00:48:03 +00:00
naruse 404ed4f8d4 * vm_exec.c (DECL_SC_REG): use __clang__.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-27 00:29:06 +00:00
naruse 2215293a66 * vm_exec.c (DECL_SC_REG): check defined(__asm__) before use it.
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
2009-10-26 20:14:16 +00:00
ko1 cf23d0f0f0 * vm.c: add a prefix "rb_" to exposed functions
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
2009-01-19 02:38:11 +00:00
mame e1a2fec2bb * README.EXT, README.EXT.ja, vm_exec.c, vm_insnhelper.c: update
filenames.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-14 11:31:10 +00:00
ko1 574027ba03 * vm_exec.c (vm_exec_core): add an UNLIKELY() hint.
* 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
2008-09-28 07:13:06 +00:00
ko1 8cd252ac6f * common.mk: clean up
- 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
2008-09-23 00:20:28 +00:00