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

55 Коммитов

Автор SHA1 Сообщение Дата
shyouhei 0d3de66006 * common.mk (compile.$(OBJEXT)): dependencies lacking.
* vm_method.c (rb_add_method_cfunc): invalid initializer for C89

	* compile.c (iseq_insns_unification): int might be smaller than int*


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-20 07:12:16 +00:00
mame 479a3c4c8b * vm_method.c (rb_alias): skip ZSUPER method when searching body of
source method.  [ruby-dev:39760]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-08 14:10:58 +00:00
nobu 4d786d21e3 * removed spaces just before tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-26 05:25:08 +00:00
shugo 63c3b2d283 * vm_method.c (rb_undef): should raise TypeError if klass is nil.
1.instance_eval { undef to_s } causes SEGV before this fix.
* test/ruby/test_undef.rb: new tests for undef.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-18 01:13:54 +00:00
shugo 86d46b5459 * vm_method.c (rb_alias): should raise TypeError if klass is nil.
1.instance_eval { alias to_string to_s } causes SEGV before this
  fix.
* test/ruby/test_alias.rb (test_special_const_alias): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-17 14:53:32 +00:00
matz eccb700286 * vm_method.c (basic_obj_respond_to): call #respond_to_missing?
always with two arguments.  [ruby-core:26090]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-17 05:34:51 +00:00
matz 4631523baf * vm_method.c (rb_method_boundp): should exclude NOEX_RESPONDS.
based on the patch from Nikolai Lugovoi.  [ruby-core:25949]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-09 14:52:02 +00:00
matz e3fc29a71b * vm_method.c (basic_obj_respond_to): should not call
#respond_to_missing? for not implemented methods.
  [ruby-core:25909]

* vm_method.c (rb_method_boundp): returns exceptional value 2 for
  not-implemented methods when called from #respond_to? (specifies
  by new contant NOEX_RESPONDS).

* method.h (enum): new constant NOEX_RESPONDS added.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-04 17:05:59 +00:00
nobu 9603cd2f62 * vm_method.c (rb_add_method_def): no redefinition warning on
undef.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-03 12:19:19 +00:00
nobu a71d47a380 * vm_method.c (rb_add_method_def): show the location where
overwritten method was defined.  [ruby-dev:39400]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-30 04:15:46 +00:00
nobu 16969412b3 * vm_method.c (rb_method_definition_eq): non-null definition is
not equal to null definition.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-29 04:49:00 +00:00
nobu 1fe57a4b5d * vm_method.c (rb_add_method_def): nothing to do if old method had
same definition.  [ruby-dev:39397]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-29 04:37:52 +00:00
nobu 5e4d04c36e * vm_method.c (rb_method_entry_eq): fixed a message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-29 04:33:17 +00:00
matz 102918a3ee git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2009-09-28 03:09:16 +00:00
nobu 6bf6f3d4c4 * vm_method.c (rb_method_entry_eq): suppressed a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-27 00:17:48 +00:00
matz 3ca245a54c * vm_method.c (rb_method_entry_eq): method defined from same
block/proc should be equal.  [ruby-core:25755] [ruby-core:24791]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-26 14:59:09 +00:00
nobu 8be423f51d * vm_method.c (check_definition): fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25 03:36:26 +00:00
nobu 44f7a34031 * vm_method.c (obj_respond_to_missing): added rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25 03:33:26 +00:00
nobu 2c549ad5d3 * vm_method.c (rb_mod_method_defined): should return true or false.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25 02:56:52 +00:00
nobu bc7123e434 * vm_method.c (rb_mod_method_defined): should return true or false.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25 02:51:36 +00:00
matz 945f4df6a8 * vm_method.c (basic_obj_respond_to): new function to fundamental
behavior for #respond_to?

* vm_method.c (basic_obj_respond_to): calls #respond_to_missing
  method if overridden, to check responsiveness of methods
  implemented by #method_missing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-23 08:46:44 +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 63b231cea0 * vm_method.c (rb_add_method_def): no warning for inherited
method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-13 00:34:11 +00:00
nobu 97c3bad478 * vm_method.c (CALL_METHOD_HOOK): refined with macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-12 15:46:42 +00:00
nobu a5971a1282 * vm_method.c (remove_method): typo fixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-12 15:31:43 +00:00
nobu 2fcdd7e080 * vm_method.c (rb_remove_method_id): no definition body is
undefined.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-12 15:27:59 +00:00
nobu efa4ed8cce * vm_method.c (rb_alias): hooks are called from rb_add_method_def.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-12 15:21:03 +00:00
nobu d7feab06cc * vm_method.c (rb_add_method, rb_add_method_me): call method added
hook after definition.  [ruby-core:25536]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-12 15:03:02 +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 84255e0485 * vm_method.c (rb_remove_method_id): exported.
* numeric.c (num_sadded): fix for non-ascii method name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-27 09:31:11 +00:00
nobu efb9097352 * vm_method.c (rb_method_entry_eq): deals with optimized method
properly.  [ruby-core:24789]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-06 06:44:10 +00:00
shyouhei 506a9821ce * method.h : Commas at end of enum list not allowed as of C89
* vm_method.c (rb_add_method): avoid C++ comment

	* vm_insnhelper.c (vm_call_cfunc): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-22 13:27:26 +00:00
nobu 33fc55acef * vm_method.c (me_opts): fixed optimized method aliasing.
[ruby-dev:38824]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-19 02:00:27 +00:00
ko1 b5dd85f049 * vm_method.c (rb_alias): fix a case which try non-existing method alias.
* test/ruby/test_alias.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16 08:44:23 +00:00
ko1 d4628c0bcd * vm_method.c: separate clearing cache entry code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-15 23:59:15 +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
nobu fd4d1dde2f * vm_method.c (rb_add_method, remove_method, rb_undef): fixed
minor grammatical errors in warnings.  a patch from Run Paint
  Run Run at [ruby-core:24141].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-04 23:14:43 +00:00
nobu ba0ac946e9 * vm_method.c (Init_eval_method): registers notimplement_body as a
mark-object.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-04 23:12:04 +00:00
matz 9553911f29 * vm_method.c (rb_attr): should preserve encoding info.
[ruby-dev:38498]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-19 15:07:45 +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
akr a69b87e80e update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-21 18:41:07 +00:00
akr 8e8ae2a9c5 * node.h (rb_notimplement_body_p): declared.
* vm_method.c (Init_eval_method): suppress a warning.

* io.c (rb_io_fsync): use rb_f_notimplement if not implemented.
  (rb_io_close_on_exec_p): ditto.
  (rb_io_set_close_on_exec): ditto.
  (rb_io_fcntl): ditto.
  (rb_f_syscall): ditto.

* dir.c (dir_tell): ditto.
  (dir_seek): ditto.
  (dir_s_chroot): ditto.

* process.c (proc_getpgrp): ditto.
  (proc_setpgrp): ditto.
  (proc_getpgid): ditto.
  (proc_setpgid): ditto.
  (proc_setsid): ditto.
  (proc_getpriority): ditto.
  (proc_setpriority): ditto.
  (proc_getrlimit): ditto.
  (proc_setrlimit): ditto.
  (p_sys_setuid): ditto.
  (p_sys_setruid): ditto.
  (p_sys_seteuid): ditto.
  (p_sys_setreuid): ditto.
  (p_sys_setresuid): ditto.
  (p_sys_setgid): ditto.
  (p_sys_setrgid): ditto.
  (p_sys_setegid): ditto.
  (p_sys_setregid): ditto.
  (p_sys_setreuid): ditto.
  (p_sys_setresgid): ditto.
  (p_sys_issetugid): ditto.
  (proc_getgroups): ditto.
  (proc_setgroups): ditto.
  (proc_initgroups): ditto.
  (proc_daemon): ditto.
  (rb_proc_times): ditto.

* file.c (rb_file_s_lchown): ditto.
  (rb_file_s_link): ditto.
  (rb_file_s_symlink): ditto.
  (rb_file_s_readlink): ditto.
  (rb_file_s_truncate): ditto.
  (rb_file_truncate): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-16 16:58:06 +00:00
akr 8b27d153d2 * class.c (rb_define_method_id): use rb_define_notimplement_method_id
if rb_f_notimplement is given.
  (rb_define_protected_method): ditto.
  (rb_define_private_method): ditto.
  (rb_define_method): use rb_define_method_id.

* include/ruby/intern.h (rb_f_notimplement): declared.
  (rb_define_notimplement_method_id): declared.

* proc.c (method_inspect): show not-implemented.

* vm_method.c (notimplement_body): new variable.
  (rb_notimplement_body_p): new function.
  (rb_method_boundp): return false if not implemented.
  (rb_f_notimplement): new function.
  (rb_define_notimplement_method_id): new function.

* process.c (rb_f_fork): use rb_f_notimplement if not implemented.

* file.c (rb_file_s_lchmod): use rb_f_notimplement if not implemented.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-16 14:17:14 +00:00
ko1 b30b998966 * vm_insnhelper.c (vm_call_method, vm_call_cfunc): use original id instead of
calling id when NODE_CFUNC or NODE_BMETHOD.
  fixes Bug #632 [ruby-core:19282].
* vm_eval.c (vm_call0, vm_call_super): ditto.
* vm_method.c (rb_add_method, rb_alias): store original id
  in nd_file field of NODE_METHOD.
* test/stringio/test_stringio.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 03:57:21 +00:00
nobu d5b7e69032 * vm_eval.c (vm_call_super): uses method_missing().
* vm_eval.c (method_missing): get rid of too large alloca.

* vm_eval.c (rb_call0, method_missing): uses idMethodMissing.

* vm_method.c (rb_add_method, remove_method, rb_undef): uses
  id__send__.

* vm_method.c (Init_eval_method): removed IDs which are defined as
  immediate values.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15 05:15:26 +00:00
knu f259918c81 * vm_method.c (rb_obj_respond_to): Remove a duplicated rdoc
comment and fix a markup error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 02:39:55 +00:00
nobu 4c88510849 * vm_method.c (rb_mod_modfunc): method undefined in included module
may not have nd_body.  [ruby-core:18738]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-05 14:07:06 +00:00
ko1 8cd252ac6f * common.mk: clean up
- remove blockinlining.$(OBJEXT) to built
  - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h)
  - make VM_CORE_H_INCLUDES variable (vm_core.h)
  - simplify rules.
  - make depends rule to output depend status using gcc -MM.
* include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h.
* include/ruby.h: ditto.
* load.c: add inclusion explicitly.
* enumerator.c, object.c, parse.y, thread.c, vm_dump.c:
  remove useless inclusion.
* eval_intern.h: cleanup inclusion.
* vm_core.h: rb_thread_t should be defined in this file.
* vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c.
* vm.h, vm_exec.h: rename vm.h to vm_exec.h.
* insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h.
* vm.c, vm_insnhelper.c, vm_insnhelper.h:
  - rename vm_eval() to vm_exec_core().
  - rename vm_eval_body() to vm_exec().
  - cleanup include order.
* vm_method.c: fix comment.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 00:20:28 +00:00
matz cf6334e1cb * vm_method.c (rb_method_node): fail earlier if no method found.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28 12:08:19 +00:00
nobu 5f9c188d97 * include/ruby/ruby.h (rb_intern_const): tiny optimization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16 00:20:31 +00:00