aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
Commit message (Collapse)AuthorAgeFilesLines
* * eval_intern.h (PUSH_TAG): no argument now.nobu2007-04-251-19/+19
| | | | | | | | * eval.c, eval_error.h, eval_jump.h, eval_load.c, proc.c, thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): inversed the order of errinfos.nobu2007-04-201-8/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): fixed access to out of bound, and inversednobu2007-04-201-12/+16
| | | | | | | the order of errinfos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): re-send signal. [ruby-dev:30516]nobu2007-04-191-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * eval_error.h (error_handle): no message when exiting by signal. * intern.h (rb_thread_signal_raise, ruby_default_signal): prototypes. * signal.c (esignal_init): takes a signal number and an optional signal name. * signal.c (interrupt_init): pass SIGINT always. * signal.c (ruby_default_signal): invoke system default signal handler. * signal.c (rb_f_kill): use NUM2PIDT instead of NUM2INT. * signal.c (rb_signal_exec, trap): handle SIGTERM. [ruby-dev:30505] * thread.c (rb_thread_signal_raise): now takes signal number instead of signal name. * thread.c (rb_thread_signal_exit): since rb_make_exception() calls #exception method, rb_class_new_instance() is not needed here. * yarvcore.h (struct rb_vm_struct), eval_jump.h (terminate_process): exit_code is no longer stored in VM. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, node.h, thread.c, yarvcore.[ch], eval_intern.h:ko12007-04-191-254/+20
| | | | | | | | | | | | | | | | | support set_trace_func (incomplete. id and klass don't be passed). And support Thread#set_trace_func which hook only specified thread and Thread#add_trace_func which add new trace func instead of replace old one. C level API was modified. See thread.c (logic) and yarvcore.h (data structures). * vm.c, vm_macro.def: add hook points. * compile.c, insns.def: fix "trace" instruction. * iseq.c, vm_macro.h: add compile option "trace_instruction". * test/ruby/test_settracefunc.rb: hook "c-return" of set_trace_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_rescue2): restore cfp ([ruby-dev:30582]).ko12007-04-121-27/+33
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_protect): restore cfp ([ruby-dev:30671]).ko12007-04-121-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,ko12007-03-211-53/+20
| | | | | | | | | | | | | proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h, debug.c, debug.h: merge half-baked-1.9 changes. The biggest change is to change node structure around NODE_SCOPE, NODE_ARGS. Every scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS represents more details of arguments information. I'll write a document about detail of node structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c: just minor changes (rdoc).usa2007-03-201-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_callee_name): add __method__ and __callee__ again.matz2007-03-201-0/+54
| | | | | | __callee__ need to rework to adopt YARV. [ruby-core:10671] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * yarvcore.h, vm.h: rename th_invoke_yield() to th_yield().ko12007-02-261-3/+2
| | | | | | | | | | | | | * blockinlining.c: ditto. * eval.c: ditto. * vm.c, insns.def: rename th_invoke_yield_cfunc() to th_yield_with_cfunc(). * yarvcore.h, yarvcore.c: rename theYarvVM to ruby_current_vm and yarvCurrentThread to ruby_current_thread. remove yarvVMArray. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * yarvcore.h: add rb_thread_t#top_wrapper, top_self.ko12007-02-251-10/+13
| | | | | | | | | | | | | | | * eval_load.c (rb_load): support eval in wrapper module (load(file, true)). * eval.c: ditto. * eval_jump.h: ditto. * iseq.c: ditto. * vm.c: ditto. * yarvcore.c: ditto. * insns.def: add a empty line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * yarvcore.h:ko12007-02-251-12/+9
| | | | | | | | | | | | | | | | | | | | | rename: rb_iseq_t#file_name -> filename rb_iseq_t#local_tbl -> local_table add: rb_iseq_t#local_table_size * compile.c: separate local_table_size and local_size (local variable size) * blockinlining.c: apply above rename. * compile.h: ditto. * eval.c: ditto. * iseq.c: ditto. * proc.c: ditto. * vm.c: ditto. * vm_dump.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, vm.c, yarvcore.h: move definition of rb_call_super() toko12007-02-201-6/+0
| | | | | | | | vm.c from eval.c. change th_call_super() to static function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * blockinlining.c, error.c, eval.c, eval_error.h, eval_intern.h,ko12007-02-081-20/+20
| | | | | | | | | | | | | | | | eval_jump.h, eval_load.c, eval_safe.h, gc.c, proc.c, signal.c, thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h: fix typo (rb_thead_t -> rb_thread_t). * eval_intern.h: remove unused definitions. * common.mk: fix around vm_opts.h path and remove harmful argument passed to insns2vm.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (specific_eval): suppress warning.nobu2007-02-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c: fixed to use ANSI function style.ko12007-02-071-26/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * this commit is a result of refactoring. only renaming functions,ko12007-02-071-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | moving definitions place, add/remove prototypes, deleting unused variables and removing yarv.h. This commit doesn't change any behavior of ruby/vm. * yarv.h, common.mk: remove yarv.h (contents are moved to yarvcore.h). * error.c, eval_intern.h: include yarvcore.h instead yarv.h * rename some functions: * debug.[ch]: debug_*() -> ruby_debug_*() * iseq.c: iseq_*() -> rb_iseq_*(), ruby_iseq_disasm() * iseq.c: node_name() -> ruby_node_name() * vm.c: yarv_check_redefinition_opt_method() -> rb_vm_check_redefinition_opt_method() * some refactoring with checking -Wall. * array.c: remove rb_ary_ptr() (unused) and remove unused local variables. * object.c: add a prototype of rb_mod_module_exec(). * eval_intern.h (ruby_cref): set it inline. * eval_load.c (rb_load), yarvcore.c: yarv_load() -> rb_load_internal(). * parse.y: add a prototype of rb_parse_in_eval() (in eval.c). * process.c: add a prototype of rb_thread_stop_timer_thread() (in thread.c). * thread.c: remove raw_gets() function (unused) and fix some format mismatch (format mismatchs have remained yet. this is todo). * thread.c (rb_thread_wait_fd_rw): fix typo on label name. * thread_pthread.ci: comment out codes with USE_THREAD_CACHE. * vm.c (rb_svar, rb_backref_get, rb_backref_get, rb_lastline_get, rb_lastline_set) : moved from yarvcore.c. * vm.c (yarv_init_redefined_flag): add a prototype and rename yarv_opt_method_table to vm_opt_method_table. * vm.c (rb_thread_eval): moved from yarvcore.c. * yarvcore.c: remove unused global variables and fix to use nsdr(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * blockinlining.c, compile.c, compile.h, error.c, eval.c,ko12007-02-061-63/+56
| | | | | | | | | | | | | | | | | | | | | | eval_intern.h, eval_jump.h, eval_load.c, eval_method.h, eval_safe.h, gc.c, insnhelper.h, insns.def, iseq.c, proc.c, process.c, signal.c, thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h, vm_dump.c, vm_evalbody.ci, vm_macro.def, yarv.h, yarvcore.h, yarvcore.c: change type and macro names: * yarv_*_t -> rb_*_t * yarv_*_struct -> rb_*_struct * yarv_tag -> rb_vm_tag * YARV_* -> RUBY_VM_* * proc.c, vm.c: move functions about env object creation from proc.c to vm.c. * proc.c, yarvcore.c: fix rb_cVM initialization place. * inits.c: change Init_ISeq() order (after Init_VM). * ruby.h, proc.c: change declaration place of rb_cEnv from proc.c to ruby.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_frame_callee): check if prev_cfp can be accessible.matz2007-02-041-1/+7
| | | | | | | a patch from Yoshinori Sano <yoshinori.sano at gmail.com> in [ruby-dev:30252]. solves [ruby-dev:30200] and [ruby-core:9856]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,nobu2007-02-021-13/+19
| | | | | | | | | | | eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c, insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y, range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci, vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h: fixed indents and non-C90 comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c: remove duplicated global variables rb_cProc andmatz2007-02-021-3/+0
| | | | | | rb_cBinding. [ruby-dev:30242] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * some refactoring around yarvcore and proc.ko12007-01-171-3/+4
| | | | | | | | | | | | | | | | | | | | | | | * eval_proc.c: renamed to proc.c. * common.mk: ditto. * yarvcore.h, yarvcore.c: rename or remove some global variables removed: mYarvCore, mYarvInsns renamed: cYarvISeq -> rb_cISeq, cYarvProc -> rb_cProc, cYarvBinding -> rb_cBinding ::YarvCore module is removed and ::YarvCore::VM class becomes ::VM. And change/remove some functions which added with YARV. * compile.c: ditto. * eval.c: ditto. * iseq.c: ditto. * vm.c: ditto. * inits.c: rename Init_yarvcore to Init_vm. * yarvcore.c, proc.c: move some functions and initialization from yarvcore.c to proc.c. * intern.h, proc.c: add global function rb_binding_new(void). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 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