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

319 Коммитов

Автор SHA1 Сообщение Дата
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
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
ko1 c4c3f238d7 * iseq.c:
rename ruby_iseq_disasm_insn() -> rb_iseq_disasm_insn().
  rename ruby_iseq_disasm() -> rb_iseq_disasm().
* compile.c:
  rename ruby_iseq_compile() -> rb_iseq_compile_node().
  rename ruby_iseq_translate_threaded_code() ->
  rb_iseq_translate_threaded_code().
  rename ruby_insns_name_array() -> rb_insns_name_array().
  rename ruby_iseq_build_from_ary() -> rb_iseq_build_from_ary().
* iseq.c, compile.c: remove ruby_insn_make_insn_table() and make
  static function insn_make_insn_table().
* iseq.h, ruby.c, vm.c, vm_core.h, vm_eval.c, vm_dump.c,
  blockinlining.c: ditto.
  Rename strange "ruby_" prefix to "rb_" prefix.
  This changes may affect only core because renamed functions
  require a pointer of rb_iseq_t which is not exposed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 01:06:56 +00:00
ko1 4316e4d99b * eval.c, vm_eval.c (rb_f_local_variables): move definition from eval.c
to vm_eval.c because vm_collect_local_variables_in_heap() should
  be static function.
* vm.c (vm_collect_local_variables_in_heap): make it static.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 00:13:44 +00:00
ko1 a3a45fafa3 * vm.c (rb_vm_inc_const_missing_count, ruby_vm_const_missing_count):
added.
* vm_insnhelper.h: ditto.
* variable.c (rb_const_get_0), insns.def: Constants should not be
  cached if const_missing is called.  [ruby-core:21059] [Bug #967]
* bootstraptest/test_class.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 15:31:43 +00:00
nobu 8dee58d7e1 * vm.c (rb_iseq_eval): fixed indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-05 09:54:47 +00:00
ko1 272a3aa6a2 * vm.c (vm_set_eval_stack, vm_set_main_stack, vm_set_top_stack):
check stack overflow.  [ruby-dev:37646]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 07:44:56 +00:00
ko1 597220ef0c * vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.
* vm.c (vm_set_main_stack, rb_iseq_eval_main): added.
* parse.y (rb_parser_compile_file): fix to check parse_in_eval flag.
* eval.c (ruby_exec_node): use rb_iseq_eval_main()
  instead of rb_iseq_eval().
* iseq.c (rb_iseq_new_main), vm_core.h: added.
  main script (specified by -e or script name) should be run
  under TOPLEVEL_BINDING using Kernel#eval.  Above changes
  simulate Kernel#eval behaviour.  [ruby-dev:37240]
* compile.c (make_name_for_block): skip iseq except block type.
  this fix is needed for [ruby-dev:37240], and also fixes
  [ruby-dev:35392].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 01:15:56 +00:00
ko1 7c982059ea * proc.c (proc_new): should use proc_dup() if block has Proc.
* vm.c (vm_make_proc_from_block): should use rb_cProc for block.
* vm.c (vm_make_proc): add an assertion.
* bootstraptest/test_proc.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-25 03:51:35 +00:00
ko1 f23e8d87c0 * vm.c (invoke_block_from_c): fix to point right cfp.
* vm.c (vm_make_proc, vm_make_proc_from_block), vm_core.h:
  remove unused parameter cfp.
* vm_insnhelper.c, proc.c (proc_new): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-24 12:56:58 +00:00
nobu 94fc275e16 * vm.c (vm_backtrace): defaults to script name for C functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15 02:35:29 +00:00
nobu 541915b239 * compile.c (iseq_compile_each), gc.c (assign_heap_slot),
(gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add),
  proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all),
  (thread_start_func_2, blocking_region_begin, blocking_region_end),
  (rb_thread_kill), thread_pthread.c (native_thread_create),
  (ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c
  (vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state),
  (vm_call0): use void pointer for %p.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09 04:33:55 +00:00
nobu 794eb7bc49 * compile.c (ruby_iseq_compile, ruby_iseq_translate_threaded_code),
(ruby_insns_name_array, ruby_iseq_build_from_ary): prefixed with
  ruby_.

* iseq.c (ruby_iseq_load, ruby_insn_make_insn_table): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05 03:35:48 +00:00
matz 3cdd85813c * vm.c (thread_free): th->vm may be NULL when pthread_create
failed for ENOMEM.  [ruby-dev:37095]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-21 11:46:14 +00:00
ko1 7215c9af95 * vm.c, vm_insnhelper.h (ruby_vm_redefined_flag): apply optimization
patch proposed by Paul Brannan.  [ruby-core:19171]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-12 03:28:49 +00:00
nobu 655685612e * vm.c (vm_jump_tag_but_local_jump): exc is not used if val is nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-26 18:15:54 +00:00
ko1 2e311f6bd5 * include/ruby/node.h, node.h: move node.h from include path.
This change stop to install node.h beacuase of saving ABI
  (node.h will be changed. Extensions should not depends on
  this file).
* blockinlining.c, class.c, compile.c, debug.h, enum.c,
  gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c,
  vm.c, vm_core.h, vm_dump.c: ditto.
* ext/ripper/depend: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 19:52:31 +00:00
ko1 7f7834abf7 * include/ruby/node.h, vm_core.h: move definition of
RUBY_VM_METHOD_NODE to node.h.
* class.c, common.mk: remove useless inclusion.
* compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h.
  move some definitions from vm_core.h to iseq.h.
* compile.c, iseq.c, vm.c: ditto.
* eval.c, compile.c: move some functions for parser
  from eval.c to compile.c.
* eval_intern.h, vm_core.h: move va_init_list() macro to
  vm_core.h.
* iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added.
* load.c, ruby.c: use rb_iseq_new_top() instead of
  rb_iseq_new() with ISEQ_TYPE_TOP constant directly.
* proc.c: use rb_iseq_first_lineno() instead of accessing
  iseq structure.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 07:49:45 +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
ko1 69029b90fe * gc.c, include/ruby/ruby.h: rename rb_register_mark_object()
to rb_gc_register_mark_object().
* eval.c, vm.c: initialize vm->mark_object_ary at
  Init_top_self().
* bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c,
  io.c, load.c, marshal.c, rational.c, ruby.c, vm.c:
  use rb_gc_register_mark_object() instead of
  rb_global_variable() or rb_gc_register_address().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15 14:59:14 +00:00
akr 933eb07996 * vm.c (rb_mRubyVMFrozenCore): registered for GC.
* re.c (rb_reg_preprocess_dregexp): fix GC problem on MacOS X with
  powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc.
  build 5367).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-08 09:14:59 +00:00
ko1 d803c45234 * vm.c (thread_recycle_stack_slot, thread_recycle_stack_count):
make it static.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 17:58:53 +00:00
nobu 1633eb7238 * vm.c (rb_vm_mark): commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 04:37:25 +00:00
nobu c5bf9ceef6 * vm_core.h (struct rb_vm_struct): replaced signal staff with trap
staff.

* signal.c (signal_buff): per process resouce now.

* signal.c (trap_list): moved to VM.

* signal.c (rb_get_next_signal): reverted.

* signal.c (rb_trap_exit): trap_pending_list was no longer used.

* thread.c (timer_thread_function): delivers buffered per-process
  signals to each VMs.

* vm.c (rb_vm_mark): marks trap_list.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 04:22:04 +00:00
nobu 9286180079 * proc.c (proc_new): use the given class.
* vm.c (vm_make_proc): added an argument for the class.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 13:28:18 +00:00
nobu 3f3a0fcc8e * vm.c (Init_VM): get rid of SEGV in a trace proc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-15 06:30:43 +00:00
nobu 0c18a4b0f0 * vm.c (REWIND_CFP): get rid of statement expressions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 05:55:04 +00:00
nobu 86cd6d2e98 * vm.c (Init_VM): hide FrozenCore.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 05:14:01 +00:00
ko1 cc77f676f4 * vm.c: rewind cfp to show proper backtrace.
[ruby-dev:35820]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 04:49:37 +00:00
ko1 596eecd76d * vm.c, vm_insnhelper.c (vm_define_method): move
function place.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 09:59:06 +00:00
mame 893009f8b8 * vm.c (Init_BareVM): check failure of malloc().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-01 12:30:25 +00:00
mame d76ab40bea * vm_core.h, thread.c: It is now prohibited to use Data_Get_Struct in
*_free against an object that is going to be free'ed.  So, change type
  of thread_t#keeping_mutexes from VALUE to mutex_t.

* vm.c: remove mark to keeping_mutexes.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-27 15:20:01 +00:00
ko1 60be3dc560 * include/ruby/ruby.h: add a type T_DEFERRED.
* gc.c: fix deferred finalizer system.  finalize processes of
  T_DATA and T_FILE are executed after gc process.
  And fix to use BUILTIN_TYPE() instead of seeing flag.
* thread.c, vm_core.h: add RUBY_VM_SET_FINALIZER_INTERRUPT()
  and check intterupt_flag at rb_thread_execute_interrupts().
* thread.c (mutex_mark): fix to mark next_mutex.
* vm.c (rb_thread_mark): fix to mark keeping_mutexes.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-27 05:59:32 +00:00
ko1 7c8ad088f5 * vm.c (vm_invoke_proc): skip setting safe_level if
it from bmethod.  This change makes test/ruby/test_proc.rb pass.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-25 06:56:23 +00:00
nobu 1a5f1a8c69 * vm_core.h (rb_thread_t), vm.c (rb_thread_mark), process.c
(rb_last_status_get, rb_last_status_set, rb_last_status_clear):
  moved last_status from rb_vm_t.  [ruby-dev:35414]

* vm.c (th_init2): initialize last_status with nil.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10 03:10:00 +00:00
mame 91c07a5ac6 * thread.c (rb_set_coverages, rb_reset_coverages): enable and disable
coverage measurement.

* thread.c (rb_get_coverages): rename and move from vm.c.

* vm.c (rb_vm_get_coverages): ditto.

* iseq.c (prepare_iseq_build): ditto.

* thread.c (clear_coverage): ditto.

* parse.y (coverage): ditto.

* ext/coverage/coverage.c: use above functions, add new method
  Coverage.start and fix rdoc .


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08 15:13:22 +00:00
mame 92afa05222 * vm.c (rb_vm_mark): mark the last element of special_exceptions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08 12:45:50 +00:00
mame ae3a03eb07 * include/ruby/intern.h: remove prototypes about coverage.
* iseq.c (prepare_iseq_build): add prototype.

* parse.y (coverage): ditto.

* thread.c (clear_coverage): ditto.

* thread.c (update_coverage): use rb_sourceline.

* thread.c (rb_get_coverages): rename and move to vm.c.

* vm.c (rb_vm_get_coverages): ditto.

* ext/coverage/coverage.c: add rdoc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-03 14:27:43 +00:00
mame f08581c7b6 * ext/coverage/coverage.c, ext/coverage/extconf.rb: eliminate
COVERAGE__ and introduce coverage.so instead.  How to measure
  coverage: (1) require "coverage.so", (2) require or load Ruby source
  file, and (3) Coverage.result will return the same hash as COVERAGE__.
  [ruby-dev:35324]

* thread.c (rb_enable_coverages): start coverage measurement by using
  rb_add_event_hook.

* thread.c (rb_get_coverages): returns current results of coverage
  measurement.

* include/ruby/intern.h: add prototype for above two functions.

* vm_core.h, vm.c: add field of coverages to rb_vm_t.

* insns.def (trace): remove special handling for COVERAGE__.

* iseq.c (prepare_iseq_build): switch COVERAGE__ to
  rb_get_coverages().

* parse.y (coverage): ditto.

* thread.c (clear_coverage): ditto.

* lib/coverage.rb: use coverage.so instead of COVERAGE__.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-03 12:55:12 +00:00
ko1 ab109c36f1 * proc.c, vm.c: fix to refer next ruby level cfp to make binding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01 17:11:35 +00:00
ko1 807fbd6940 * compile.c, vm.c, insns.def: call FrozenCore.set_postexe method
instead to use "postexe" insn.
* id.c, id.h: add a prepared id for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01 12:19:00 +00:00
ko1 eb33f91cb7 * compile.c, insns.def, vm.c, vm_core.h: remove some insns
(undef, alias, definemethod).
  Call RubyVM::FrozenCore's singleton method instead.
  Add "putiseq" and "putspecialobject" instructions.
* id.c, id.h: add ids for above.
* tool/parse.rb: "VM" no longer exists.  Use RubyVM instead.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01 03:05:58 +00:00
ko1 9ebf6473eb * vm.c, vm_core.h,vm_core.h, vm_dump.c, iseq.c: rename class name
VM -> RubyVM, and rename rb_cVM -> rb_cRubyVM.
  "VM" is too short name for class.
* test/ruby/test_method.rb, test/ruby/test_settracefunc.rb: ditto.
* include/ruby/ruby.h: rb_cRubyVM, rb_cEnv, rb_cISeq should not be
  exposed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 17:26:16 +00:00
nobu 7a6cafc88e * vm.c (vm_eval_body): if thrown exception is frozen, reraise it to
create a new instance.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-27 05:25:54 +00:00
ko1 00e4fd42f3 * vm.c, vm_insnhelper.c: fix escape process with "braek" and "return"
syntax in "lambda".  [ ruby-Bugs-19304 ], [ruby-core:17164]
* KNOWNBUGS.rb, bootstraptest/test_proc.rb: add/move solved test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-17 19:27:24 +00:00
nobu 9b45b336ee * vm_core.h (rb_vm_t), vm.c (rb_vm_mark): moved preallocated special
exceptions.

* eval.c (Init_eval), gc.c (Init_GC), proc.c (Init_Proc): freeze
  preallocated special exceptions.

* eval.c (rb_longjmp): duplicate the thrown exception to set backtrace
  if it was frozen.

* gc.c (rb_memerror): raise nomem_error without backtrace if failed to
  make backtrace.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-15 09:17:06 +00:00
nobu fc3c60f608 * gc.h (STACK_UPPER): moved from gc.c
* thread.c, thread_{pthread,win32}.c (ruby_init_stack,
  ruby_thread_init_stack): moved stack initialization from gc.c.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-14 02:59:19 +00:00
mame 6f5aaff73b * thread.c, vm_core.h, vm.c, thread_pthread.c, thread_win32.c: add
deadlock detection.  [ruby-dev:35044]

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


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-12 13:01:38 +00:00
ko1 9e324fdd3e * vm.c, eval_intern.h (PASS_PASSED_BLOCK):
set a VM_FRAME_FLAG_PASSED flag to skip this frame when
  searching ruby-level-cfp.
* eval.c, eval_intern.h, proc.c: fix to check cfp.  if there is
  no valid ruby-level-cfp, cause RuntimeError exception.
  [ruby-dev:34128]
* vm_core.h, vm_evalbody.c, vm.c, vm_dump.c, vm_insnhelper.c,
  insns.def: rename FRAME_MAGIC_* to VM_FRAME_MAGIC_*.
* KNOWNBUGS.rb, bootstraptest/test*.rb: move solved bugs.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10 21:46:43 +00:00
mame f2400eca0b * include/ruby/ruby.h, vm_core.h: add a type rb_blockptr.
* vm_insnhelper.c (vm_yield_with_cfunc): vm_yield_with_cfunc receives
  blockptr and passes it to iterating block.

* proc.c (rb_proc_call), include/ruby/intern.h: rb_proc_call receives
  blockptr.  "rb_proc_call(self, args, blockptr)" in C corresponds to
  "self.call(*args, &block)" in Ruby.

* proc.c (proc_call): pass blockptr to block that is written in C.

* proc.c (curry): receive blockptr and pass it to original proc.
  [ruby-core:15551]

* vm.c (invoke_block_from_c): fix for change of vm_yield_with_cfunc.

* thread.c (call_trace_proc), eval_jump.c (rb_call_end_proc): fix for
  change of rb_proc_call.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 15:52:51 +00:00
nobu 5a647a3f5f * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.
* *.c: no cache in init functions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 09:25:32 +00:00
nobu 6cdc89332e * vm_core.h (struct rb_vm_struct): moved ruby_debug, ruby_verbose, and
rb_progname.

* ruby.c (rb_argv0): no longer used.

* vm.c: getters/setters for ruby_{debug,verbose}.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 05:18:03 +00:00
nobu 9fb521515d * vm_core.h (struct rb_vm_struct): moved src_encoding_index.
* ruby.c (struct cmdline_options): moved setids and req_list, and the
  latter is now an array, to prevent memory leak.

* ruby.c (cmdline_options_init): added.

* ruby.c (add_modules, require_libraries, init_ids, forbid_setid): use
  struct cmdline_options.

* vm.c (vm_init2): initialize src_encoding_index.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 04:20:07 +00:00
nobu efe5422e6a * vm.c (rb_thread_recycle_stack_release): reduce redundant code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 02:58:23 +00:00
wanabe ddf83922a2 * vm_insnhelper.c, vm.c, proc.c : revert r17021. [ruby-dev:34997]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08 23:16:46 +00:00
wanabe a5fdfa5884 * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with
block that both is written in C. [ruby-dev:34273] [ruby-core:15551]

*  proc.c (curry): use proc_call instead of rb_proc_call.
  [ruby-dev:34273] [ruby-core:15551]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08 13:24:13 +00:00
ko1 72ba13aa8e * array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c,
  io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c,
  string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c,
  vm.c, gc.c:
  allocated memory objects by xmalloc (ruby_xmalloc) should be
  freed by xfree (ruby_xfree).
* ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c,
  ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c,
  ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c,
  ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c,
  ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c:
  ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08 10:01:40 +00:00
mame 5e9b9ff9cb * gc.c (rb_objspace_alloc): this function is needed only when
ENABLE_VM_OBJSPACE macro is defined.

* vm.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-05 14:41:41 +00:00
nobu 7c5e3348f7 * suppress warnings on cygwin, mingw and mswin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01 19:55:25 +00:00
ko1 59c061235f * eval_method.c: renamed from vm_method.c. "vm_method.c" is included
by "vm.c".
* vm_eval.c: added.  Some codes are moved from "eval.c"
* common.mk: fix for above changes.
* compile.c: make a vm_eval(0)
* eval.c, eval_error.c, eval_intern.h, eval_jump.c, proc.c, vm.c,
  id.c, id.h, vm_core.h, vm_dump.c, vm_evalbody.c, vm_insnhelper.c,
  blockinlining.c: fix for above changes.  and do some refactoring.
  this changes improve rb_yield() performance.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-24 17:50:17 +00:00
mame 956dead480 * compile.c (iseq_set_exception_table, NODE_WHILE, NODE_NEXT): remove
special handling that decrements sp in CATCH_TYPE_NEXT for NODE_WHILE.

* vm.c (vm_eval_body), vm_insnhelper.c (vm_throw): remove unused code.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-24 06:29:48 +00:00
ko1 a45cd8a01c * eval.c, eval_intern.h, include/ruby/intern.h, include/ruby/ruby.h,
vm.c, vm_core.h, vm_insnhelper.c: remove pointless "const".



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 16:19:14 +00:00
nobu 6f04138f75 * vm.c (sdr, nsdr): define methods only if VMDEBUG is defined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 10:01:32 +00:00
nobu 571883a217 * vm.c (vm_get_ruby_level_cfp): moved from eval_intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 09:55:36 +00:00
usa 477c0db2bd * eval_intern.h, vm_core.h, include/ruby/intern.h, include/ruby/ruby.h,
vm.c: need to add const to prototypes, of course.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 06:22:41 +00:00
ko1 559d021d20 * eval.c, vm.c, vm_core.h, vm_insnhelper.c: specify "const".
* vm_opts.h: add a OPT_TOKEN_THREADED_CODE macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 04:28:13 +00:00
ko1 b001dbad6e * vm.c (invoke_block_from_c): fix call flow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-19 14:36:13 +00:00
ko1 385f0e8af6 * vm.c, insns.def, eval.c, vm_insnhelper.c: fix CREF handling.
VM value stack frame of block contains cref information.
  (dfp[-1] points CREF)
* compile.c, eval_intern.h, eval_method.c, load.c, proc.c,
  vm_dump.h, vm_core.h: ditto.
* include/ruby/ruby.h, gc.c: remove T_VALUES because of above
  changes.
* bootstraptest/test_eval.rb, test_knownbug.rb: move solved test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-19 03:08:50 +00:00
yugui 9aceaa1129 * vm.c (Init_VM): removed the definition of Thread#initialize,
which is overwritten in Init_Thread and is never used.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-17 09:14:24 +00:00
mame 18e46b81ff * vm.c (collect_local_variables_in_env): remove unnecessary check
which causes: x=1;proc{local_variables}.call #=> []

* test/ruby/test_variable.rb: add a test for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12 14:42:17 +00:00
akr 332529d45a * vm.c (env_mark): mark env->block.self. prevent SEGV when GC occur
in prepare_iseq_build with gcc version 3.4.6 [FreeBSD] 20060305 on
  FreeBSD/amd64.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-10 03:00:56 +00:00
nobu 6aa73e6cab * vm.c (rb_thread_mark): mark stat_insn_usage only when ptr is not
null.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-08 04:19:20 +00:00
nobu 42981462c9 * vm.c (vm_eval_body): initialize retval. [ruby-dev:34576]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07 08:41:16 +00:00
nobu 01b773a093 * load.c (rb_load_path), vm_core.h (rb_vm_t): moved to VM.
* load.c (rb_get_load_path): returns absolute load path.

* load.c (load_path_getter): $LOAD_PATH getter.

* file.c (rb_find_file_ext, rb_find_file), ruby.c (push_include,
  ruby_init_loadpath): use the accessor.

* vm.c (rb_vm_mark): mark load_path.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-30 09:03:03 +00:00
nobu 09007ccbaa * vm_core.h (rb_vm_t), gc.c (rb_objspace, rb_newobj), vm.c
(Init_BareVM): per-VM object space support, which is disabled now.

* gc.c (rb_objspace_alloc), vm.c (Init_BareVM): should not use ruby
  malloc here.

* gc.c (garbage_collect, etc): performance improvement by passing the
  reference instead of refering the global variable in each functions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-27 03:20:35 +00:00
matz a4d6f2265a * include/ruby/node.h: add new constants for rb_call()'s scope.
* eval.c (iterate_method): use CALL_* scope constant to specify
  proper scope value.

* eval.c (rb_each, rb_apply, rb_funcall, rb_funcall2, rb_funcall3):
  ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-01 21:30:36 +00:00
matz eb1f89015e * eval.c (rb_f_local_variables): local_variables should return an
array of symbols.  [ruby-dev:34008]

* vm.c (collect_local_variables_in_env): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-10 15:48:35 +00:00
mame 03a4a0f1d2 * vm.c (rb_call_super): pass a passed block when super is called via
rb_call_super.  [ruby-dev:33598]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-05 12:58:50 +00:00
akr 6cdef2dc7e * $Date$ keyword removed to avoid inclusion of locale dependent
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 15:49:38 +00:00
ko1 36df55c6e4 * iseq.c: all methods need $SAFE < 1.
vm.c: comment out debug functions.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 09:43:23 +00:00
shugo 8e4c6d8482 * vm.c (rb_frame_method_id_and_class): new function to get the
method id and class of the current frame.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 08:49:09 +00:00
ko1 b90e7414ce * vm.c (Init_VM): remove unused code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 03:44:53 +00:00
ko1 b40dbc304e * vm.c: check frame is FINAL when creating env.
[ruby-core:14395]
* bootstraptest/test_block.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 02:14:36 +00:00
ko1 a79ce52e08 * vm.c: add dummy toplevel frame.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 21:18:47 +00:00
ko1 95ca3f72a8 * compile.c (iseq_compile): clear local table if node == 0.
a patch from Yusuke ENDOH <mame AT tsg.ne.jp>
* vm.c: clear VM stack.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 20:27:10 +00:00
matz 6ca558d6ab * proc.c (method_name): preserve Symbol's encoding.
* numeric.c (fix_id2name): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 16:38:44 +00:00
nobu 4542f21a42 * proc.c (rb_proc_new), vm.c (invoke_block): removed u3.state magic.
[ruby-core:14310]

* test/ruby/test_symbol.rb (test_to_proc): a test from Frederick
  Cheung <frederick.cheung AT gmail.com>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 04:55:37 +00:00
ko1 2a564dfb94 * vm.c, vm_dump.c: fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21 02:48:14 +00:00
akr 4cf437519f * regerror.c, string.c, io.c, lib/getoptlong.rb, lib/net/imap.rb,
compile.c, sprintf.c, parse.y, ext/win32ole/win32ole.c,
  ext/tk/sample/demos-en/entry3.rb, ext/tk/lib/tcltk.rb,
  ext/openssl/ossl_bn.c, numeric.c, vm.c,
  benchmark/bm_so_meteor_contest.rb, bignum.c, ruby.c: don't "illegal"
  for non law violation context.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21 02:31:11 +00:00
ko1 c334a09f7a * common.mk, *.ci: renamed to *.c.
* eval_laod.c: renamed to load.c.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20 09:29:46 +00:00
ko1 314bef7ef1 * insnhelper.ci, vm.c, vm_core.h: change interface of
vm_invoke_block() to specify block ptr.  [ruby-talk:266422]
* cont.c, eval_jump.ci, insns.def, proc.c, signal.c, thread.c:
  apply above change.
* bootstraptest/test_knownbug.rb: move fixed bug.
* bootstraptest/test_block.rb: ditto. and add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20 07:07:35 +00:00
ko1 192ec21adf * insnhelper.ci, vm.c: rewrite sp manipulation around method/block
invocation.  [ruby-dev:32547]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-18 13:14:32 +00:00
ko1 8394de7bfc * vm.c (invoke_block): merge 2 stack overflow checks.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-18 12:11:38 +00:00
akr 4f13113945 * vm_core.h (rb_thread_t): new member machine_stack_maxsize and
machine_register_stack_maxsize.

* gc.c (rb_gc_stack_maxsize): new global variable for the thread size
  of the main thread.
  (STACK_LEVEL_MAX): use machine_stack_maxsize of current thread.
  (ruby_stack_check): check IA64 register stack.
  (ruby_set_stack_size): set rb_gc_stack_maxsize.
  (Init_stack): set rb_gc_stack_maxsize.

* thread_pthread.ci (native_thread_create): initialize
  th->machine_stack_maxsize and th->machine_register_stack_maxsize.

* vm.c (Init_BareVM): initialize th->machine_stack_maxsize and
  th->machine_register_stack_maxsize.

* thread_win32.ci (native_thread_create): initialize
  th->machine_stack_maxsize.  not tested.  just a guess at all.

[ruby-dev:32604]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-15 04:09:24 +00:00
ko1 3923d7f420 * vm.c (rb_thread_mark): use rb_gc_mark_maybe() for
VM stack specified by mark_stack_len.
* insnhelper.ci: clear vm stack extended by opt value.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09 05:56:00 +00:00
nobu 430f5a1d61 * proc.c (rb_proc_s_new): call initialize. [ruby-core:13824]
* proc.c (rb_proc_location): return file name and line number where
  the proc is defined.

* thread.c (thread_s_new): call initialize.  [ruby-core:13835]

* thread.c (thread_initialize): split initialize method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-05 07:18:52 +00:00
ko1 2a2e4bbbc3 * vm.c: fix comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-23 08:34:34 +00:00
matz c227d3feb3 * insnhelper.ci (vm_search_normal_superclass): rename function.
* insnhelper.ci (vm_search_superclass): ditto.

* proc.c (struct METHOD): rename rklass -> rclass.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-22 01:17:52 +00:00
ko1 c79ab68d37 * vm.c: fix to recycle thread data (VM stack).
* thread.c: ditto.
* benchmark/bm_vm3_thread_create_join.rb: add loop count.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-21 09:06:06 +00:00
shugo 577eaa60a7 * insnhelper.ci (vm_call_method): pass mn->nd_clss to
vm_call_cfunc() instead of klass.
* vm.c (rb_thread_method_id_and_klass): traverse parent_iseq.
* thread.c (call_trace_proc): use rb_thread_method_id_and_klass().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-11 08:42:13 +00:00
nobu 4c040861c8 * eval.c (rb_invoke_method): check if invoked in function style.
[ruby-core:13245]

* insnhelper.ci (vm_call_cfunc, vm_cfunc_flags): stores and returns VM
  calling flags.

* vm.c (rb_vm_cfunc_funcall_p): returns if the current method is
  invoked in function style.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-09 01:29:24 +00:00