aboutsummaryrefslogtreecommitdiffstats
path: root/template
Commit message (Collapse)AuthorAgeFilesLines
...
* delete tool/instruction.rbshyouhei2018-01-0911-887/+0
| | | | | | | | | | | | | | | | | | | | | | | 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
* insns_info.inc.tmpl: split rb_vm_insn_name_infonobu2018-01-091-3/+16
| | | | | | | * template/insns_info.inc.tmpl (rb_vm_insn_name_info): split instruction names pool not to exceed C90 limit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make rb_iseq_new* accept rb_ast_body_t instead of NODE*mame2018-01-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* node.h: define rb_ast_body_t and restructure rb_ast_tmame2018-01-051-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* insns_info.inc.tmpl: share large tablesenobu2018-01-041-10/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* insns_info.inc: position independentnobu2018-01-041-12/+8
| | | | | | | * template/insns_info.inc.tmpl (insn_name_info): make position independent for large strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string literal longer than 509 characters is a C99ismshyouhei2018-01-021-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.c.tmpl: get rid of warnings on old gccnobu2017-12-311-2/+2
| | | | | | | | * template/prelude.c.tmpl: ignore missing-field-initializers on old gcc, e.g. 4.4, which does not support pushing/popping diagnostics. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.c.tmpl: get rid of errors with old gccnobu2017-12-251-6/+6
| | | | | | | * template/prelude.c.tmpl: moved diagnostic pragmas outside prelude_eval() for very old gcc. [ruby-core:84449] [Bug #14234] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.c.tmpl: static literalsnobu2017-12-251-7/+8
| | | | | | | * template/prelude.c.tmpl (PRELUDE_STR): make string objects with static literals not to copy them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.c.tmpl: fix optimization optionsnobu2017-12-251-1/+9
| | | | | | | | * template/prelude.c.tmpl (prelude_eval): fix optimization options. trace_instruction member has been removed. filled coverage_enabled and debug_level members instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.c.tmpl: fix line numbernobu2017-12-061-1/+1
| | | | | | | * template/prelude.c.tmpl (Init_prelude): fix line number of preludes. line of prelude_eval is an int, not a VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix for emoji-data.txtnobu2017-12-021-1/+1
| | | | | | | | | | | * common.mk: download emoji-data.txt. As emoji data files are located in a separate directory in Unicode.org site, reearranged Unicode data files directories same as the site. * tool/enc-unicode.rb (get_file): search emoji data files in the second argument path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.c.tmpl: escape commentsnobu2017-12-011-5/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prelude.c.tmpl: split prelude codenobu2017-12-011-10/+38
| | | | | | | | * template/prelude.c.tmpl: split prelude code into blocks so that each elements do not exceed the string literal size limit in C89. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r60873usa2017-12-011-1/+0
| | | | | | | | * template/prelude.c.tmpl (translate): revert r60873 because when some errors or warnings are shown their line numbers are shifted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Skip comment linesusa2017-11-211-0/+1
| | | | | | | | * template/prelude.c.tmpl (translate): empty (only LF) lines are not necessary. so skip them, but for safety only when they are made from comment line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: operand lvarnobu2017-11-091-0/+24
| | | | | | | * iseq.c (rb_insn_operand_intern): show local variable operand name in unified instructions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * node.h (ast_t): renamed to `rb_ast_t`.ko12017-10-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Revert "Manage AST NODEs out of GC""mame2017-10-271-3/+7
| | | | | | | This re-introduces r60485. This reverts commit 5a176b75b1187cbd3861c387bde65ff66396a07c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Manage AST NODEs out of GC"mame2017-10-271-7/+3
| | | | | | This reverts commit 620ba74778bfdbdc34ffbb142d49ce84a0ef58e9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Manage AST NODEs out of GCmame2017-10-271-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NODEs in AST are no longer objects managed by GC. This change will remove the restriction imposed by the GC. For example, a NODE can use more than five words (this is my primary purpose; we want to store the position data for each NODE, for coverage library), or even a NODE can have variable length (some kinds of NODEs have unused fields). To do this, however, we need more work, since Ripper still uses T_NODE objects managed by the GC. The life time of NODEs is more obvious than other kinds of objects; they are created at parsing, and they become disused immediately after compilation. This change releases all NODEs by a few `xfree`s after compilation, so performance will be improved a bit. In extreme example, `eval("x=1;" * 10000000)` runs much faster (40 sec. -> 7.8 sec. on my machine). The most important part of this change is `ast_t` struct, which has three contents: (1) NODE buffer (malloc'ed memory), (2) a reference to the root NODE, and (3) an array that contains objects that must be marked during parsing (such as literal objects). Some functions that had received `NODE*` arguments, must now receive `ast_t*`. * node.c, node.h: defines `ast_t` struct and related operations. * gc.c, internal.h: defines `imemo_ast`. * parse.y: makes `parser_params` struct have a reference to `ast_t`. Instead of `rb_node_newnode`, use `rb_ast_newnode` to create a NODE. * iseq.c, load.c, ruby.c, template/prelude.c.tmpl: modifies some functions to handle `ast_t*` instead of `NODE*`. * test/ruby/test_gc.rb: ad-hoc fix for a failed test. The test assumes GC eden is increased at startup by NODE object creation. However, this change now create no NODE object, so GC eden is not necessarily increased. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix missing variables in ruby.pcnobu2017-10-161-0/+2
| | | | | | | | | | * configure.ac (LIBRUBY_SO): get rid of referrence to LIBRUBY_SONAME which is not present in ruby.pc. * template/ruby.pc.in (RUBY_API_VERSION, SOEXT): add new variables. [ruby-core:83208] [Bug #14002] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* verconf.h.tmpl: site and vendor directoriesnobu2017-10-091-2/+2
| | | | | | | | * template/verconf.h.tmpl: disable site and vendor directories when removed. based on the path by arnoldwald (arnold w) at [ruby-core:81563]. [Bug #13631] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sizes.c.tmpl: prototypenobu2017-09-291-1/+1
| | | | | | | * template/sizes.c.tmpl (Init_limits): turned a K&R style declaration into a prototype declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby-runner.c: RUBYLIBnobu2017-09-241-0/+4
| | | | | | | | | * ruby-runner.c (insert_env_path): extracted the function which insert path list to an environment variable. * ruby-runner.c (main): append library paths to RUBYLIB. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* pack insn_operand_info and insn_len_infonobu2017-08-221-13/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* pack insns_name_infonobu2017-08-221-5/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/instruction.rb: move logics to templatesnobu2017-08-227-47/+124
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* insns.inc.tmpl: ensure info sizenobu2017-08-225-0/+15
| | | | | | | * template/insns.inc.tmpl (ASSERT_VM_INSTRUCTION_SIZE): static assertion for VM instruction info tables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2017-07-221-34/+34
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add documentsyugui2017-07-221-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * template/exts.mk.tmpl: extract SUBMAKEOPTS from sub exts.mk files too. ↵nobu2017-07-081-6/+1
| | | | | | [Bug #13730] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* exts.mk.tmpl: fix multiple rubiesnobu2017-05-141-0/+3
| | | | | | | * template/exts.mk.tmpl: get rid of making multiple rubies simultaneously. it can cause making libruby in parallel. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress warning: shadowing outer local variablenaruse2017-04-231-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* exts.mk: refine notes [Feature #13302]nobu2017-04-211-17/+17
| | | | | | | | | | * ext/extmk.rb: split notes into header and footer, which are common, from bodies which are unique for each extensions. * template/exts.mk.tmpl: now each notes are not one line, should not unique. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk: separate notenobu2017-04-201-1/+1
| | | | | | | * common.mk (build-ext): separate note from building extensions, not to be intermingled. [ruby-core:80759] [Feature #13302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extmk.rb: fail for mandatory librariesnobu2017-04-201-1/+5
| | | | | | | | | * ext/extmk.rb: fail if a mandatory extension library failed to configure. [ruby-core:80759] [Feature #13302] * template/exts.mk.tmpl: move `exit` at the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* nodoc UnicodeNormalize modulestomar2017-04-121-1/+1
| | | | | | | | | * lib/unicode_normalize/normalize.rb: [DOC] nodoc the internal UnicodeNormalize module. * lib/unicode_normalize/tables.rb: ditto. * template/unicode_norm_gen.tmpl: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Freeze RbConfig::SIZEOF and RbConfig::LIMITSnobu2017-04-062-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rename RbConfig::Limits as RbConfig::LIMITSnobu2017-04-061-1/+1
| | | | | | | | * template/limits.c.tmpl (Init_limits): rename RbConfig::Limits as RbConfig::LIMITS, constants other than class or module are all uppercase with underscores by convention. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* exts.mk.tmpl: note footer [ci skip]nobu2017-03-311-1/+3
| | | | | | * template/exts.mk.tmpl: place note footer message at the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* MINIRUBY for cross-complingnobu2017-03-031-0/+1
| | | | | | | * template/configure-ext.mk.tmpl (EXTMK_ARGS): add MINIRUBY for cross-compling, which is used in extmk.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Makefile.in: by exts.mknobu2017-02-271-0/+9
| | | | | | * Makefile.in (clean-ext): recurse by exts.mk in parallel first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: TOKEN2IDnobu2017-02-111-7/+19
| | | | | | | | | * parse.y (TOKEN2ID): add macro which maps static tokens to IDs. * template/id.h.tmpl (TOKEN2*ID, DEFINE_*ID_FROM_TOKEN): separate into macros, token to ID mapping and enum definitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* MFLAGS for nmakenobu2017-02-102-8/+10
| | | | | | | | | | | | * common.mk (mflags): pass make flags to sub-makes, for nmake which cannot pass them by the environment variable. * defs/gmake.mk (mflags): filter out -j option for sub-makes. * template/exts.mk.tmpl (MFLAGS): extract MFLAGS from sub extmk files for nmake. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk: remove explicit MFLAGSnobu2017-02-011-3/+3
| | | | | | | | | | It is unnecessary to pass MFLAGS to sub-makes, because it is evaluated implicitly if set by make. GNU make 4.2 sets both of -jN and --jobserver-auth (or --jobserver-fds in older versions) options which conflict. And it is useless for command line macros since Microsoft NMAKE does not set them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* limits.c.tmpl: fallback ULLONG_MAXnobu2017-01-311-0/+3
| | | | | | | * template/limits.c.tmpl (ULLONG_MAX): add a fallback definition. On old CentOS lacks ULLONG_MAX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make FIXNUM_MAX visible from Rubyshyouhei2017-01-302-0/+95
| | | | | | | | | | | | | | | | | | Because our tests now have several places where FIXNUM_MAX is needed, we decided to provide it along with several other constants. * template/limits.c.tmpl: new file, defining RbConfig::Limits * ext/rbconfig/sizeof/depend (limits.c): rule to generate limits.c * test/-ext-/num2int/test_num2int.rb: use RbConfig::Limits * bootstraptest/test_insns.rb: ditto. * .gitignore: ignore new generated file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extmk.rb: remove clean and install modenobu2017-01-281-1/+1
| | | | | | | * ext/extmk.rb (parse_args): remove clean and install mode, now configure mode only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e