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

580 Коммитов

Автор SHA1 Сообщение Дата
ko1 496267023c fix missed script_compiled events. [Bug #15471]
* ruby.c (process_options): script_compiled events are missed on
  command line -e or specified file. this commit fix it.
  [Bug #15471]

  This patch should be backport to Ruby 2.6 branch.

* vm_core.h (rb_exec_event_hook_script_compiled): introduce utility
  function to invoke a script_compiled event.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-27 17:39:17 +00:00
k0kubun b756b25c60 ruby.c: do not surface MJIT to user
In some places, both JIT and MJIT are being used, but it could be
confusing for new comers. We're not explaining MJIT on NEWS file or release
notes as well. So we consider MJIT as an internal term of implementation
like YARV.

configure.ac: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-19 14:00:49 +00:00
nobu f53bd45d6f AST.of -e script
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-10 11:43:02 +00:00
ko1 543acfabdc fix a warning message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21 02:38:26 +00:00
ko1 b710785f1a add disabling MJIT features option.
* configure.ac: introduce new configure option `--enable-mjit` and
  `--disable-mjit`. Default is "enable".
  `--disable-mjit` disables all of MJIT features so that `ruby --jit`
  can't enable MJIT.
  This option affect a macro `USE_MJIT`.
  This change remove `--enable/disable-install-mjit-header` option.

* Makefile.in: introduce the `ENABLE_MJIT` variable.

* common.mk: use `ENABLE_MJIT` option.

* internal.h: respect `USE_MJIT`. Same as other *.c, *.h.

* test/ruby/test_jit.rb: check `ENABLE_MJIT` key of rbconfg.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 06:53:00 +00:00
nobu 4e133fdb7e Just a shebang is valid code
[ruby-core:89240] [Bug #15190]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-02 18:51:21 +00:00
nobu 6c70fede0c version.c: separate Init_ruby_description
* version.c (Init_ruby_description): separate to initialize
  RUBY_DESCRIPTION constant according to mjit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10 05:02:35 +00:00
nobu 9fbb66610c ruby.c: taint ARGV on Windows
* ruby.c (external_str_new_cstr): strings come from the external
  should be tainted.  [ruby-dev:50596] [Bug #14941]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-27 05:42:56 +00:00
nobu dff596be18 dladdr() is declared with non-const pointer on Solaris
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26 09:34:30 +00:00
k0kubun 053cdaf7ee ruby.c: accept --disable-jit option
by promoting jit to feature flag.

mjit.h: update comment about mjit_opts.on

test_rubyoptions.rb: add test for switching JIT enablement

"--jit" flag usage may be deprecated later, but not discussed yet.

[Feature #14878]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-18 12:45:54 +00:00
nobu e39b2cff8a ruby.c: disable DidYouMean as gem
* ruby.c (process_options): as DidYouMean requires Rubygems, disable
  the former when the latter is disabled too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-16 05:05:27 +00:00
nobu b53114dd99 set up mjit.on at initialization
* ruby.c (cmdline_options_init): set up mjit.on flag by
  MJIT_FORCE_ENABLE in the initialization function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-02 07:42:24 +00:00
nobu 0534566839 ruby.c: making hidden objects
* ruby.c (add_modules): make hidden objects by particular
  functions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-11 23:33:35 +00:00
nobu 7cdc78e284 ruby.c: localize a variable
* ruby.c (ruby_init_loadpath_safe): moved libdir to the block
  where it is used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-21 12:25:45 +00:00
nobu 68b87aedde ruby.c: runtime_libruby_path
* ruby.c (runtime_libruby_path): hoisted out platform dependent
  routine to get the loaded runtime library path.
  cygwin_conv_path does path separator and WCHAR to UTF-8
  conversions too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-21 12:24:47 +00:00
shyouhei 23c74845ed RSTRING_PTR is not guaranteed to be char*-aligned
We need to ensure aligned memory access by allocating
another memory region.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10 02:54:04 +00:00
nobu 6dafb4c910 ruby.c: moved libdir
* ruby.c (ruby_init_loadpath_safe): moved libdir name inside
  LOAD_RELATIVE.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-27 05:20:40 +00:00
nobu 4eb2c1e121 ruby.c: fix compilation error
* ruby.c (ruby_init_loadpath_safe): fix compilation error when
  ENABLE_MULTIARCH but not universal binary.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-27 04:36:34 +00:00
nobu 67800ea9c7 mjit.c: prefix and archdir in init
* ruby.c (ruby_init_loadpath_safe): store prefix and archlibdir
  paths.

* mjit.c (compile_c_to_so, init_header_filename): use just one
  library path on Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-27 02:02:29 +00:00
nobu 8036af48a5 ruby.c (ruby_init_loadpath_safe): constify
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-26 12:36:26 +00:00
nobu e68a8b1e9a ruby.c: exit by --version
* ruby.c (usage): stated exiting by `--version` option with
  nothing done.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-27 00:44:34 +00:00
nobu 2a99d5f9ef ruby.c: fix --verbose description in usage
* ruby.c (usage): fix the description of `--verbose` option, which
  does not print the version number unlike `-v` option.
  [ruby-core:86307] [Bug #14633]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-26 16:25:05 +00:00
k0kubun 2d1a415470 ruby.c: fix typo in r62530
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-22 15:29:33 +00:00
k0kubun 171c496e50 version.c: show +JIT when --jit is passed
in version output.
version.h: ditto
ruby.c: propagate option for it
common.mk: updated dependency for version.c

mjit.c: overwrites the RUBY_DESCRIPTION to have +JIT when --jit is passed

test/ruby/test_rubyoptions.rb: add test for them

Only `ruby --jit -v` will have "+JIT", but this is intentional.
This may not be convenient for debugging by ticket with `ruby -v`,
but it's convenient for benchmark tools that pass options (--jit)
when showing it. At least such behavior is planned for benchmark_driver.gem
and this behavior is designed for it. Other benchmark tools are
recommended to follow the behavior too if they show version.
RUBY_DESCRIPTION might be useful for it too.

The position of "+JIT" is changed from original proposal because other
platforms like JRuby and TruffleRuby end it with archtecture.
It's made similar to JRuby, but it's upper-cased because Matz made approval
for "+JIT" in the ticket.

Example:
$ ruby -v
ruby 2.6.0dev (2018-02-22 trunk 62529) [x86_64-linux]
$ ruby --jit -v
ruby 2.6.0dev (2018-02-22 trunk 62529) +JIT [x86_64-linux]

After --jit is made default in the future, this output may be removed.
So do not rely on this output if possible.

[Feature #14462]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-22 14:53:17 +00:00
nobu 9dc2d2855e no --jit-cc
* ruby.c (setup_mjit_options): removed --jit-cc option, since
  mjit header is affected by generated config.h which depends on
  the given compiler, so it cannot work with different compilers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12 03:39:18 +00:00
usa 714836c152 remove declaration of ruby_engine from internal.h
* internal.h (ruby_engine): remove declaration of ruby_engine because
	  it's declared at ruby/version.h.

	* ruby.c: include ruby/version.h for ruby_engine.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-07 04:04:33 +00:00
k0kubun 75eff5002d ruby.c: add MJIT_FORCE_ENABLE macro
to always enable MJIT for testing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-06 16:03:14 +00:00
k0kubun 1fd0a7a660 mjit.c: determine prefix of MJIT header at runtime
so that MJIT can work if Ruby is distributed as prebuilt binary.

Now mjit_init() depends on the internal const TMP_RUBY_PREFIX which is
only available after ruby_init_loadpath_safe() (L1608) and before
ruby_init_prelude() (L1681). So the place of mjit_init() is moved.

Makefile.in: Removed static prefix from MJIT_HEADER_ISNTALL_DIR macro.
And this removes the unused LIBRUBY_LIBDIR macro as well.
win32/Makefile.sub: ditto.

Patch by: Lars Kanis <lars@greiz-reinsdorf.de>
[Bug #14445]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-05 16:51:12 +00:00
k0kubun fd44a5777f mjit.c: merge MJIT infrastructure
that allows to JIT-compile Ruby methods by generating C code and
using C compiler.  See the first comment of mjit.c to know what this
file does.

mjit.c is authored by Vladimir Makarov <vmakarov@redhat.com>.
After he invented great method JIT infrastructure for MRI as MJIT,
Lars Kanis <lars@greiz-reinsdorf.de> sent the patch to support MinGW
in MJIT. In addition to merging it, I ported pthread to Windows native
threads. Now this MJIT infrastructure can be compiled on Visual Studio.

This commit simplifies mjit.c to decrease code at initial merge. For
example, this commit does not provide multiple JIT threads support.
We can resurrect them later if we really want them, but I wanted to minimize
diff to make it easier to review this patch.

`/tmp/_mjitXXX` file is renamed to `/tmp/_ruby_mjitXXX` because non-Ruby
developers may not know the name "mjit" and the file name should make
sure it's from Ruby and not from some harmful programs.  TODO: it may be
better to store this to some temporary directory which Ruby is already using
by Tempfile, if it's not bad for performance.

mjit.h: New. It has `mjit_exec` interface similar to `vm_exec`, which is
for triggering MJIT. This drops interface for AOT compared to the original
MJIT.

Makefile.in: define macros to let MJIT know the path of MJIT header.
Probably we can refactor this to reduce the number of macros (TODO).
win32/Makefile.sub: ditto.

common.mk: compile mjit.o and mjit_compile.o. Unlike original MJIT, this
commit separates MJIT infrastructure and JIT compiler code as independent
object files. As initial patch is NOT going to have ultra-fast JIT compiler,
it's likely to replace JIT compiler, e.g. original MJIT's compiler or some
future JIT impelementations which are not public now.

inits.c: define MJIT module. This is added because `MJIT.enabled?` was
necessary for testing.
test/lib/zombie_hunter.rb: skip if `MJIT.enabled?`. Obviously this
wouldn't work with current code when JIT is enabled.
test/ruby/test_io.rb: skip this too. This would make no sense with MJIT.

ruby.c: define MJIT CLI options. As major difference from original MJIT,
"-j:l"/"--jit:llvm" are renamed to "--jit-cc" because I want to support
not only gcc/clang but also cl.exe (Visual Studio) in the future. But it
takes only "--jit-cc=gcc", "--jit-cc=clang" for now. And only long "--jit"
options are allowed since some Ruby committers preferred it at Ruby
developers Meeting on January, and some of options are renamed.
This file also triggers to initialize MJIT thread and variables.
eval.c: finalize MJIT worker thread and variables.
test/ruby/test_rubyoptions.rb: fix number of CLI options for --jit.

thread_pthread.c: change for pthread abstraction in MJIT. Prefix rb_ for
functions which are used by other files.
thread_win32.c: ditto, for Windows.  Those pthread porting is one of major
works that YARV-MJIT created, which is my fork of MJIT, in Feature 14235.
thread.c: follow rb_ prefix changes

vm.c: trigger MJIT call on VM invocation. Also trigger `mjit_mark` to avoid
SEGV by race between JIT and GC of ISeq. The improvement was provided by
wanabe <s.wanabe@gmail.com>.
In JIT compiler I created and am going to add in my next commit, I found
that having `mjit_exec` after `vm_loop_start:` is harmful because the
JIT-ed function doesn't proceed other ISeqs on RESTORE_REGS of leave insn.
Executing non-FINISH frame is unexpected for my JIT compiler and
`exception_handler` triggers executions of such ISeqs. So `mjit_exec`
here should be executed only when it directly comes from `vm_exec` call.
`RubyVM::MJIT` module and `.enabled?` method is added so that we can skip
some tests which don't expect JIT threads or compiler file descriptors.

vm_insnhelper.h: trigger MJIT on method calls during VM execution.

vm_core.h: add fields required for mjit.c. `bp` must be `cfp[6]` because
rb_control_frame_struct is likely to be casted to another struct. The
last position is the safest place to add the new field.
vm_insnhelper.c: save initial value of cfp->ep as cfp->bp. This is an
optimization which are done in both MJIT and YARV-MJIT. So this change
is added in this commit. Calculating bp from ep is a little heavy work,
so bp is kind of cache for it.

iseq.c: notify ISeq GC to MJIT. We should know which iseq in MJIT queue
is GCed to avoid SEGV.  TODO: unload some GCed units in some safe way.

gc.c: add hooks so that MJIT can wait GC, and vice versa. Simultaneous
JIT and GC executions may cause SEGV and so we should synchronize them.

cont.c: save continuation information in MJIT worker. As MJIT shouldn't
unload JIT-ed code which is being used, MJIT wants to know full list of
saved execution contexts for continuation and detect ISeqs in use.

mjit_compile.c: added empty JIT compiler so that you can reuse this commit
to build your own JIT compiler. This commit tries to compile ISeqs but
all of them are considered as not supported in this commit. So you can't
use JIT compiler in this commit yet while we added --jit option now.

Patch author: Vladimir Makarov <vmakarov@redhat.com>.

Contributors:
Takashi Kokubun <takashikkbn@gmail.com>.
wanabe <s.wanabe@gmail.com>.
Lars Kanis <lars@greiz-reinsdorf.de>.

Part of Feature 12589 and 14235.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-04 06:58:09 +00:00
nobu 592dcccdf9 ruby.c: no VARIABLE_LIBPATH
* ruby.c (ruby_init_loadpath_safe): removed code using fixed size
  path buffer.  relative load path is supported only on platforms
  where dladdr is available, or on Windows, so !VARIABLE_LIBPATH
  code is not used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 06:54:22 +00:00
normal a41386a2dc ruby.c (open_load_file): avoid shadowing variable for errno
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-24 20:50:29 +00:00
nobu e9cb552ec9 internal.h: remove dependecy on ruby/encoding.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09 06:24:11 +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 b7d6b2299b ruby.c: script __dir__ encoding
* ruby.c (process_options): fallback to the encoding of the script
  name since rb_realpath_internal() cannot convert the encoding
  when it is ASCII-8BIT.

* test/ruby/test_rubyoptions.rb (test___dir__encoding): explicitly
  pass environment variables for locale as they are overriden by
  invoke_ruby.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-16 13:25:11 +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 d0d32ba1e8 ruby.c: fix r60393
* ruby.c (load_file_internal): set loop options after parsing
  shebang line.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 11:09:41 +00:00
nobu 30f5c55890 parse.y: rb_parser_set_options
* parse.y (yycompile0): append top-level addenda before appending
  prelude nodes.

* parse.y (rb_parser_set_options): set top-level addendum options
  before parsing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 07:41:48 +00:00
usa 3e8c0c577c The encoding of __FILE__ and __dir__ should be same
* ruby.c (process_options): convert the real path of the script to locale
  encoding if its encoding is not locale (maybe UTF-8) on Windows/OS X.
  this change makes the encoding of __dir__ to the same encoding of __FILE__
  when the script name is passed from commandline.

* test/ruby/test_options.rb (test___dir__encoding): test for this change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 15:43:05 +00:00
nobu f16f0441d6 ruby.c: reject NUL in $0
* ruby.c (ruby_setproctitle): raise if the argument contains NUL
  char.  process title is a NUL-terminated string.
  [ruby-core:82425] [Bug #13829]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-19 11:24:03 +00:00
sonots c18503c25a ruby.c: show help messages of --dump
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20 05:01:09 +00:00
nobu 79e0a19353 ruby.c: paragraph mode by -00
* ruby.c (proc_options): set to paragraph mode, if -00 is given,
  as well as perl and -R0 option in 0.49.
  [ruby-core:81987] [Bug #13736]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20 00:53:47 +00:00
nobu 157ee2bdbc ruby.c: ignore non-option in shebang line
* ruby.c (moreswitches): process all words as options only in
  an environment variable, but not in a shebang line.
  [ruby-core:82267] [Bug #13786]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-10 05:54:56 +00:00
nobu 8081826be6 ruby.c: origarg
* ruby.c (dladdr_path, ruby_set_argv): add guards for origarg.
  [ruby-core:82272] [Bug #13788]

* ruby.c (proc_options, process_options, ruby_process_options):
  set origarg if not set yet.

* ruby.c (process_options): prefer argv in the argument to origarg
  as program name.

* ruby.c (ruby_sysinit): set origarg only if argc and argv seem
  valid.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-09 11:03:55 +00:00
nobu 6af650256b RUBY_DEVEL flag
* configure.in: define RUBY_DEVEL only in the trunk.

* gc.c: enable runtime rgengc debug if RUBY_DEVEL

* ruby.c (debug_option): enable RUBY_DEBUG in --debug option only
  if RUBY_DEVEL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-21 04:34:25 +00:00
nobu 793f5d8fe8 ruby.c: debug options in command line
* ruby.c (debug_option): parse options in --debug command line
  option same as RUBY_DEBUG env.  available only in the trunk.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-21 02:44:23 +00:00
nobu 238a6246ff ruby.c: script name in UTF-8
* ruby.c (process_options): keep script name in UTF-8 if UTF8_PATH
  to get rid of loss by conversion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-08 02:07:42 +00:00