summaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
Commit message (Collapse)AuthorAgeFilesLines
* * compile.c (compile_cpath, iseq_compile_each): revertedshugo2009-12-031-8/+35
| | | | | | | | | | | | | | constant/class variable lookup in instance_eval etc. to the behavior of 1.8. * eval.c (rb_mod_nesting): ditto. * insns.def (putspecialobject, defineclass): ditto. * node.h (NODE_FL_CREF_PUSHED_BY_EVAL): ditto. * vm_core.h (VM_SPECIAL_OBJECT_CONST_BASE): ditto. * vm_eval.c (yield_under, eval_under): ditto. * vm_insnhelper.c (vm_cref_push, vm_get_const_base, vm_get_ev_const, vm_get_cvar_base): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (opt_case_dispatch): runtime value cannot be used asnobu2009-11-171-2/+2
| | | | | | | | | | an element initializer. * vm_insnhelper.c (opt_case_dispatch_i): gets rid of type-punning calls. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method): protected singleton methods ofshugo2009-11-161-1/+1
| | | | | | | | | | an object should not be able to called from other instances of the class of the object. [ruby-core:26761] * vm_eval.c (rb_method_call_status): ditto. * test/ruby/test_module.rb (test_protected_singleton_method): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_push_frame): get rid of out-of-boundsnobu2009-11-071-1/+3
| | | | | | | access. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (VM_CALLEE_SETUP_ARG): revert r25521.matz2009-11-071-21/+10
| | | | | | [ruby-core:26427] [ruby-core:26447] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_push_frame): add CHECK_STACK_OVERFLOW.matz2009-11-071-1/+3
| | | | | | | | | | | | | | | | | [ruby-dev:39592] * eval.c (rb_longjmp): add 1 level backtrace for sysstack_error without calling any method to prevent further stack overflow. * eval.c (make_exception): don't call #exception for sysstack_error to prevent stack overflow. * proc.c (Init_Proc): don't freeze sysstack_error. * eval.c (rb_longjmp): move reentrant check after exception preparation. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_setup_method): should push call frame beforematz2009-10-281-10/+21
| | | | | | | | | | | | raising exception, to put the Ruby-defined method name in the error message. [ruby-core:26333] * vm_insnhelper.c (VM_CALLEE_SETUP_ARG): macro modified. * vm_insnhelper.c (vm_yield_setup_args): modified for new VM_CALLEE_SETUP_ARG macro. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25129 ↵matz2009-09-281-0/+8
| | | | b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu2009-09-211-7/+7
| | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: change members of iseq_inline_cache_entry.ko12009-09-121-6/+6
| | | | | | | | | | make cache value members to one union member "ic_value". * insns.def: ditto. * vm_insnhelper.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c: rename macro name ENABLE_IC_FOR_IVARko12009-09-061-4/+4
| | | | | | | | to USE_IC_FOR_IVAR. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (setinstancevariable), vm_insnhelper.c (vm_setivar):ko12009-09-061-2/+48
| | | | | | | | fix to use inline cache (trivial optimization). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h (rb_method_definition_t): split from rb_method_entry_tnobu2009-08-281-15/+14
| | | | | | | | | to deal aliases. [ruby-dev:39165] * proc.c (struct METHOD): contains rb_method_entry_t copy. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_cfunc): ensure hook c-return.wanabe2009-08-181-1/+1
| | | | | | | | | | [Bug #1588] * test/ruby/test_settracefunc.rb (TestSetTraceFunc#test_raise): follow above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (opt_eq_func): fix optimization bug. This issueko12009-08-151-23/+12
| | | | | | | | | was found out and debugged with Takuto Hayashi at Security and Programming camp 2009. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (opt_case_dispatch): suppressed a warning.nobu2009-08-131-1/+3
| | | | | | | * vm_insnhelper.c (opt_case_dispatch_i): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h: checkko12009-08-121-0/+18
| | | | | | | | | | | | definition of (classes)#=== for case/when optimization. Fix Bug #1376 [ruby-core:23190]. * string.c (Init_String), bignum.c (Init_Bignum), numeric.c (Init_Numeric): define String#===, Symbol#===, Bignum#===, Fixnum#===, Float#=== as same as (classes)#==. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: reject unused longlife gc.nari2009-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | * debug.c: ditto. * include/ruby/intern.h: ditto. * include/ruby/ruby.h: ditto. * iseq.c: ditto. * node.h: ditto. * vm_insnhelper.c: ditto. * vm_insnhelper.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_cfunc): let set_trace_func use called_idmame2009-07-301-1/+1
| | | | | | | instead of original_id. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h, vm_insnhelper.c (vm_call_method): reviveko12009-07-281-4/+2
| | | | | | | | VM_CALL_OPT_SEND_BIT and use it to recognize "send" method. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method): __send__ can call protectednobu2009-07-261-1/+3
| | | | | | | methods. [ruby-core:24500] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method): fixed indent.nobu2009-07-261-37/+36
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h : Commas at end of enum list not allowed as of C89shyouhei2009-07-221-0/+2
| | | | | | | | | * vm_method.c (rb_add_method): avoid C++ comment * vm_insnhelper.c (vm_call_cfunc): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h, vm_core.h: add rb_method_entry_t. Remove nodes aroundko12009-07-151-114/+122
| | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h, compile.c: declare struct iseq_inline_cache_entry.ko12009-07-131-5/+5
| | | | | | | | | | | | | | Inline cache (IC) entries are no longer GC managed object. IC entries are freed when ISeq is freed. * iseq.c: fix mark, free, memsize functions for above change. * insns.def: remove rb_gc_write_barrier(). * vm_insnhelper.c (vm_method_search): ditto. * tool/instruction.rb, template/insns_info.inc.tmpl (insn_iclen): added. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def, vm_insnhelper.c (getinstancevariable):ko12009-07-131-0/+47
| | | | | | | | | | | | fix to use inline cache. * compile.c: fix to skip inline cache entry (IC). IC is added automatically by compiler. * insns.def, vm_insnhelper.h: fix IC positions. * iseq.c: increment minor_version of ISeq because of above change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_search_superclass): checks for implicitnobu2009-07-101-7/+17
| | | | | | | argument passing before method search. [ruby-core:24244] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_yield_setup_block_args): restores the firstnobu2009-07-041-2/+6
| | | | | | | arg where is overwritten at funcall. [ruby-core:24139] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_setup_method): fixed format spec.nobu2009-06-241-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_long2int, RARRAY_LENINT): check long tonobu2009-05-201-1/+1
| | | | | | | | | cast to int. [ruby-dev:38508] * struct.c, vm_eval.c, vm_insnhelper.c: use RARRAY_LENINT. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c, vm_insnhelper.c: argument number is restricted tonobu2009-05-201-16/+16
| | | | | | | int, and fixed overflow. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (rb_iseq_clone): use longlife object and insert write barrier.nari2009-05-161-2/+2
| | | | | | | | | | * vm_insnhelper.c (vm_cref_push): ditto. * vm_insnhelper.h (COPY_CREF): insert write barrier. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: add longlife garbage collection. [ruby-dev:38423]nari2009-05-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@23421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (rb_vm_get_sourceline), vm_insnhelper.c (vm_throw): usenobu2009-03-121-1/+1
| | | | | | | rb_num_t. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (method_missing): should not pop cfp if missing methodnobu2009-02-221-15/+22
| | | | | | | | | | | | | is method_missing. [ruby-core:22298] * vm_eval.c (rb_raise_method_missing): new function to directly raise NoMethodError. * vm_insnhelper.c (vm_call_method): fixed the case method_missing is missing. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_const_get_0), vm_insnhelper.c (vm_get_ev_const):nobu2009-01-311-0/+3
| | | | | | | avoids infinite self recursion autoload. [ruby-core:21696] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c, eval.c (rb_f_block_given_p): move definition ofko12009-01-191-0/+2
| | | | | | | | | | | | "iterator?" and "block_given?" to make static. * vm.c (vm_get_ruby_level_caller_cfp): make it static. * eval_intern.h, vm_insnhelper.c: move decl. of vm_get_ruby_level_caller_cfp() from eval_intern.h to vm_insnhelper.c. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c: add a prefix "rb_" to exposed functionsko12009-01-191-6/+6
| | | | | | | | | | | | | | | | | vm_get_ruby_level_next_cfp(), rb_vm_make_env_object(), vm_stack_to_heap(), vm_make_proc(), vm_invoke_proc(), vm_get_sourceline(), vm_cref(), vm_localjump_error(), vm_make_jump_tag_but_local_jump(), vm_jump_tag_but_local_jump(). This changes may affect only core because most of renamed functions require a pointer of not-exposed struct such as rb_thread_t or NODE. In short, they are core functions. * cont.c, eval.c, eval_intern.h, load.c, proc.c, thread.c, vm_core.h, vm_dump.c, vm_eval.c, vm_exec.c, vm_insnhelper.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_yield_with_cfunc): rename parameter nameko12008-12-271-5/+5
| | | | | | | | "blockptr" to "blockargptr". git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method, vm_call_cfunc): use original id instead ofko12008-12-271-4/+4
| | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@21084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_method_search): fix control flow bug.ko12008-12-251-8/+6
| | | | | | | | (commited at r20981) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_method_search): return rb_cObject if there is noko12008-12-251-3/+7
| | | | | | | | | super class. [ruby-dev:37587] * bootstraptest/test_method.rb: add tests for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_yield_with_cfunc): check block has Proc.ko12008-12-251-1/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (invoke_block_from_c): fix to point right cfp.ko12008-12-241-5/+2
| | | | | | | | | | * vm.c (vm_make_proc, vm_make_proc_from_block), vm_core.h: remove unused parameter cfp. * vm_insnhelper.c, proc.c (proc_new): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method): use class of method definedko12008-12-241-4/+5
| | | | | | | | | | | | instead of receiver's class on bmethod. fixes [ruby-core:20786] * bootstraptest/test_method.rb: add a test for above. * vm_insnhelper.c (vm_setup_method): remove unused parameter klass. * vm_insnhelper.h (CALL_METHOD): ditto. * insns.def, vm_eval.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_callee_setup_arg_complex): uses cfp fromnobu2008-12-151-1/+2
| | | | | | | blockptr instead of the current cfp. [ruby-core:20544] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (check_cfunc): use function pointer.nobu2008-12-091-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * README.EXT, README.EXT.ja, vm_exec.c, vm_insnhelper.c: updatemame2008-11-141-1/+1
| | | | | | | filenames. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_yield_setup_args): supports optional parameters.yugui2008-10-271-96/+145
| | | | | | | | | | | | | | Fixed [ruby-core:19503]. * vm_insnhelper.c (vm_yield_setup_block_args): a new function. extracted from vm_yield_setup_args. * vm_insnhelper.c (vm_yield_setup_block_args_complex): ditto. * test/ruby/test_proc.rb: added tests for arguments on a Proc from Kernel#proc called. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e