summaryrefslogtreecommitdiff
path: root/eval.c
AgeCommit message (Collapse)Author
2013-06-13eval.c: use local variablenobu
* eval.c (make_exception): use local variable for argv[0]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* eval.c (mod_using): new method Module#using, which activatesshugo
refinements of the specified module only in the current class or module definition. [ruby-core:55273] [Feature #8481] * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* internal.h (numberof): Gathered from various files.akr
* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c, load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c, error.c, ruby.c: Remove the definitions of numberof. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25eval.c: rb_frame_callee returns current namenobu
* eval.c (rb_frame_callee): returns the called name of the current frame, not the previous frame. * eval.c (prev_frame_callee, prev_frame_func): rename and make static, as these are used by rb_f_method_name() and rb_f_callee_name() only. * variable.c (set_const_visibility): use the called name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19fix typos. Patch by k_takata.ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* include/ruby/ruby.h: constify RBasic::klass and addko1
RBASIC_CLASS(obj) macro which returns a class of `obj'. This change is a part of RGENGC branch [ruby-trunk - Feature #8339]. * object.c: add new function rb_obj_reveal(). This function reveal interal (hidden) object by rb_obj_hide(). Note that do not change class before and after hiding. Only permitted example is: klass = RBASIC_CLASS(obj); rb_obj_hide(obj); .... rb_obj_reveal(obj, klass); TODO: API design. rb_obj_reveal() should be replaced with others. TODO: modify constified variables using cast may be harmful for compiler's analysis and optimizaton. Any idea to prohibt inserting RBasic::klass directly? If rename RBasic::klass and force to use RBASIC_CLASS(obj), then all codes such as `RBASIC(obj)->klass' will be compilation error. Is it acceptable? (We have similar experience at Ruby 1.9, for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)". * internal.h: add some macros. * RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal object. * RBASIC_SET_CLASS(obj, cls) set RBasic::klass. * RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS without write barrier (planned). * RCLASS_SET_SUPER(a, b) set super class of a. * array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c, file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c, parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c, string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c: Use above macros and functions to access RBasic::klass. * ext/coverage/coverage.c, ext/readline/readline.c, ext/socket/ancdata.c, ext/socket/init.c, * ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-01eval.c: use predefined IDsnobu
* eval.c (frame_func_id): use predefined IDs. * vm.c (rb_vm_control_frame_id_and_class): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-04reduce overhead of TYPEnobu
* array.c (ary_join_1): reduce overhead of TYPE(). * eval.c (rb_frozen_class_p, rb_mod_{append,prepend}_features): ditto. * string.c (rb_to_id): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-08eval.c: preserve errinfonobu
* eval.c (rb_ensure): preserve errinfo accross ensure proc before JUMP_TAG(). [ruby-core:52022] [Bug #7802] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24re-fix documentsnobu
File.realdirpath(path) is not a shorthand for File.dirname(File.realpath(path)), just does not err if the last component does not exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24fix documents. __dir__ is a shorthand File.realdirpath(__FILE__).nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24Refix of r38916: it uses realpathnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24 fix rdoc of __dir__ [Bug #7729]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24* eval.c (f_current_dirname): Add documentation about "__dir__nari
returns always an absolute path". [Bug #7729] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-17* eval.c: Fix a typo in ruby_finalize() documentation.kou
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-07* eval.c (Init_eval): main.include should be private.shugo
[ruby-core:51293] [Bug #7670] * test/ruby/test_module.rb (test_top_include_is_private): a new test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-07* eval.c (Init_eval): enable Refinements by default.shugo
[ruby-core:51286] [Bug #7667] * eval.c (rb_mod_refine, top_using): show a warning when Module#refine or main.using is called at the first time. * ext/refinement/*: removed the extension library "refinement". * test/ruby/test_refinement.rb: fix for the above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-29use RB_TYPE_Pnobu
* enumerator.c (enumerator_initialize), eval.c (rb_using_refinement), (add_activated_refinement), numeric.c (num_interval_step_size), parse.y (arg, match_op_gen, cond0), range.c (range_bsearch), vm_insnhelper.c (vm_get_iclass): use RB_TYPE_P() to optimize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-11* eval.c (rb_using_refinement): make the method table of an iclassshugo
for a refinement that of the refinement, not that of the origin of the refinement, which is set by rb_include_class_new(). This change is needed to make module prepend into a refinement work properly. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-10* fix the behavior when a module is included into a refinement.shugo
This change is a little tricky, so it might be better to prohibit module inclusion to refinements. * include/ruby/ruby.h (RMODULE_INCLUDED_INTO_REFINEMENT): new flag to represent that a module (iclass) is included into a refinement. * class.c (include_modules_at): set RMODULE_INCLUDED_INTO_REFINEMENT if klass is a refinement. * eval.c (rb_mod_refine): set the superclass of a refinement to the refined class for super. * eval.c (rb_using_refinement): skip the above superclass (the refined class) when creating iclasses for refinements. Otherwise, `using Refinement1; using Refinement2' creates iclasses: <Refinement2> -> <RefinedClass> -> <Refinement1> -> RefinedClass, where <Module> is an iclass for Module, so RefinedClass is searched before Refinement1. The correct iclasses should be <Refinement2> -> <Refinement1> -> RefinedClass. * vm_insnhelper.c (vm_search_normal_superclass): if klass is an iclass for a refinement, use the refinement's superclass instead of the iclass's superclass. Otherwise, multiple refinements are searched by super. For example, if a refinement Refinement2 includes a module M (i.e., Refinement2 -> <M> -> RefinedClass, and if refinements iclasses are <Refinement2> -> <M>' -> <Refinement1> -> RefinedClass, then super in <Refinement2> should use Refinement2's superclass <M> instead of <Refinement2>'s superclass <M>'. * vm_insnhelper.c (vm_search_super_method): do not raise a NotImplementError if current_defind_class is a module included into a refinement. Because of the change of vm_search_normal_superclass(), the receiver might not be an instance of the module('s iclass). * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-08* eval.c (rb_mod_refine): don't override Module#include. It'sshugo
unnecessary now because refinements are activated only in refine blocks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-08* eval.c: remove Module#refinements.shugo
* test/ruby/test_refinement.rb: remove tests for Module#refinements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-08* eval.c (top_using): raise a RuntimeError if using is called in ashugo
module definition or a method definition. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-08* eval.c (rb_mod_refine): raise an ArgumentError if a givenshugo
block is of a Proc object. * vm_insnhelper.c (vm_call_method): store refined methods in inline cache to improve performance. It's safe now because blocks cannot be yielded with different refinements in the new specification. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-08* eval.c (rb_mod_refine), vm_eval.c (rb_yield_refine_block):shugo
Module#refine activates all refinements defined in that module only in a given block. * string.c (sym_to_proc, sym_call): don't use refinements. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07* vm_eval.c (yield_under, eval_under): do not activate refinementsshugo
of the receiver in module_eval and instance_eval. * eval.c (ruby_Init_refinement): undef Class#refine. * eval.c (ruby_Init_refinement): remove Module#using. * eval.c (ruby_Init_refinement): main.using should be private. * eval.c (rb_mod_refine): the argument of Module#refine should not be a module. * insns.def (defineclass): do not activate refinements in a class or module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-06* eval.c (ruby_Init_refinement): a new function to enableshugo
Refinements with a warning "Refinements are experimental...". * ext/refinement/refinement.c, ext/refinement/extconf.rb: a new extension library to enable Refinements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-06* revised r37993 to avoid SEGV/ILL in tests. In r37993, a methodshugo
entry with VM_METHOD_TYPE_REFINED holds only the original method definition, so ci->me is set to a method entry allocated in the stack, and it causes SEGV/ILL. In this commit, a method entry with VM_METHOD_TYPE_REFINED holds the whole original method entry. Furthermore, rb_thread_mark() is changed to mark cfp->klass to avoid GC for iclasses created by copy_refinement_iclass(). * vm_method.c (rb_method_entry_make): add a method entry with VM_METHOD_TYPE_REFINED to the class refined by the refinement if the target module is a refinement. When a method entry with VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with the same name is searched in refinements. If such a method is found, the method is invoked. Otherwise, the original method in the refined class (rb_method_definition_t::body.orig_me) is invoked. This change is made to simplify the normal method lookup and to improve the performance of normal method calls. * vm_method.c (EXPR1, search_method, rb_method_entry), vm_eval.c (rb_call0, rb_search_method_entry): do not use refinements for method lookup. * vm_insnhelper.c (vm_call_method): search methods in refinements if ci->me is VM_METHOD_TYPE_REFINED. If the method is called by super (i.e., ci->call == vm_call_super_method), skip the same method entry as the current method to avoid infinite call of the same method. * class.c (include_modules_at): add a refined method entry for each method defined in a module included in a refinement. * class.c (rb_prepend_module): set an empty table to RCLASS_M_TBL(klass) to add refined method entries, because refinements should have priority over prepended modules. * proc.c (mnew): use rb_method_entry_with_refinements() to get a refined method. * vm.c (rb_thread_mark): mark cfp->klass for iclasses created by copy_refinement_iclass(). * vm.c (Init_VM), cont.c (fiber_init): initialize th->cfp->klass. * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip the test because it should pass successfully. * test/ruby/test_refinement.rb (test_redefine_refined_method): new test for the case a refined method is redefined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01adjust style.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30* revert r37993 to avoid SEGV in tests.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* vm.c: add a return hook when a method raises an exception.tenderlove
* probes_helper.h: look up klass and method if none are provided. * eval.c: update macro usage. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. * test/dtrace/test_function_entry.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* vm_method.c (rb_method_entry_make): add a method entry withshugo
VM_METHOD_TYPE_REFINED to the class refined by the refinement if the target module is a refinement. When a method entry with VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with the same name is searched in refinements. If such a method is found, the method is invoked. Otherwise, the original method in the refined class (rb_method_definition_t::body.orig_def) is invoked. This change is made to simplify the normal method lookup and to improve the performance of normal method calls. * vm_method.c (EXPR1, search_method, rb_method_entry), vm_eval.c (rb_call0, rb_search_method_entry): do not use refinements for method lookup. * vm_insnhelper.c (vm_call_method): search methods in refinements if ci->me is VM_METHOD_TYPE_REFINED. If the method is called by super (i.e., ci->call == vm_call_super_method), skip the same method entry as the current method to avoid infinite call of the same method. * class.c (include_modules_at): add a refined method entry for each method defined in a module included in a refinement. * class.c (rb_prepend_module): set an empty table to RCLASS_M_TBL(klass) to add refined method entries, because refinements should have priority over prepended modules. * proc.c (mnew): use rb_method_entry_with_refinements() to get a refined method. * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip the test because it should pass successfully. * test/ruby/test_refinement.rb (test_redefine_refined_method): new test for the case a refined method is redefined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* eval.c (ruby_cleanup): delay THREAD_KILLED timing.ko1
It should be located just before rb_thread_terminate_all(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-27* eval.c (ruby_cleanup): set thread status to THREAD_KILLEDkosaki
for preventing thr.raise. * test/ruby/test_thread.rb (test_main_thread_status_at_exit): test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-20* vm_trace.c: add two methods:ko1
(1) TracePoint#return_value which returns return value on the :return and :c_return event. (2) TracePoint#raised_exception which returns raised exception value on the :raise event. Eeach methods raise RuntimeError if it is called at unsupported event. Please review and give us feedback until next preview release (Dec/2012) of Ruby 2.0.0. * insns.def, vm.c, vm_eval.c, vm_insnhelper.c, eval.c, thread.c: ditto. * vm_trace.c, vm_core.h: move definition of rb_trace_arg_t from vm_trace.c to vm_core.h. Caller fills rb_trace_arg_t and pass the pointer of this variable. * test/ruby/test_settracefunc.rb: fix tests to test this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-13* eval.c (rb_mod_using): raise an ArgumentError if cyclic using isshugo
detected. based on the patch by Charlie Somerville. [ruby-core:49092] Bug #7308 * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-12* probes.d: add DTrace probe declarations. [ruby-core:27448]tenderlove
* array.c (empty_ary_alloc, ary_new): added array create DTrace probe. * compile.c (rb_insns_name): allowing DTrace probes to access instruction sequence name. * Makefile.in: translate probes.d file to appropriate header file. * common.mk: declare dependencies on the DTrace header. * configure.in: add a test for existence of DTrace. * eval.c (setup_exception): add a probe for when an exception is raised. * gc.c: Add DTrace probes for mark begin and end, and sweep begin and end. * hash.c (empty_hash_alloc): Add a probe for hash allocation. * insns.def: Add probes for function entry and return. * internal.h: function declaration for compile.c change. * load.c (rb_f_load): add probes for `load` entry and exit, require entry and exit, and wrapping search_required for load path search. * object.c (rb_obj_alloc): added a probe for general object creation. * parse.y (yycompile0): added a probe around parse and compile phase. * string.c (empty_str_alloc, str_new): DTrace probes for string allocation. * test/dtrace/*: tests for DTrace probes. * vm.c (vm_invoke_proc): add probes for function return on exception raise, hash create, and instruction sequence execution. * vm_core.h: add probe declarations for function entry and exit. * vm_dump.c: add probes header file. * vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on function entry and return. * vm_exec.c: expose instruction number to instruction name function. * vm_insnshelper.c: add function entry and exit probes for cfunc methods. * vm_insnhelper.h: vm usage information is always collected, so uncomment the functions. 12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org> * configure.in (isinf, isnan): isinf() and isnan() are macros on DragonFly which cannot be found by AC_REPLACE_FUNCS(). This workaround enforces the fact that they exist on DragonFly. 12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org> * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo), vm_insnhelper.c (vm_search_method): revert r37616 because it's too slow. [ruby-dev:46477] * test/ruby/test_refinement.rb (test_inline_method_cache): skip the test until the bug is fixed efficiently. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-11* eval.c (top_using): remove Kernel#using, and add main.using instead.shugo
* test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-11* eval.c (rb_using_refinement, rb_mod_using, f_using): clear methodshugo
cache only when using is called explicitly. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-07* eval.c (rb_mod_refine): set RMODULE_IS_REFINEMENT to a createdshugo
refinement module, and don't override method_added. * vm_method.c (rb_method_entry_make): check redefinition of optimized methods when a method is added to a refinement module. [ruby-core:48970] [Bug #7290] * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03* eval.c (f_current_dirname): add the new method for Kernel.nari
This method almotst same as File.dirname(__FILE__). One different behavior is it returns nil when __FILE__ returns nil. [Feature #3346] * NEWS: ditto * test/ruby/test_method.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-02* object.c (rb_mod_to_s): Module#{to_s,inspect}, when invoked onshugo
a refinement, returns a string in the format #<refinement:C@M>, where C is a refined class and M is a module at which the refinemet is defined. * eval.c (rb_mod_refine): store information on a refinement for the above change. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-01eval.c: fix messagenobu
* eval.c (top_include): fix a warning message, main is not a class or module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-01* eval.c (rb_using_module): using should be used indirectly.shugo
[ruby-dev:46326] [Feature #7251] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-30* eval.c (rb_mod_refine): fix the error message when no block isshugo
given. [ruby-dev:46319] [Bug #7244] * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19* eval.c, vm_eval.c: use TH_PUSH_TAG() instead of PUSH_TAG().ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-08* eval.c (rb_mod_refinements): new method Module#refinements.shugo
* test/ruby/test_refinement.rb: add new tests for the above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-08* eval.c, gc.c, iseq.c, node.h, vm_insnhelper.c, vm_insnhelper.h,shugo
vm_method.c: rename omod and overlaid modules to refinements. * eval.c (hidden_identity_hash_new): renamed from identity_hash_new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-02eval.c: hide internal hashnobu
* eval.c (identity_hash_new): hide internal hashes for refinements. * eval.c (rb_mod_refine): no default value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e