summaryrefslogtreecommitdiff
path: root/tool/instruction.rb
AgeCommit message (Collapse)Author
2018-01-12delete tool/instruction.rb (2nd try)shyouhei
Previous commit changed insns.def format. Now is the time for its generators. In doing so I chose to modernize the system, not just patch. My attempt includes - extensive use of Onigumo regular expressions - split from one big file (instruction.rb) into separated MVC - partial view Also, let me take this opportunity to kill old unused features such as - stack caching - minsns / yasmdata which are never seriously used - yarvarch document generation (moved to doc/) - vast majority of unused arguments to insns2vm.rb This commit generates VM source codes that cleanly compile, and the generated binary passes tests. At least for me. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12new insns.def format (2nd try)shyouhei
- Gave up @j comments - Room for sp_inc to be a proper grammer element git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-10merge revisions 61753:61750 61747:61740 61737:61728shyouhei
Revert all the VM generator rewrites; requested by naruse git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09delete tool/instruction.rbshyouhei
Previous commit changed insns.def format. Now is the time for its generators. In doing so I chose to modernize the system, not just patch. My attempt includes - extensive use of Onigumo regular expressions - split from one big file (instruction.rb) into separated MVC - partial view Also, let me take this opportunity to kill old unused features such as - stack caching - minsns / yasmdata which are never seriously used - yarvarch document generation (moved to doc/) - vast majority of unused arguments to insns2vm.rb This commit generates VM source codes that cleanly compile, and the generated binary passes tests. At least for me. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09new insns.def formatshyouhei
- Gave up @j comments - Room for sp_inc to be a proper grammer element git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11vm_exec.h: introduce macros for abstarction.ko1
* vm_exec.h: declare two macros * START_OF_ORIGINAL_INSN() * DISPATCH_ORIGINAL_INSN() instead of inserting label and goto lines. For OPT_CALL_THREADED_CODE, first macro is empty and second macro is simply call the original insn function. * tool/instruction.rb: use above macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-14remove `trace` instruction. [Feature #14104]ko1
* tool/instruction.rb: create `trace_` prefix instructions. * compile.c (ADD_TRACE): do not add `trace` instructions but add TRACE link elements. TRACE elements will be unified with a next instruction as instruction information. * vm_trace.c (update_global_event_hook): modify all ISeqs when hooks are enabled. * iseq.c (rb_iseq_trace_set): added to toggle `trace_` instructions. * vm_insnhelper.c (vm_trace): added. This function is a body of `trace_` prefix instructions. * vm_insnhelper.h (JUMP): save PC to a control frame. * insns.def (trace): removed. * vm_exec.h (INSN_ENTRY_SIG): add debug output (disabled). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22tool/instruction.rb: move logics to templatesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07fix macro namenobu
* tool/instruction.rb (VmBodyGenerator#make_header_prepare_stack): REG_CFP has been prefixed with VM_ at r56609. [Bug #12527] * tool/instruction.rb (VmBodyGenerator#make_footer_stack_val): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-02tool: add descriptions and fix typosnormal
* tool/asm_parse.rb: add description * tool/change_maker.rb: ditto * tool/downloader.rb: ditto * tool/eval.rb: ditto * tool/expand-config.rb: ditto * tool/extlibs.rb: ditto * tool/fake.rb: ditto * tool/file2lastrev.rb: ditto * tool/gem-unpack.rb: ditto * tool/gen_dummy_probes.rb: ditto * tool/gen_ruby_tapset.rb: ditto * tool/generic_erb.rb: ditto * tool/id2token.rb: ditto * tool/ifchange: ditto * tool/insns2vm.rb: ditto * tool/instruction.rb: ditto * tool/jisx0208.rb: ditto * tool/merger.rb: ditto * tool/mkrunnable.rb: ditto * tool/node_name.rb: ditto * tool/parse.rb: ditto * tool/rbinstall.rb: ditto * tool/rbuninstall.rb: ditto * tool/rmdirs: ditto * tool/runruby.rb: ditto * tool/strip-rdoc.rb: ditto * tool/vcs.rb: ditto * tool/vtlh.rb: ditto * tool/ytab.sed: ditto * tool/enc-unicode.rb: fix typo * tool/mk_call_iseq_optimized.rb: ditto * tool/update-deps: ditto [ruby-core:76215] [Bug #12539] by Noah Gibbs <the.codefolio.guy@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-27* tool/instruction.rb: fix to follow current implementation.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-19* vm_core.h: split rb_call_info_t into several structs.ko1
* rb_call_info (ci) has compiled fixed information. * if ci->flag & VM_CALL_KWARG, then rb_call_info is also rb_call_info_with_kwarg. This technique reduce one word for major rb_call_info data. * rb_calling_info has temporary data (argc, blockptr, recv). for each method dispatch. This data is allocated only on machine stack. * rb_call_cache is for inline method cache. Before this patch, only rb_call_info_t data is passed. After this patch, above three structs are passed. This patch improves: * data locarity (rb_call_info is now read-only data). * reduce memory consumption (rb_call_info_with_kwarg, rb_calling_info). * compile.c: use above data. * insns.def: ditto. * iseq.c: ditto. * vm_args.c: ditto. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. * vm_insnhelper.h: ditto. * iseq.h: add iseq_compile_data::ci_index and iseq_compile_data::ci_kw_indx. * tool/instruction.rb: introduce TS_CALLCACHE operand type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-02tool/instruction.rb: remove extra blank linesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-02tool/instruction.rb: remove trailing spacesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-14vm.inc.tmpl + instruction.rb: typo fixesnormal
* template/vm.inc.tmpl: "insns.c" => "insns.def" * tool/instruction.rb: typo fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-14[DOC] Correct a couple of typos in comments by @dvsuresh [Fixes GH-482]a_matsuda
* doc/ChangeLog-YARV: Correct a typo in comment * lib/rubygems/specification.rb: ditto. * test/rexml/data/tutorial.xml: ditto. * test/ruby/test_settracefunc.rb: ditto. * tool/instruction.rb: ditto. https://github.com/ruby/ruby/pull/482 [ci-skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-20 * tool/instruction.rb : fix typo.tarui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26* vm_exec.h, tool/instruction.rb: not an error, but a BUG if stackko1
overflow checking failed just before/after the beginning of an instruction. It should be treated as a BUG. Please tell us if your code cause BUG with this problem. This check will removed soon (for performance). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-25* vm_core.h, eval_intern.h (CHECK_STACK_OVERFLOW): moveko1
CHECK_STACK_OVERFLOW() to vm_core.h and rename to CHECK_VM_STACK_OVERFLOW(). This change is only move and rename. * tool/instruction.rb: catch up above changes. * vm.c, vm_insnhelper.c: ditto. * vm_insnhelper.c (vm_stackoverflow): add a function to unify raising vm stackoverflow exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29tool/vpath.rbnobu
* tool/generic_erb.rb, tool/id2token.rb: add --path-separator option for mingw where make and built ruby live in different world. * tool/vpath.rb: extract from tool/instruction.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-14remove garbage linenobu
* compile.c (new_insn_send): remove garbage line. * tool/instruction.rb (sp_increase_c_expr): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-14* insns.def (send, invokesuper, invokeblock, opt_*), vm_core.h:ko1
use only a `ci' (rb_call_info_t) parameter instead of using parameters such as `op_id', 'op_argc', `blockiseq' and flag. These information are stored in rb_call_info_t at the compile time. This technique simplifies parameter passings at related function calls (~10% speedups for simple mehtod invocation at my machine). `rb_call_info_t' also has new function pointer variable `call'. This `call' variable enables to customize method (block) invocation process for each place. However, it always call `vm_call_general()' at this changes. `rb_call_info_t' also has temporary variables for method (block) invocation. * vm_core.h, compile.c, insns.def: introduce VM_CALL_ARGS_SKIP_SETUP VM_CALL macro. This flag indicates that this call can skip caller_setup (block arg and splat arg). * compile.c: catch up above changes. * iseq.c: catch up above changes (especially for TS_CALLINFO). * tool/instruction.rb: catch up above chagnes. * vm_insnhelper.c, vm_insnhelper.h: ditto. Macros and functions parameters are changed. * vm_eval.c (vm_call0): ditto (it will be rewriten soon). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-09* vm_core.h (rb_call_info_t): add new type `rb_call_inf_t'.ko1
This data structure contains information including inline method cache. After that, `struct iseq_inline_cache_entry' does not need to contain inline cache for method invocation. Other information will be added to this data structure. * vm_core.h (rb_iseq_t): add `callinfo_entries' and `callinfo_size' members to `rb_iseq_t'. * insns.def, compile.c: Use CALL_INFO instead of IC. * tool/instruction.rb: support CALL_INFO as operand type. * vm_insnhelper.c, vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-04* insns.def (getlocal, setlocal): remove old getlocal/setlocalko1
instructions and rename getdaynmic/setdynamic instructions to getlocal/setlocal. * compile.c: ditto. * iseq.c: remove TS_DINDEX. * vm_exec.h (dindex_t): remove type definition of `dindex_t'. * tool/instruction.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-04* vm.c (VM_COLLECT_USAGE_DETAILS): make new VM usage analysisko1
hooks (old macro name is COLLECT_USAGE_ANALYSIS). This feature is only for VM developers. (I'm not sure I can use `VM developers' (the plural form) in this sentence). If VM_COLLECT_USAGE_DETAILS is not 0, VM enables the following usage collection features: (1) insntruction: collect intruction usages. (2) operand: collect operand usages. (3) register: collect register usages. The results are stored in RubyVM::USAGE_ANALYSIS_INSN for (1, 2), RubyVM::USAGE_ANALYSIS_INSN_BIGRAM for (1) and RubyVM::USAGE_ANALYSIS_REGS for (3). You can stop collecting usages with RubyVM::USAGE_ANALYSIS_INSN_STOP(), RubyVM::USAGE_ANALYSIS_OPERAND_STOP(), RubyVM::USAGE_ANALYSIS_REGISTER_STOP() for (1), (2), (3) respectively. You can also change the hook functions by setting C level global variables `ruby_vm_collect_usage_func_(insn|operand|register)' for (1), (2), (3) respectively. See codes for more details. * tool/instruction.rb: fix macro names. * iseq.c (insn_operand_intern): make it export (used in vm.c). fix to skip several processes if not needed (pointer is 0). * vm_dump.c: move codes for collection features to vm.c. * vm_exec.h: rename macro and function names. * vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-24* insns.def: Change the operand type of setinlinecacheko1
(OFFSET to IC). This IC must be same as corresponding getinlinecache instruction's IC operand. This change is for a little performance improvement (getting IC directly) and is for the AOT compilation development. * compile.c, iseq.c, insns.def: Change the approach to handling inline cahce (IC) type operand to enable the above change. This change also affects ISeq#to_a method. The inline cache operand will be dumped by fixnum, the index of inline cache, in other words, inline cache identity. * template/insns_info.inc.tmpl, tool/instruction.rb: No need to count inline cache size (insn_iclen()). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-23* tool/instruction.rb (make_header_prepare_stack): check stacknobu
overflow. [ruby-core:25714] * tool/instruction.rb (make_footer_stack_val): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21* tool/instruction.rb (make_insn_operand_optimized): fixed typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-06* insns.def (opt_*): add IC operands.ko1
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@24778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-02* tool/instruction.rb: executable.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-01* tool/instruction.rb (RubyVM::InstructionsLoader#make_stackcaching_insns):nobu
simplified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-13* vm_core.h, compile.c: declare struct iseq_inline_cache_entry.ko1
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@24085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-30* insns.def, tool/instruction.rb: fixed types.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-18* keywords, lex.c.src, opt_insn_unif.def, opt_operand.def: moved rarely changedyugui
input files for code generators into defs/ directory. * Makefile.in (lex.c): followed keywords and lex.c.src. * common.mk (parser.o): followed keywords. (INSNS): followed opt_*.def * tools/instruction.rb: followed opt_*.def. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01* tool/instruction.rb: RubyVM is not module.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-23* vm_core.h (rb_num_t): moved form vm.h.nobu
* tool/instruction.rb (RubyVM::Instruction#sp_increase_c_expr), tool/instruction.rb (RubyVM::VmBodyGenerator#make_header_operands): omit unused variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-03* compile.c (iseq_set_sequence, iseq_insns_unification,nobu
insn_data_to_s_detail): constified. * iseq.c (insn_operand_intern, ruby_iseq_disasm_insn): ditto. * template/{insns_info,opt_sc,optunifs}.inc.tmpl: ditto. * tool/instruction.rb (OptUnifsIncGenerator): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22* tool/insns2vm.rb: moved from lib/vm/instruction.rb.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e