summaryrefslogtreecommitdiff
path: root/class.c
AgeCommit message (Collapse)Author
2010-12-05* class.c (make_metaclass): fix probable typo. builtin type flagnobu
cannot be used with FL_TEST. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-04* class.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-27* class.c (clone_const): need to return value. fix r29602.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-26* class.c, constant.h, gc.c, method.h, object.c, variable.c,mame
vm_insnhelper.c: use struct rb_constant_entry_t as entry of RCLASS_CONST_TBL. RCLASS_CONST_TBL has contained VALUE of constant directly. Now instead rb_const_entry_t is contained in RCLASS_CONST_TBL, rb_const_entry_t is managed by malloc, and have not only the value itself but also visibility flag. This is another preparation for private constant (see [ruby-dev:39685][ruby-core:32698]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-26* class.c, gc.c, object.c, variable.c, vm_insnhelper.c,mame
include/ruby/ruby.h: separate RCLASS_CONST_TBL from RCLASS_IV_TBL. RCLASS_IV_TBL has contained not only instance variable table but also constant table. Now the two table are separated to RCLASS_CONST_TBL and RCLASS_IV_TBL. This is a preparation for private constant (see [ruby-dev:39685][ruby-core:32698]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-17* class.c (rb_define_{class,module}_id_under): register to benobu
marked, which probably are defined and used internally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* array.c (rb_ary_and, rb_ary_or), class.c (rb_mod_init_copy),nobu
gc.c (undefine_final), time.c (time_mload): get rid of type-punning casts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* configure.in (RUBY_CHECK_PRINTF_PREFIX): check for printf formatnobu
specifier if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-10* class.c (rb_scan_args): Add support for optional keywordknu
argument hash. * README.EXT, README.EXT.ja: Update documentation accordingly. * dir.c (dir_initialize): Make use of the new rb_scan_args() feature. * io.c (rb_io_s_popen, rb_scan_open_args, rb_io_initialize) (rb_io_s_pipe, open_key_args, io_s_foreach, io_s_readlines) (rb_io_s_read, rb_io_set_encoding): Ditto. * transcode.c (str_transcode, econv_args) (econv_primitive_convert): Ditto. * ext/zlib/zlib.c (rb_gzreader_initialize): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-01* class.c (rb_include_module): don't clear the method cache if theakr
included module has no method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27* class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:naruse
clean unused-value warnings. * cont.c, process.c, vm_exec.h: clean cast warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-27* class.c (rb_mod_init_copy): when class is dup'ed, a metaclass of themame
class should be attached to the dup'ed class, not the original class. [ruby-core:30843] [Bug #3461] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-22* class.c: rdoc fix [ruby-core:30449]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-17* object.c: Object#public_methods, private_methods, etc. returnsmame
method ids that belong to the class or the singleton class(es) of the object. [ruby-dev:41613] * class.c: on the other hand, Module#public_instance_methods, etc. returns method ids that belong to the module itself (even if the module is singleton, it does not return method ids of super class(es); see [ruby-core:28837]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-28* gc.c : use simple lazy sweep algorithm for response performancenari
gain. See [ruby-dev:41067]. * object.c: FL_MARK of some objects by lazy sweep is copied when RVALUE is cloned. These objects are not marked in the mark phase. So delete FL_MARK. * class.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-04* method.h, vm_method.c: rename some internal functions related toko1
rb_method_entry_t. rb_add_method_me() -> rb_method_entry_set(). rb_get_method_entry() -> rb_method_entry_without_cache(). rb_gc_mark_method_entry() -> rb_mark_method_entry(). * class.c, proc.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-29instance_methods should not special-case singleton classes, fixes #2993shyouhei
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-06* class.c (rb_class_init_copy): raise a TypeError if the argument isshugo
BasicObject. [ruby-core:27060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13* object.c (rb_class_initialize): Make sure BasicObject doesn't get ↵marcandre
initialized twice [ruby-core:27577] * class.c (rb_class_init_copy): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-09* class.c (rb_define_class): raise TypeError same as classnobu
statement. [ruby-core:27504] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-14* class.c (rb_mod_init_copy): fix memory leak of Class#dup.mame
[ruby-dev:39687] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-23* class.c (rb_class_new): move class check to rb_check_inheritable().matz
* class.c (rb_check_inheritable): should not allow subclass of class Class. [ruby-core:26225] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-22* class.c (rb_obj_basic_to_s_p): typo. Please become familiar withusa
the ANSI style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-21* object.c (rb_obj_inspect): print instance variables only whenmatz
Object#to_s is not overridden. [ruby-core:24425] * class.c (rb_obj_basic_to_s_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-31* class.c (make_singleton_class): variable name changed.yugui
removed an unnecessary conditional. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-31* class.c: refactored singleton class related matters.yugui
Handles eigenclasses and plain classes transparently. (make_metaclass): renamed from make_metametaclass. (METACLASS_OF): new utility macro (META_CLASS_OF_CLASS_CLASS): ditto. (ENSURE_EIGENCLASS): ditto. (make_singleton_class): extracted from rb_singleton_class. (boot_defclass): moved from object.c (Init_class_hierarchy): extracted from Init_Object. (rb_make_metaclass): refactored. (singleton_class_of): extracted from rb_singleton_class. (rb_singleton_class): refactored. (rb_define_singleton_method): it needs a metaclass only but not its metametaclass. * object.c: booting class hierarchy was moved to class.c for keeping dependency between compilation units least. (Init_Object): extracting the booting into Init_class_hierarchy. (boot_defclass): moved to class.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-29Doxygen comment.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-28* method.h (rb_method_definition_t): split from rb_method_entry_tnobu
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-12* class.c (rb_define_module_id_under): fix the name.naruse
* class.c (rb_define_module_under): fix for prevvious changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-12* class.c (rb_define_class_id_under, rb_define_module_id_under):nobu
new functions to define a nested class/module with non-ascii name. * struct.c (make_struct): use name with encoding. * struct.c (inspect_struct): ditto. [ruby-core:24849] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-18* suppressed shorten-64-to-32 warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-15* method.h, vm_core.h: add rb_method_entry_t. Remove nodes aroundko1
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-06-29Doxy-comments.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-19* class.c (clone_method): add cast to remove warning frommatz
rb_gc_write_barrier(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-19* struct.c (struct_ivar_get): new function to avoid repeatedmatz
rb_intern() calls. * struct.c (rb_struct_iv_get): use struct_ivar_get() * struct.c (num_members): ditto. * struct.c (rb_struct_s_members): ditto. * class.c (rb_singleton_class): cache symbol to reduce calls to rb_intern(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-13* gc.c: add longlife garbage collection. [ruby-dev:38423]nari
(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-04-16* class.c (rb_define_method_id): use rb_define_notimplement_method_idakr
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-03-13* class.c: fixed indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24* class.c (rb_scan_args): Allow specifying the number of trailingknu
mandatory arguments right after the number of optional arguments only if the number of leading mandatory arguments is not omitted. * ext/socket/tcpserver.c (tcp_svr_init): Make use of it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24* class.c (rb_scan_args): Revamp rb_scan_args() to compute theknu
number of required and optional arguments precisely to prepare for a more informative error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22stripped trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-16* class.c (rb_scan_args), README.EXT, README.EXT.ja: Add supportknu
for specifying the number of the trailing mandatory arguments. Update the documents accordingly. [ruby-dev:37995] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15* test/ruby/test_metaclass.rb: new test case for metaclass hierarchy.yugui
* class.c (make_metametaclass): new function. extracted from rb_make_metaclass. * class.c (rb_make_metaclass): uses make_metametaclass when called for a metaclass. * class.c (rb_singleton_class): creates a meta^(n+2)-class in addition to a meta^(n+1)-class when called for a meta^(n)-class. This is because the returned meta^(n+1) class must acts as an instance of Class, metaclass of Class, ..., meta^(n+1)-class of Class, Module, metaclass of Module, ..., meta^(n+1)-class of Module, Object, metaclass of Object, ..., meta^(n+2)-class of Object, BasicObject, metaclass of BasicObject, ..., meta^(n+2)-class of and BasicObject even when Class, Module, Object or BasicObject has not have its meta^(i)-class yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-23* class.c (rb_class_instance_methods): rdoc fixed. [ruby-core:19458]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-25* class.c (rb_make_metaclass): [BUG] Fixed a bus erroryugui
on the case for metaclass of a class which includes a module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-25* class.c (rb_make_metaclass): Made class of class of classyugui
from Class into its own eigenclass. Now meta^(n)-class hierarchy regresses infinitely, again. (This feature was decided on developer-meeting-20080922.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* include/ruby/node.h, node.h: move node.h from include path.ko1
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