aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
Commit message (Collapse)AuthorAgeFilesLines
* * insns.def : support direct method dispatch with "send" or "funcall".ko12007-01-061-4/+3
| | | | | | | | | | | | | | | | This means that "obj.send :m" skips "BasicObject#send" invocation (method frame creation, etc) and "obj.m" invokes directly. If you make backtrace, there are no enties of "send" method. * compile.c (iseq_specialized_instruction) : fix to support above * eval.c : ditto (remove "static" from rb_f_send and rb_f_funcall * yarvcore.c : ditto (add a external IDs for compiler) * yarvcore.h : ditto (add a VM_CALL_SEND_BIT macro) * yarvtest/test_method.rb : add tests for above changes * eval.c : remove unused "Kernel#send" declaration git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, compile.h : add ADD_CALL_RECEIVER() macro.ko12007-01-051-1/+9
| | | | | | | | | | | | * insns.def (send) : use GET_SELF() direct if FCALL. * eval.c (rb_f_send) : check method dispatch type to permit nvoking private method when dispatch type is FCALL/VCALL * insns.def (opt_ltlt) : remove useless statement. * vm.h : remove unused macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Merge YARVko12006-12-311-11143/+884
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): keep the exception till after END blocks.nobu2006-12-091-1/+0
| | | | | | | [ruby-core:09675] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * intern.h, object.c, variable.c (rb_mod_constants): added an optionalnobu2006-12-041-2/+6
| | | | | | | | flag to search ancestors, which is defaulted to true, as well as const_defined? and const_get. [ruby-dev:29989] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (formal_assign): need to pack rest arg information inmatz2006-11-071-10/+5
| | | | | | | argc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (method_missing): update old argument adjustment.matz2006-11-071-4/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (when_check): need to splat for NODE_ARGSCAT as well.matz2006-11-071-2/+5
| | | | | | | [ruby-dev:29860] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (svalue_to_avalue): need to splat but no error.matz2006-11-061-32/+39
| | | | | | | | | | | | | | | | * eval.c: new macros - YIELD_CALL, YIELD_VALUES. * eval.c (rb_yield_values): specify YIELD_VALUES. * eval.c (rb_yield_0): use new macros. * eval.c (proc_invoke): slightly modified to separate YIELD_CALL and YIELD_VALUES from YIELD_ARY_ARGS. * object.c (Init_Object): add nil.to_splat => []. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call0): fixed bug of zsuper with both of opt and rest.matz2006-11-021-0/+4
| | | | | | | fixed: [ruby-list:42928] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_obj_define_method): add half boiled RDoc document.matz2006-10-111-0/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_obj_define_method): add new methodmatz2006-10-091-0/+10
| | | | | | | Kernel#define_singleton_method. [ruby-list:42851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (formal_assign): packed post splat arguments may conflictmatz2006-10-071-2/+5
| | | | | | | | | with normal arguments. [ruby-core:09021] * eval.c (rb_call0): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_yield_0): small refactoring.matz2006-10-051-7/+5
| | | | | | | * parse.y (bparam_item): fixed bugs in handling parenthesized LHS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call): check protected visibility based on real self,matz2006-10-041-21/+28
| | | | | | | not ruby_frame->self. [ruby-talk:217822] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (splat_value): use "to_splat" instead of "to_ary" tomatz2006-10-021-3/+16
| | | | | | | | | | | | | prepare splat values as an array. * array.c (Init_Array): define to_splat. * range.c (range_to_splat): new method. * enumerator.c (enumerator_to_splat): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_thread_save_context, rb_thread_restore_context):why2006-09-231-102/+82
| | | | | | | | | | | | | | | | | | | | | sandbox hook to save and restore sandbox state. * eval.c (thread_no_ensure): added THREAD_NO_ENSURE thread flag. * eval.c (rb_thread_kill_bang): Thread#kill! uses the above flag to circumvent ensure, in order to prevent endless loops. contributed by MenTaLguY. [ruby-core:08768] * eval.c (rb_thread_kill): fix Thread#kill docs, which returns the thread object in all cases. * node.h: expose the rb_jmpbuf_t and rb_thread_t structs, along with the thread flags. used by the sandbox extension. * ruby.h: extern rb_eThreadError, so sandbox can swap it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_s_glob): remove unused variable.matz2006-09-181-7/+0
| | | | | | | | | | | | | * math.c (math_log): ditto. * re.c (rb_reg_regcomp): ditto. * eval.c (break_jump): ditto. * eval.c (rb_thread_yield_0): remove unused function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_require_safe): prevent extension from loading twice.nobu2006-09-101-7/+7
| | | | | | | fixed: [ruby-dev:29523] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_local_variables): list symbols.matz2006-09-041-2/+2
| | | | | | | | | | | | | * struct.c (rb_struct_s_members_m): ditto. * variable.c (ivar_i): ditto. * variable.c (gvar_i): ditto. * variable.c (cv_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.h (struct RArray): embed small arrays.matz2006-09-021-63/+58
| | | | | | | | | | (RARRAY_LEN): defined for accessing array members. (RARRAY_PTR): ditto. * array.c: use RARRAY_LEN and RARRAY_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_eval): should handle when in else clause. a patchmatz2006-09-021-16/+3
| | | | | | | | | from Eric Hodel <drbrain at segment7.net>. [ruby-core:08662] * parse.y (primary): wrap with NODE_CASE. [ruby-core:08663] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (search_required): use RSTRING_PTR and RSTRING_STR.usa2006-08-311-1/+1
| | | | | | | | | | | * object.c (nil_plus): ditto. * ext/dl/cptr.c (rb_dlptr_s_to_ptr): ditto. * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_create_ext): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.h (struct RString): embed small strings.matz2006-08-311-30/+33
| | | | | | | | | | (RSTRING_LEN): defined for accessing string members. (RSTRING_PTR): ditto. * string.c: use RSTRING_LEN and RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_init): rename top_cref to ruby_top_cref and export,why2006-08-311-5/+5
| | | | | | | | | along with ruby_cref, for use by the sandbox. [ruby-core:08762] * node.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert.drbrain2006-08-281-3/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Include attributiondrbrain2006-08-271-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ansificated.akr2006-08-131-9/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c, eval.c, gc.c, ruby.h: shut up AIX alloca warning.matz2006-08-071-3/+1
| | | | | | | [ruby-dev:29191] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call0): trace call/return of method defined from block.nobu2006-07-301-0/+8
| | | | | | | fixed: [ruby-core:08329] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_trap_eval): make the current thread runnable to deal withnobu2006-07-301-0/+1
| | | | | | | exceptions which occurred within the trap. fixed: [ruby-dev:27729] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call): fixed typo in cache look-up. [ruby-dev:29167]matz2006-07-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call): a bug in method cache look-up.matz2006-07-281-2/+2
| | | | | | | http://www.rubyist.net/~matz/20060720.html#c04 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_eval): rename #invoke_method andmatz2006-07-261-10/+13
| | | | | | | | | | | | | | | #invoke_functional_method to __send and __send! respectively. * eval.c (remove_method): prohibit removing __send and __send!. * eval.c (rb_undef): prohibit undef'ing __send and __send!. * eval.c (rb_eval): prohibit redefining __send and __send!. * lib/delegate.rb (Delegator): preserve __send. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (backtrace): porting miss.nobu2006-07-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (backtrace): skip frames successive on node and method name.nobu2006-07-241-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call0): revert last change. [ruby-dev:29112]matz2006-07-241-1/+0
| | | | | | | [ruby-core:08374] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call0): include funcalled methods in caller list.nobu2006-07-211-0/+1
| | | | | | | fixed: [ruby-core:08290] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call): try local method look-up first for fcall, thenmatz2006-07-201-25/+41
| | | | | | | | | | | | normal method look-up. [ruby-talk:202564] * eval.c (rb_get_method_body): save local method cache separately. * eval.c (search_method): export info whether method is local or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_yield_0): should check args_args before lambdamatz2006-07-191-2/+3
| | | | | | | argument check. [ruby-dev:29029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (yield_under_i): argument should be passed in avaluematz2006-07-181-1/+3
| | | | | | | from. [ruby-dev:29044] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* // comment removed.akr2006-07-151-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (f_args): allow post mandatory arguments after optionalmatz2006-07-121-4/+4
| | | | | | | | | | | | | arguments. [ruby-dev:29014] * parse.y (new_args_gen): allow post_args without rest_args. * eval.c (formal_assign): ditto. * parse.y (new_args_gen): check post argument duplication. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_int2big): use SIGNED_VALUE. [ruby-dev:29019]matz2006-07-111-2/+5
| | | | | | | | | | | | | | | * bignum.c (rb_int2inum, rb_uint2inum): use VALUE sized integer. * bignum.c (rb_big2long, rb_big2ulong): ditto. * numeric.c (rb_num2long, rb_num2ulong): ditto. * numeric.c (check_int, check_uint): ditto. * bignum.c (rb_quad_pack): typo fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove an unused label and variable.akr2006-07-111-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call): remove erroneously restored prot_tag->blkidmatz2006-07-101-1/+0
| | | | | | | initialization. [ruby-dev:28997] [ruby-dev:29000] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (proc_invoke): should not overwrite block information inmatz2006-07-101-36/+59
| | | | | | | | | | | | | | | | current frame. [ruby-dev:28957] * eval.c (rb_yield_0): retrieve proper block object from the frame record. * eval.c (proc_alloc): return preserved block object if it's available. * st.h (st_data_t): use pointer sized integer for st_data_t. [ruby-dev:28988] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_clear_cache_for_remove): clear entries for includednobu2006-07-101-1/+2
| | | | | | | module. fixed: [ruby-core:08180] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (next_jump): deal with destination of next.nobu2006-07-081-3/+29
| | | | | | | fixed: [ruby-core:08169] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call): should not set prot_tag->blkid since it wouldmatz2006-07-041-7/+11
| | | | | | | never catch breaks at this level. [ruby-dev:28922] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e