Граф коммитов

239 Коммитов

Автор SHA1 Сообщение Дата
nobu bb3db69e2a configure.ac: library options to MAINLIBS
* configure.ac (MAINLIBS): moved library options for main program
  and static libruby, and append MAINLIBS to LIBRUBYARG_STATIC, as
  these libraries are not needed for linking to shared libruby.
  [ruby-core:85882] [Bug #14422]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-02 01:37:53 +00:00
nobu 14693ba549 Escape MINIRUBY in --make-flags to extmk.rb
If MINIRUBY had arguments, which is the case of cross compiling
they wouldn't be parsed correctly and compiling would fail as a RUBY
without arguments would then be present in the Makefile's in ext/*
[ruby-core:85620] [Bug #14486] [Fix GH-1819]

Author:    Carl Hörberg <carl.hoerberg@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-19 01:45:17 +00:00
nobu 4b8719c1cd MJIT header for multiarch
* configure.ac: MJIT_HEADER_INSTALL_DIR to rubyarchhdrdir to
  support multiarch.

* Makefile.in (MJIT_HEADER_INSTALL_DIR): configured by multiarch.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-08 15:19:32 +00:00
nobu 88035b9979 mjit headers for universal binary
* common.mk (MJIT_HEADER, MJIT_MIN_HEADER): added hook to separate
  intermediate headers per archs.

* defs/gmake.mk: build mjit headers per -arch options, and then
  merge the headers with `#ifdef`s.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-06 03:19:42 +00:00
hsbt 4b190c4852 Fix a typo.
* template/unicode_norm_gen.tmpl: ouput -> output

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-12 13:05:09 +00:00
shyouhei f6ea376317 delete tool/instruction.rb (2nd try)
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-12 08:38:09 +00:00
shyouhei 5ad95486e6 merge revisions 61753:61750 61747:61740 61737:61728
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-10 01:53:24 +00:00
shyouhei 55317a74f7 delete tool/instruction.rb
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-09 13:30:31 +00:00
nobu d68a3d3bc1 insns_info.inc.tmpl: split rb_vm_insn_name_info
* 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
2018-01-09 12:26:23 +00:00
mame 92b81dc597 make rb_iseq_new* accept rb_ast_body_t instead of NODE*
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05 08:59:22 +00:00
mame 503b858cef node.h: define rb_ast_body_t and restructure rb_ast_t
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05 08:59:20 +00:00
nobu 9edca48cff insns_info.inc.tmpl: share large tablese
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-04 01:46:01 +00:00
nobu 7acd7b2771 insns_info.inc: position independent
* 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
2018-01-04 01:30:20 +00:00
shyouhei dfb24be6c4 string literal longer than 509 characters is a C99ism
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-02 06:41:49 +00:00
nobu d0afbff3b0 prelude.c.tmpl: get rid of warnings on old gcc
* 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
2017-12-31 12:21:53 +00:00
nobu de11e472b4 prelude.c.tmpl: get rid of errors with old gcc
* 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
2017-12-25 23:59:56 +00:00
nobu d66f2d4443 prelude.c.tmpl: static literals
* 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
2017-12-25 02:42:13 +00:00
nobu d9c76c5bd8 prelude.c.tmpl: fix optimization options
* 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
2017-12-25 02:09:14 +00:00
nobu 9fbd48ee71 prelude.c.tmpl: fix line number
* 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
2017-12-06 05:22:19 +00:00
nobu 01830719f6 fix for emoji-data.txt
* 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
2017-12-02 03:12:51 +00:00
nobu a8a25b36f1 prelude.c.tmpl: escape comments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01 04:27:32 +00:00
nobu b7a908f61b prelude.c.tmpl: split prelude code
* 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
2017-12-01 03:54:50 +00:00
usa b4070513dd revert r60873
* 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
2017-12-01 01:29:50 +00:00
usa afa10bd125 Skip comment lines
* 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
2017-11-21 08:48:07 +00:00
nobu 324b6d306d iseq.c: operand lvar
* 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
2017-11-09 23:08:01 +00:00
ko1 85fcaf025d * node.h (ast_t): renamed to `rb_ast_t`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 15:51:23 +00:00
mame e35fe8d11b Revert "Revert "Manage AST NODEs out of GC""
This re-introduces r60485.
This reverts commit 5a176b75b1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27 16:44:57 +00:00
mame 5a176b75b1 Revert "Manage AST NODEs out of GC"
This reverts commit 620ba74778.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27 16:02:34 +00:00
mame 620ba74778 Manage AST NODEs out of GC
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
2017-10-27 15:59:02 +00:00
nobu ae0eea21bf fix missing variables in ruby.pc
* 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
2017-10-16 04:15:19 +00:00
nobu c8d45bdd59 verconf.h.tmpl: site and vendor directories
* 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
2017-10-09 03:08:02 +00:00
nobu 623cf29787 sizes.c.tmpl: prototype
* 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
2017-09-29 23:41:19 +00:00
nobu 1d44d10b48 ruby-runner.c: RUBYLIB
* 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
2017-09-24 01:48:25 +00:00
nobu 84bc175cab pack insn_operand_info and insn_len_info
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 04:40:16 +00:00
nobu a4d650274d pack insns_name_info
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 04:37:08 +00:00
nobu 7735c1f5fe tool/instruction.rb: move logics to templates
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 04:22:01 +00:00
nobu 1f89414c20 insns.inc.tmpl: ensure info size
* 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
2017-08-22 03:07:01 +00:00
svn 22224a45df * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-22 06:30:54 +00:00
yugui 7b19e6f3fd Add documents
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-22 06:30:53 +00:00
nobu 2abf6a3474 * template/exts.mk.tmpl: extract SUBMAKEOPTS from sub exts.mk files too. [Bug #13730]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-08 12:31:55 +00:00
nobu 9ab667b856 exts.mk.tmpl: fix multiple rubies
* 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
2017-05-14 03:33:01 +00:00
naruse ece9698d73 suppress warning: shadowing outer local variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 16:19:22 +00:00
nobu 3ca61bb04e exts.mk: refine notes [Feature #13302]
* 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
2017-04-21 02:43:25 +00:00
nobu 23e481e390 common.mk: separate note
* 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
2017-04-20 08:31:20 +00:00
nobu b58a30e1c1 extmk.rb: fail for mandatory libraries
* 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
2017-04-20 08:13:16 +00:00
stomar 0c10564dd9 nodoc UnicodeNormalize module
* 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
2017-04-12 18:07:32 +00:00
nobu e4262e991d Freeze RbConfig::SIZEOF and RbConfig::LIMITS
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-06 02:33:40 +00:00
nobu 489776e284 Rename RbConfig::Limits as RbConfig::LIMITS
* 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
2017-04-06 02:10:40 +00:00
nobu c527fa1341 exts.mk.tmpl: note footer [ci skip]
* 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
2017-03-31 07:34:47 +00:00
nobu 3a520acec3 MINIRUBY for cross-compling
* 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
2017-03-03 06:22:47 +00:00