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

319 Коммитов

Автор SHA1 Сообщение Дата
ktsj 70189a8cfd * vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-31 02:32:48 +00:00
kosaki 18bc6c31a1 * vm.c (th_init): preallocate alternative stack.
NoMemoryError is better than rb_bug, of course.
  Patch by Eric Wong. [ruby-core:38572][ruby-core:38594].

* signal.c (rb_register_sigaltstack): ditto.

* vm_core.h: moved ALT_STACK_SIZE definition from signal.c.
* vm.c (thread_free): use xfree() instead of free().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-30 01:57:06 +00:00
drbrain 926301969f * math.c: Attach documentation for Math.
* object.c:  Document NIL, TRUE, FALSE.
	* io.c:  Improve grammar in ARGF comment.  Document STDIN/OUT/ERR.
	  Document ARGF global constant.
	* lib/rake:  Hide deprecated toplevel constants from RDoc (import from
	  rake trunk).
	* lib/thwait.rb:  Document ThWait.
	* lib/mathn.rb:  Hide Math redefinition from RDoc
	* lib/sync.rb:  Add a basic comment for Sync_m, Synchronizer_m, Sync,
	  Synchronizer.
	* parse.y:  Document SCRIPT_LINES__.
	* hash.c:  Document ENV class and global constant.
	* vm.c:  Document TOPLEVEL_BINDING.
	* version.c:  Document RUBY_* constants.
	* ruby.c:  Document DATA and ARGV.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-29 03:09:34 +00:00
kosaki ef86308a2c * vm.c, vm_core.h (rb_vm_stack_to_heap): remove const.
It makes compilations warnings.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 12:32:57 +00:00
ko1 4368104146 * vm.c, vm_core.h (rb_vm_stack_to_heap): fix "const" place.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 09:56:01 +00:00
akr 7da3ea811e * method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
  thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
  declare internal functions.

  Note that rb_method_entry_eq() is defined in vm_method.c but
  there was a declaration in proc.c with different const-ness.
  Now it is declared in method.h with same const-ness to the
  definition.

* object.c (rb_mod_module_exec): don't declare functions declared in
  include/ruby/intern.h.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 03:49:33 +00:00
akr afd7e4668f * internal.h: declare more internal functions.
* iseq.h (rb_method_get_iseq): declared.

* compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
  ruby.c, time.c, util.c, vm.c: don't declare internal functions.

* eval.c, parse.y, thread_pthread.c: non-existing function declarations
  removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 01:54:57 +00:00
akr e7996eb3cc * internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.

* iseq.h: declare rb_iseq_t dependent internal functions here.

* vm_core.h: declare rb_thread_t dependent internal functions here.

* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
  enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
  iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
  proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
  thread.c, time.c, transcode.c, variable.c, vm.c,
  tool/compile_prelude.rb: don't declare internal functions declared
  in above headers.  include above headers if required.

  Note that rb_thread_mark() was declared as
  void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
  void rb_thread_mark(void *ptr) in vm.c.  Now it is declared as
  the later in internal.h.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17 22:43:38 +00:00
ko1 038ef3f05c * vm_core.h, vm_insnhelper.h: move decl. of
ruby_vm_global_state_version and related macros
  from vm_core.h to vm_insnhelper.h.
* vm.c (vm_clear_all_cache): added.  This function is called
  when ruby_vm_global_state_version overflows.
  TODO: vm_clear_all_inline_method_cache() is only place holder.
  We need to implement it ASAP.
* vm_method.c (vm_clear_global_method_cache): added.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13 11:25:44 +00:00
kosaki 1485f3c168 * vm.c (thread_memsize): don't ignore size of th->local_storage.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11 05:21:30 +00:00
nagachika 1fdbe0f437 * gc.c (rb_objspace_call_finalizer): use rb_typeddata_is_kind_of() for
type check to get rid of a double free when main Thread has singleton
  class. [ruby-core:36741] [Bug #4828]
* thread.c (rb_obj_is_mutex): add a new utility function.
* vm.c (rb_obj_is_thread): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09 14:45:56 +00:00
kazu c0b0901c7d * vm.c (Init_VM): suppress warning: "OPT_BASIC_OPERATIONS" is not defined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-16 01:23:34 +00:00
nobu 4acc61313f * vm.c (ruby_vm_destruct): run vm exit hooks after all objects are
destructed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-24 13:51:59 +00:00
nobu e7c0a6e1d7 * prevent temporary objects from GC, and should not use
RSTRING_PTR() for function calls since it evaluates the argument
  a couple of times.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-20 07:23:55 +00:00
nobu dda8de065c * vm.c (th_init): rename from th_init2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-12 05:42:17 +00:00
nobu 96c078c340 * eval.c (ruby_cleanup): use rb_ary_free to free internal object.
* gc.h (RUBY_FREE_UNLESS_NULL): get rid of double free.
  [ruby-core:35192]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-11 10:45:34 +00:00
nobu 0958923530 * vm.c (ruby_thread_data_type): add prefix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-04 17:08:44 +00:00
kosaki 034540dbc1 * vm_core.h (GetThreadPtr): use TypedData_Get_Struct() instead
CoreDataFromValue() because we need type check. Otherwise,
	  type mismatch can cause segmentation fault crash.
	  [ruby-core:35086] [Ruby 1.9-Bug#4367]

	* vm.c (thread_data_type): remove static.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-04 16:05:40 +00:00
akr fd2f238560 * vm.c (thread_free): reset ruby_current_thread if it points the
thread to free.
* gc.c (slot_sweep): don't call RUBY_VM_SET_FINALIZER_INTERRUPT if
  there is no current thread.
  [ruby-dev:43000]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-12 10:35:36 +00:00
nobu 69c484784e * vm.c (rb_vm_make_proc): fix indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05 19:52:51 +00:00
wanabe af8df10d3b * vm.c (vm_define_method): guard iseq from GC while method definition.
[ruby-dev:42832]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-30 14:17:32 +00:00
nobu f4db8aedc8 * compile.c (setup_args), vm.c (invoke_block_from_c),
vm_insnhelper.c (caller_setup_args): reverted r30241 and r30243
  except for the test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 21:10:24 +00:00
nobu cd3f980ea2 * compile.c (setup_args), vm.c (invoke_block_from_c),
vm_insnhelper.c (caller_setup_args): fix of r30241. lambda block
  shoud check argument number.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-18 07:02:35 +00:00
shyouhei 9d3ba342c9 * gc.c (rb_objspace_free): With our "lazy-sweep" GC engine, it is
possible for an object to survive until its surrounding object
  space is about to be freed.  Those objects, if any, remains not
  leaked for the rest of a process life.  This is problematic
  because for instance a T_DATA object may have its own destructor
  to terminate something.

* vm.c (ruby_vm_destruct): ruby_current_vm termination should be
  somewhere after rb_objspace_free for above reason.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-03 03:53:21 +00:00
shyouhei 51da92ea12 * vm.c (ruby_vm_at_exit): new API. This enables extension libs to
hook a VM termination.  Right now, because the VM we have is
	  process global, most extensions do not deallocate resources and
	  leave them to Operating System's reaping userland processes.  But
	  in a future we plan to have multiple VMs to run simultaneously in
	  a single process (MVM project).  At that stage we can no longer
	  rely on OSes and have to manage every resources to be reclaimed
	  properly.  So it is.  For a forward-compatibility reason this API
	  is introduced now, encouraging you to be as gentle as you can for
	  your resources; that is, tidy up your room.

	* include/ruby/vm.h: ditto.

	* vm_core.h (rb_vm_struct): new field.

	* vm.c (vm_init2): initialize above new field.

	* eval.c (ruby_cleanup): trigger those hooks.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02 11:06:32 +00:00
ko1 450463d5fb * thread.c, vm_core.h: make gvl_acquire/release/init/destruct
APIs to modularize GVL implementation.
* thread_pthread.c, thread_pthread.h: Two GVL implementations.
  (1) Simple locking GVL which is same as existing GVL.
  (2) Wake-up queued threads.  The wake-up order is simple FIFO.
  (We can make several queues to support exact priorities, however
  this causes some issues such as priority inversion and so on.)
  This impl. prevents spin-loop (*1) caused on SMP environemnts.
  *1: Only one Ruby thread acqures GVL again and again.
  Bug #2359 [ruby-core:26694]
* thread_win32.c, thread_win32.h: Using simple lock
  not by CRITICAL_SECTION but by Mutex.
  Bug #3890 [ruby-dev:42315]
* vm.c (ruby_vm_destruct): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-27 20:15:59 +00:00
nobu 3c575a15c2 * vm.c (rb_thread_mark): should mark self in conrol
frames.  [ruby-core:33289]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-23 09:54:07 +00:00
ko1 f6b2490fdb * gc.c, vm.c, vm_core.h: remove USE_VALUE_CACHE option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-03 01:01:12 +00:00
nobu 23e8deaf0d * array.c, gc.c, hash.c, object.c, string.c, struct.c,
transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c:
  replace calls to rb_error_frozen() with rb_check_frozen().  a
  patch from Run Paint Run Run at [ruby-core:32014]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-24 08:14:05 +00:00
nobu 98ac9b8667 * vm.c (vm_define_method): defined method is run with the default
public visibility regardless the visibility context of definition.
  [ruby-core:30638]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-24 05:11:26 +00:00
nobu 671b498070 Commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19 03:25:29 +00:00
nobu 12cbb58819 * test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19 03:22:03 +00:00
nobu e69bba13a0 * iseq.c (insn_operand_intern, rb_iseq_disasm): fix format specifiers.
* vm.c (thread_free): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13 14:07:22 +00:00
shyouhei 7724d13635 * vm.c (ruby_vm_destruct): This function type was wrong; correct to the prototype.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13 10:28:25 +00:00
nobu d410639a6d * compile.c (iseq_build_body), error.c (set_syserr, get_syserr),
(syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer),
  (run_final), hash.c (rb_hash_aref, rb_hash_lookup2),
  (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i),
  iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink),
  thread.c (rb_thread_local_aref),
  variable.c (generic_ivar_remove, ivar_get, rb_const_get_0),
  (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method),
  vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method),
  ext/iconv/iconv.c (map_charset): use st_data_t.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12 14:47:23 +00:00
naruse e1d5d4e7f2 * enc/unicode.c (onigenc_unicode_property_name_to_ctype):
remove useless assignment.

* vm.c (vm_make_proc_from_block): ditto.

* variable.c (rb_ivar_count): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-03 22:57:23 +00:00
nobu f5b0cb07e2 * string.c (sym_call), vm.c (invoke_block_from_c),
vm_insnhelper.c (vm_yield_with_cfunc): pass given block.
  [ruby-core:32075]

* vm_eval.c (rb_funcall_passing_block): new function to call
  method with passing given block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-24 14:45:19 +00:00
nobu 83a827ac9b * vm.c (vm_backtrace_each): skip allocator frames which have no
name.  [ruby-core:32231]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-09 14:25:56 +00:00
nobu e6f86c982f * vm.c (rb_thread_method_id_and_class): curried proc has no
method.  [ruby-core:31871]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-29 04:22:55 +00:00
naruse 72c811a3d8 * vm.c: add missing prototype of rb_iseq_clone for r29063.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-21 11:10:24 +00:00
wanabe d1b77f5eee * vm.c (vm_define_method): copy iseq to avoid overwriting iseq->klass.
#2502, #3136. see #2420.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-21 10:00:55 +00:00
nobu af4986f515 * vm.c (rb_thread_mark): should mark iseq itself other than normal
iseq.  [ruby-dev:41880]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-26 04:01:38 +00:00
nobu 7d2ed51843 * vm.c (rb_thread_mark): mark only self of normal iseqs, not
nodes.  [ruby-dev:41874]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-26 00:51:33 +00:00
nobu 25b9eb5e57 * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]
add parent member.

* error.c (rb_typeddata_inherited_p): new function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18 07:31:54 +00:00
mame 68ab3ede30 * vm.c (thread_free): free altstack to prevent memory leak. a patch
from Tomoyuki Chikanaga in [ruby-dev:41815]. [Bug #3537]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-05 15:57:20 +00:00
naruse da3cdd2ddf * gc.c (gc_lazy_sweep): clean a warning.
"suggest parentheses around assignment used as truth value"

* transcode_data.h (getGB4bt1): clean a warning.
  "suggest parentheses around arithmetic in operand of |"

* transcode_data.h (getGB4bt3): ditto.

* vm.c (thread_free): clean a warning. "format 'p' expects type
  'void *', but argument 3 has type 'struct rb_mutex_struct *'"

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-18 01:44:52 +00:00
mame 2db572514c * load.c (rb_load_internal): remove call to rb_realpath_internal
within rb_load_internal which caused big performance degradation.
  Instead, call rb_realpath_internal in the caller of
  rb_load_internal.  [ruby-dev:41502] [ruby-dev:41610]

* vm.c (rb_vm_call_cfunc): ditto.

* eval_intern.h (rb_vm_call_cfunc): ditto.

* ruby.c (process_options): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-17 14:32:20 +00:00
akr f40d2c9670 * vm.c (Init_BareVM): call Init_native_thread here.
* thread.c (Init_Thread): don't call Init_native_thread.

* thread_pthread.c (Init_native_thread): exported.

* thread_win32.c (Init_native_thread): ditto.

[ruby-dev:41536]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05 23:26:43 +00:00
nobu 2ef85089ec * ruby.c (process_options): revert r25330, so that $0 can be seen
from required libraries by -r option.  [ruby-core:23717]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05 00:57:02 +00:00
nobu 7336f32c3b * load.c (ruby_init_ext): statically linked extensions have no
real path.  [ruby-dev:41526]

* vm.c (rb_vm_call_cfunc): add filepath argument.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-03 09:58:32 +00:00
nobu 45f6fbf339 * removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29 18:51:39 +00:00
nobu b32e8a5911 * vm.c (vm_backtrace_each), vm_eval.c (rb_catch_obj): suppress
warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-21 03:57:11 +00:00
mame 9219029d3c * vm.c (vm_backtrace_each): now takes an init function to distinguish
an empty stack from out of stack.  [ruby-dev:41366]

* vm_eval.c (print_backtrace, rb_thread_backtrace): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-20 13:07:58 +00:00
mame 80f7f8d07e * compile.c (iseq_compile_each), vm_insnhelper.c (vm_invoke_block,
vm_throw): allow "return" and "yield" even in singleton class
  definition.  based on a patch from wanabe <s.wanabe AT gmail.com>
  for "return".  [ruby-core:21379] [ruby-dev:40975]

* insns.def (defineclass): ditto (straightforwardly push block ptr,
  instead of dfp ptr with special flag).

* vm_core.h (RUBY_VM_CLASS_SPECIAL_P): ditto (no longer needed).

* proc.c (proc_new): ditto (remove handling for special flag).

* bootstraptest/test_jump.rb: add tests for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09 18:21:39 +00:00
ko1 833cade2dc * vm_method.c (rb_unlink_method_entry, rb_sweep_method_entry):
added.  Unlinked method entries are collected to
  vm->unlinked_method_entry_list.  On the GC timing, mark all method
  entries which are on all living threads.  Only non-marked method
  entries are collected.  This hack prevents releasing living method
  entry.
  [Performance Consideration] Since this Method Entry GC (MEGC)
  doesn't occuer frequently, MEGC will not be a performance bottleneck.
  However, to traverse living method entries, every control frame push
  needs to clear cfp->me field.  This will be a performance issue
  (because pushing control frame is occurred frequently).
  Bug #2777 [ruby-dev:40457]
* cont.c (fiber_init): init cfp->me.
* gc.c (garbage_collect): kick rb_sweep_method_entry().
* method.h (rb_method_entry_t): add a mark field.
* vm.c (invoke_block_from_c): set passed me.
* vm.c (rb_thread_mark): mark cfp->me.
* vm_core.h (rb_thread_t): add a field passed_me.
* vm_core.h (rb_vm_t): add a field unlinked_method_entry_list.
* vm_insnhelper.c (vm_push_frame): clear cfp->me at all times.
* vm_insnhelper.c (vm_call_bmethod): pass me.
* bootstraptest/test_method.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-05 17:51:21 +00:00
nobu 584829aa81 * vm.c (vm_backtrace_each): get rid of use of malloc from signal
handler by using ruby_engine_name.  [ruby-core:29497]

* vm_eval.c (print_backtrace): file may be nil when segfaulted in
  very early stage.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-15 05:38:07 +00:00
mame 6ff75042db * compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolute
path field into rb_iseq_t.  The field contains a string representing
  a path to corresponding source file. or nil when the iseq is created
  from -e, stdin, eval, etc.  This field is used for require_relative.
  [ruby-dev:40004]

* load.c (rb_f_require_relative): add C implementation of
  require_relative.

* prelude.rb (require_relative): get rid of Ruby implementation of
  require_relative.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-16 17:40:00 +00:00
matz 1b99a27b11 * vm.c (vm_backtrace_each): use called_id when method definition
structure is already freed.  [ruby-dev:40234] [ruby-core:27959]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-20 16:26:58 +00:00
nobu 50c8982ea8 * vm_insnhelper.c (vm_call_cfunc): removed unused variable.
* vm.c (vm_frametype_name): define only when VMDEBUG.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-17 08:05:42 +00:00
nobu 49f62d73b8 * vm.c (thread_free): fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-12 08:55:24 +00:00
nobu 485c571bf1 * vm.c (vm_exec): reset thread state before restarting vm loop
from catch scope.  [ruby-core:28129], [ruby-core:28143]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-11 08:52:16 +00:00
mame e79ad682da * vm.c (vm_exec): temporarily revert r26628, which causes SEGV when
executing rubyspec.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-10 16:46:39 +00:00
nobu 09205cf2c3 * vm.c (vm_exec): reset thread state before starting vm loop.
[ruby-core:28129]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-09 19:06:39 +00:00
nobu 1b1b5c2bc3 * vm.c (rb_vm_invoke_proc): removed unused variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-30 07:56:50 +00:00
mame b71cab7fa0 * vm.c (rb_vm_invoke_proc): this function must not catch TAG_RETURN
because vm_exec does.  This caused rubyspec error.  [ruby-dev:40158]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-26 11:28:38 +00:00
ko1 618445576f * eval.c, vm.c, vm_eval.c, vm_insnhelper.c: fix issues about
return and c-return trace.  This issue skips (c-)return event
  with global jump such as break or return.  This fix make vm invoke
  hooks at stack rewind timing.  fix [ruby-core:27606] [Bug #2610].
* test/ruby/test_settracefunc.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-24 13:52:32 +00:00
nobu a1d4164257 * thread.c (thread_start_func_2): unlock all locking mutexes
before clean up.  [ruby-core:26877]

* thread.c (rb_thread_atfork): no other threads to be joined.

* vm_core.h (rb_thread_lock_unlock, rb_thread_lock_destroy):
  new functions.

* vm.c (ruby_vm_destruct): unlock and destroy global VM lock.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-23 20:18:36 +00:00
yugui 295bc2fe25 removes the dtrace support. reverts r26239, r26238 and r26235.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-05 05:59:23 +00:00
yugui b80814c339 * gc.c: added UNLIKELY to probes for optimization.
* vm.c: ditto.

* thread.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-04 12:36:46 +00:00
yugui 72b199940d * trace.h: new file. wraps tracing mechanisms.
* 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
2010-01-03 15:36:17 +00:00
naruse 3da3230f0c * encoding.c (Init_Encoding): undef Encoding.new because
a class which is rb_undef_alloc-func-ed can't call new method.
  [ruby-dev:39862]

* vm.c (Init_VM): undef RubyVM.new and RubyVM::Env.new.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-21 10:12:21 +00:00
mame b317738edc * vm.c (ruby_vm_destruct, thread_memsize): fix argument type to make
RUBY_MARK_FREE_DEBUG available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-24 13:33:44 +00:00
nobu 52ebc24487 * vm_insnhelper.c (vm_push_frame): get rid of out-of-bounds
access.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-07 11:59:16 +00:00
naruse 1fe610b588 * vm.c (invoke_block_from_c): return Qnil when its iseq is
SPECIAL CONST. [ruby-core:26335]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-26 20:58:25 +00:00
nobu fe1ce93f52 * compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
  vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
  tool/instruction.rb: fixed types.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 20:58:26 +00:00
nobu f331b5584e * proc.c (proc_binding): allow proc from method. [ruby-core:25589]
* vm.c (collect_local_variables_in_env): block iseq can be NULL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 08:12:12 +00:00
nobu d36c76dc71 * common.mk (eval.o): needs vm.h.
* eval.c (ruby_cleanup): destruct current VM before exit.

* gc.c (rb_objspace_free): free object space.

* vm.c (ruby_vm_destruct): destruct and free VM struct.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-18 07:29:17 +00:00
nobu b46cd0e400 * include/ruby/ruby.h (rb_data_type_struct): constified dsize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09 02:11:35 +00:00
nobu 4fb9d7ffee * vm.c (rb_thread_mark): mark callers iseqs. [ruby-core:25474]
[Bug #2062]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08 12:48:17 +00:00
nobu c95cbc0cc5 * vm.c (sdr, nsdr): nodoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-07 22:32:31 +00:00
ko1 f825d84898 * compile.c (iseq_specialized_instruction), insns.def (opt_size):
optimize #size methods (by specialized instruction).
* id.c, id.h, vm.c, vm_insnhelper.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-06 08:39:57 +00:00
nobu fcf88c1b8d * method.h (rb_method_definition_t): split from rb_method_entry_t
to deal aliases.  [ruby-dev:39165]

* proc.c (struct METHOD): contains rb_method_entry_t copy.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-28 02:45:41 +00:00
nobu b6cf785119 * vm.c (collect_local_variables_in_env): skips internal variables.
[ruby-core:25125]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-26 03:37:08 +00:00
nobu cd48eb8fd5 * vm.c (vm_backtrace_each, vm_backtrace_push),
vm_eval.c (print_backtrace), vm_dump.c (bugreport_backtrace):
  rb_backtrace_iter_func now takes VALUE as file and method names.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-16 01:38:32 +00:00
wanabe c8909ba601 * vm.c (vm_exec): returning from lambda runs ensure section.
[Bug #1729]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-13 12:06:14 +00:00
ko1 8e8e34319b * insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h: check
definition of (classes)#=== for case/when optimization.
  Fix Bug #1376 [ruby-core:23190].
* string.c (Init_String), bignum.c (Init_Bignum),
  numeric.c (Init_Numeric): define String#===, Symbol#===,
  Bignum#===, Fixnum#===, Float#=== as same as (classes)#==.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-12 05:55:06 +00:00
nobu 415d5ebc2f * id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer
used.  [ruby-dev:38760]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16 09:28:12 +00:00
ko1 c330876d7c * method.h, vm_core.h: add rb_method_entry_t. Remove nodes around
method management.  This change affect some VM control stack structure.
* vm.c, vm_insnhelper.c, vm_method.c, vm_eval.c: ditto.  and make some
  refactoring.
* insns.def, class.c, eval.c, proc.c, vm_dump.c : ditto.
* vm_core.h, compile.c (iseq_specialized_instruction): remove
  VM_CALL_SEND_BIT.  use another optimization tech for Kernel#send.
* node.h: remove unused node types.
* ext/objspace/objspace.c (count_nodes): ditto.
* gc.c: add mark/free functions for method entry.
* include/ruby/intern.h: remove decl of
  rb_define_notimplement_method_id().  nobody can use it
  because noex is not opend.
* iseq.c (iseq_mark): fix to check ic_method is available.
* iseq.c (rb_iseq_disasm): fix to use rb_method_get_iseq().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-15 14:59:41 +00:00
ko1 9e60743008 * include/ruby/ruby.h:
rename
  "...TypeStruct" and "typed_struct" to
  "TypedData..." and "typeddata", respectively.
  rename
  rb_data_type_t#name to
  rb_data_type_t#wrap_struct_name.
* error.c, gc.c, iseq.c, vm.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07 20:28:27 +00:00
nobu 74a6cc877c * vm.c ({env,vm,thread}_data_type): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07 06:23:39 +00:00
nobu 877acd03f6 * compile.c (iseq_set_arguments, iseq_compile_each): internal
arrays must be hidden.  [ruby-dev:38613]

* vm.c (Init_top_self): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22 07:14:32 +00:00
ko1 51d174a177 * iseq.c (iseq_memsize): added. Use RTypedData instead of RData
for ISeq.
* vm.c (env_memsize, vm_memsize, thread_memsize): added.  Use
  RTypedData instead of RData for Env, VM, Thread.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16 22:23:53 +00:00
nobu 589ec2beb5 * ruby.c (ruby_script): sets also VM toplevel program name.
* ruby.c (process_options): no longer needs additional frame.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17 05:02:58 +00:00
nobu 52b3bf363a * vm.c (rb_vm_get_sourceline): should not access out of bound.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17 04:15:33 +00:00
nari 57b83a5191 * gc.c: add longlife garbage collection. [ruby-dev:38423]
(NORMAL_HEAPS_USED): new macro.
  (LONGLIFE_ALLOCATE_HEAPS_MIN): ditto.
  (add_longlife_heaps_slot): new function.
  (rb_newobj_from_longlife_heap): ditto.
  (rb_newobj_longlife): ditto.
  (rb_node_newnode_longlife): ditto.
  (rb_gc_write_barrier): ditto.
  (remembered_set_recycle): ditto.
  (rb_gc_mark_remembered_set): ditto.
  (clear_mark_longlife_heaps): ditto.
  (gc_sweep_for_longlife): ditto.
  (assign_heap_slot): new argumnent to longlife heaps slot.
  (add_freelist): ditto.
  (gc_sweep): avoid lonlife heap slot. set longlife_collection
   flag at add heap.
  (rb_gc_force_recycle): avoid mark object and remembered_set
   object.
  (garbage_collect): add longlife collection.
  (rb_gc_start): invoke longlife collection.
  (gc_profile_record_get): for longlife collction profile.
  (gc_profile_result): ditto.

* include/ruby/intern.h (rb_gc_write_barrier): declared.

* include/ruby/ruby.h (FL_REMEMBERED_SET): renamed from FL_RESERVED.

* debug.c (FL_REMEMBERED_SET): ditto.

* insns.def (setinlinecache): insert write barrier.

* vm_insnhelper.c (vm_method_search): ditto.

* set_relation (set_relation): use longlife object.

* vm.c (vm_define_method): ditto.

* vm_core.h (NEW_INLINE_CACHE_ENTRY): ditto.

* vm_method.c (rb_add_method): ditto.

* class.c (rb_add_method): ditto.

* node.h (NEW_NODE_LONGLIFE): new macro.
  (rb_node_newnode_longlife): declared.
					    


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-13 14:08:26 +00:00
nobu 1c6ca1eec5 * vm.c (rb_vm_get_sourceline), vm_insnhelper.c (vm_throw): use
rb_num_t.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-12 09:02:06 +00:00
nobu bca5029d8b * vm.c (vm_backtrace): always returns non-nil array if lev is
negative.  [ruby-core:21795]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 14:13:36 +00:00
nobu a2d8643e93 * vm.c (vm_backtrace_each): progname is not available at
initializing phase.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 00:49:40 +00:00
nobu a7b5c603b4 * vm.c (vm_backtrace_each): now takes an iterator function.
* vm_core.h (rb_make_backtrace, rb_backtrace_each): added
  prototypes.

* vm_dump.c (rb_vm_bugreport), vm_eval.c (rb_backtrace): gets rid
  of allocating objects.

* vm_eval.c (rb_backtrace_each): new function which iterates over
  each backtrace info.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-01 22:36:15 +00:00
ko1 9b520ddcec * vm_eval.c, eval.c (rb_f_block_given_p): move definition of
"iterator?" and "block_given?" to make static.
* vm.c (vm_get_ruby_level_caller_cfp): make it static.
* eval_intern.h, vm_insnhelper.c: move decl. of
  vm_get_ruby_level_caller_cfp()
  from eval_intern.h to vm_insnhelper.c.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 03:03:09 +00:00