summaryrefslogtreecommitdiffstats
path: root/insns.def
Commit message (Collapse)AuthorAgeFilesLines
* * insns.def (defined): should respect #respond_to_missing? asmatz2009-12-041-0/+2
| | | | | | #respond_to? does. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (defined): adjust indent.nobu2009-12-041-32/+32
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (compile_cpath, iseq_compile_each): revertedshugo2009-12-031-1/+4
| | | | | | | | | | | | | | 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-3/+3
| | | | | | | | | | 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
* * compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu2009-09-211-5/+5
| | | | | | | | | 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-5/+5
| | | | | | | | | | 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
* * iseq.c (iseq_mark): no need to mark inline cache entries.ko12009-09-081-0/+4
| | | | | | | | | * insns.def (onceinlinecache, setinlinecache): save a value to mark cached value. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (opt_*): add IC operands.ko12009-09-061-18/+18
| | | | | | | | | | | | | * vm_insnhelper.h (CALL_SIMPLE_METHOD): add a version which use an inline cache. USE_IC_FOR_SPECIALIZED_METHOD macro switchs the behaviour. This change also removes CALL_SIMPLE_METHOD_IC() macro. * tool/instruction.rb: fix elimination process to ignore variable "ic". git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.h (CALL_SIMPLE_METHOD_IC): make a macroko12009-09-061-4/+4
| | | | | | | | | invoke simple method with inline cache entry. * insns.def (opt_length, opt_size): fix to use inline method cache. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_specialized_instruction), insns.def (opt_size):ko12009-09-061-2/+35
| | | | | | | | | optimize #size methods (by specialized instruction). * id.c, id.h, vm.c, vm_insnhelper.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (setinstancevariable), vm_insnhelper.c (vm_setivar):ko12009-09-061-2/+2
| | | | | | | | fix to use inline cache (trivial optimization). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (opt_case_dispatch): suppressed a warning.nobu2009-08-131-1/+1
| | | | | | | * 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-4/+15
| | | | | | | | | | | | 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
* * insns.def (defineclass): preserve encoding of class/modulenobu2009-07-301-2/+2
| | | | | | | | | | names. [ruby-core:24600] * variable.c (rb_set_class_path_string): set class path with a string value. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * node.h, vm_core.h, variable.c: rename global_entry to rb_global_entry.ko12009-07-161-1/+1
| | | | | | | | * compile.c, insns.def, iseq.c, vm_insnhelper.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h, vm_core.h: add rb_method_entry_t. Remove nodes aroundko12009-07-151-21/+15
| | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | 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-4/+4
| | | | | | | | | | | | 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
* * insns.def, tool/instruction.rb: fixed types.nobu2009-06-301-12/+13
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: add longlife garbage collection. [ruby-dev:38423]nari2009-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* * array.c, bignum.c, gc.c, numeric.c, string.c, util.c, insns.def,nobu2009-03-101-2/+2
| | | | | | | missing/crypt.c, missing/vsnprintf.c, : suppress warnings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_eq, flo_gt, flo_ge, flo_lt, flo_le, flo_eql): revertusa2009-02-271-2/+14
| | | | | | | | | | isnan() checks for VC++6. * insns.def (opt_lt, opt_gt): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (opt_minus): inline float operation.matz2009-02-231-0/+45
| | | | | | * insns.def (opt_lt, opt_gt): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_resurrect), string.c (rb_str_resurrect): newnobu2009-02-181-2/+2
| | | | | | | | | | | functions based on [ruby-dev:37983] * insns.def (putstring, duparray): use rb_{ary,str}_resurrect(). * iseq.c (iseq_data_to_ary): needs to result TS_VALUE. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (defineclass): try to autoload const to be overridden.nobu2009-02-121-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (compile_array_, defined_expr, iseq_compile_each): hidenobu2009-02-121-2/+2
| | | | | | | | | | | | | | and freeze internal literal objects, to prevent from modifying. [ruby-dev:37959] * iseq.c (insn_operand_intern): copy internal literal objects. * insns.def (putstring, duparray): ditto. * string.c (rb_str_replace): exported. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (setspecial, putstring): fixed typos in rdoc.nobu2009-02-111-4/+4
| | | | | | | | * insns.def (toregexp): uses rb_ary_tmp_new(), and clears it after used. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (rb_vm_inc_const_missing_count, ruby_vm_const_missing_count):ko12009-01-151-1/+2
| | | | | | | | | | | | added. * vm_insnhelper.h: ditto. * variable.c (rb_const_get_0), insns.def: Constants should not be cached if const_missing is called. [ruby-core:21059] [Bug #967] * bootstraptest/test_class.rb: add a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method): use class of method definedko12008-12-241-2/+2
| | | | | | | | | | | | 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
* * include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz2008-09-051-4/+4
| | | | | | | a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (sizeof ptrdiff_t): check for size of ptrdiff_t.nobu2008-07-121-1/+1
| | | | | | | | | | | | | * include/ruby/ruby.h (PRI?PTRDIFF, PRI?SIZE): printf conversion specifiers for ptrdiff_t and size_t/ssize_t. * insns.def (leave), marshal.c (long_toobig), transcode.c (str_transcode), vm_dump.c (control_frame_dump, stack_dump_each), (debug_print_register, debug_print_pre): t and z length modifiers are C99. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/coverage/coverage.c, ext/coverage/extconf.rb: eliminatemame2008-07-031-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | COVERAGE__ and introduce coverage.so instead. How to measure coverage: (1) require "coverage.so", (2) require or load Ruby source file, and (3) Coverage.result will return the same hash as COVERAGE__. [ruby-dev:35324] * thread.c (rb_enable_coverages): start coverage measurement by using rb_add_event_hook. * thread.c (rb_get_coverages): returns current results of coverage measurement. * include/ruby/intern.h: add prototype for above two functions. * vm_core.h, vm.c: add field of coverages to rb_vm_t. * insns.def (trace): remove special handling for COVERAGE__. * iseq.c (prepare_iseq_build): switch COVERAGE__ to rb_get_coverages(). * parse.y (coverage): ditto. * thread.c (clear_coverage): ditto. * lib/coverage.rb: use coverage.so instead of COVERAGE__. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.h, insns.def: reduce insn operand of "trace".ko12008-07-011-11/+17
| | | | | | | | * include/ruby/ruby.h: add RUBY_EVENT_COVERAGE event. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (trace): C99ism.usa2008-07-011-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Add coverage measurement constant COVERAGE__. This constant is notmame2008-07-011-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for casual use. Usage: (1) assign {} to COVERAGE__, (2) require or load Ruby source file, and (3) COVERAGE__["sourcefilepath"] will return an array whose elements represent number of executions per line of source code. * vm_core.h: add field of coverage array to iseq. * iseq.c (prepare_iseq_build): ditto. * insns.def (trace): update coverage array. * parse.y (coverage): create and initialize coverage array. * compile.h (ADD_TRACE): add trace instruction to update covearge array. * thread.c (clear_coverage): delete coverage array when forking. Otherwise, double count of coverage may occur. * lib/coverage.rb: sample coverage measurement tool. * error.c: distinguish explicitly between parse_in_eval and mild_compile_error. * load.c: ditto. * vm_eval.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, vm.c, insns.def: call FrozenCore.set_postexe methodko12008-07-011-23/+0
| | | | | | | | | instead to use "postexe" insn. * id.c, id.h: add a prepared id for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, insns.def, vm.c, vm_core.h: remove some insnsko12008-07-011-63/+36
| | | | | | | | | | | | (undef, alias, definemethod). Call RubyVM::FrozenCore's singleton method instead. Add "putiseq" and "putspecialobject" instructions. * id.c, id.h: add ids for above. * tool/parse.rb: "VM" no longer exists. Use RubyVM instead. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c, eval_intern.h (PASS_PASSED_BLOCK):ko12008-06-101-1/+1
| | | | | | | | | | | | | | | set a VM_FRAME_FLAG_PASSED flag to skip this frame when searching ruby-level-cfp. * eval.c, eval_intern.h, proc.c: fix to check cfp. if there is no valid ruby-level-cfp, cause RuntimeError exception. [ruby-dev:34128] * vm_core.h, vm_evalbody.c, vm.c, vm_dump.c, vm_insnhelper.c, insns.def: rename FRAME_MAGIC_* to VM_FRAME_MAGIC_*. * KNOWNBUGS.rb, bootstraptest/test*.rb: move solved bugs. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (DEFINE_INSN): subtract of pointers is ptrdiff_t.naruse2008-06-011-1/+1
| | | | | | | | | | | | | | | | this is not int on 64bit system. * vm_dump.c (control_frame_dump): ditto. * vm_dump.c (stack_dump_each): ditto. * vm_dump.c (debug_print_register): ditto. * vm_dump.c (debug_print_pre): ditto. * transcode.c (str_transcode): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings with -Wwrite-string.nobu2008-05-311-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (opt_gt|ge|lt|le): use values directly to compare.ko12008-05-221-4/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (newhash): fix a variable definition: "const k".akr2008-05-221-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def, vm_insnhelper.c: specify "const".ko12008-05-211-13/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c, insns.def, eval.c, vm_insnhelper.c: fix CREF handling.ko12008-05-191-9/+11
| | | | | | | | | | | | | | VM value stack frame of block contains cref information. (dfp[-1] points CREF) * compile.c, eval_intern.h, eval_method.c, load.c, proc.c, vm_dump.h, vm_core.h: ditto. * include/ruby/ruby.h, gc.c: remove T_VALUES because of above changes. * bootstraptest/test_eval.rb, test_knownbug.rb: move solved test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def: add a "putcbase" instruction.ko12008-05-141-23/+17
| | | | | | | | | * compile.c, insns.def: fix to use putcbase instruction for class search. Qundef should not be used. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each): should call compile_cpath() formatz2008-05-051-1/+4
| | | | | | | | modules as well. [ruby-dev:34585] * insns.def (defineclass): add undef handling. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (defineclass): was using wrong variable. [ruby-dev:34592]matz2008-05-051-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (compile_cpath): use Qundef to denote cbase lookup.matz2008-05-051-16/+9
| | | | | | | | | | | * insns.def (defineclass): Qudef is passed for cbase. * insns.def (setconstant): ditto. * vm_insnhelper.c (vm_check_if_namespace): use rb_inspect() instead of rb_obj_as_string() for better description. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (defineclass): check if cbase is a class or a module.nobu2008-04-031-0/+4
| | | | | | | [ruby-core:16118] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_exec_node): no thread starts inside iseq compilation.nobu2008-02-191-1/+1
| | | | | | | | | * eval.c (rb_f_raise): skip current control frame. [ruby-core:15589] * insns.def (opt_div): raise as the ordinary method. [ruby-core:15589] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e