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

49743 Коммитов

Автор SHA1 Сообщение Дата
naruse 42bb73cf64 support ruby 1.9.3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 07:34:06 +00:00
hsbt b0d1586fa7 [DOC] Refinements on modules are allowed
From: Leo Correa <lcorr005@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 07:08:53 +00:00
nobu 3f7221ad3d force fixable
* complex.c (nucomp_hash): force hash values fixable.
  [ruby-core:85224] [Bug #14420]

* rational.c (nurat_hash): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 05:48:28 +00:00
hsbt 5af43b1ec2 ia64: update ia64-specific code to use execution context
This change follows commit 837fd5e494
in '#ifdef __ia64' branches.

Noticed as a build failure by John Paul Adrian Glaubitz:

```
  cont.c:502:50: error: 'rb_thread_t {aka struct rb_thread_struct}'
    has no member named 'machine'
       size = cont->machine.register_stack_size =
           th->machine.register_stack_end - th->machine.register_stack_start;
               ^~
```

The change is trivial: update 'th->machine' usage to 'th->ec->machine'.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 05:43:42 +00:00
nobu c3ce3b4744 vcs.rb: checkout the current branch before rebase
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 04:17:32 +00:00
nobu d7d2225e4b common.mk: added minimum dependencies of incs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 03:57:54 +00:00
nobu d4d671f2b0 bare_instructions.rb: sp_inc is signed
* tool/ruby_vm/models/bare_instructions.rb (predefine_attributes):
  `sp_inc` attribute which may return negative values must be
  signed `rb_snum_t`, to be signed-expanded at type promotion.

* vm_insnhelper.h (ADJ_SP): removed the workaround for platforms
  where rb_num_t is wider than int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 03:21:52 +00:00
ko1 68e2a2e5ce skip EINVAL on unsupported platform
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 02:21:59 +00:00
nobu a24ccfe6af vcs.rb: fix errors
* tool/vcs.rb (DebugSystem#system): fix undefined local variable
  error.  as system doesn't accept `exception:` option before 2.6,
  remove it from `opts`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 02:20:02 +00:00
nobu 5ce70a0831 iseq.c: internal lvar name
* iseq.c (local_var_name): name internal local variables as `?N`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 02:08:30 +00:00
normal 7830a950ef net/pop: make modified strings mutable
Thanks to Michael Zimmerman for the bug report

* lib/net/pop.rb: make modified strings mutable
  [ruby-core:85210] [Bug #14416]
* test/net/pop/test_pop.rb: new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 00:22:22 +00:00
naruse f65c682fbd show BASERUBY's version on `make showflags`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 17:12:07 +00:00
naruse be264f4a65 Suport ruby 1.9.3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 17:05:41 +00:00
eregon 3fa5bd38af Update to ruby/spec@83063a3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 16:08:16 +00:00
svn 1e658d45e1 * 2018-01-30
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 16:07:36 +00:00
eregon 6fd1a18f8a Update to ruby/mspec@5d49a6c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 16:07:35 +00:00
mame 552a5a993c string.c (rb_str_format_m): Fix the example code of the doc
Change `%08x` to `%016x` because of two reasons:

* `%016x` demonstrates that we can use two or more digits here.
* Currently, many people uses 64-bit environment.
  (I'm unsure if object_id is a good example here, though...)
I'm unsure if

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 08:40:22 +00:00
shyouhei 3bc2f5a9b6 redefinition of a typedef is a C11ism
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 08:11:02 +00:00
shyouhei c788fb4808 eliminate CALL_SIMPLE_METHOD
Arrange operands of several opt_something insns so that jumps to
opt_send_without_block can be applied to them. This makes it
possible to eliminate CALL_SIMPLE_METHOD macro at all.  Results
in binary size of vm_exec_core to change from 27,008 bytes to
26,016 bytes on my machine. [close GH-1779]

Note however that PC can point somewhere non-instruction now.

-----------------------------------------------------------
benchmark results:
minimum results in each 3 measurements.
Execution time (sec)
name    before  after
so_ackermann     0.450  0.426
so_array         0.789  0.824
so_binary_trees  5.760  5.635
so_concatenate   3.594  3.508
so_count_words   0.211  0.196
so_exception     0.256  0.244
so_fannkuch      1.049  1.044
so_fasta         1.485  1.472
so_k_nucleotide  1.195  1.216
so_lists         0.517  0.513
so_mandelbrot    2.264  2.394
so_matrix        0.501  0.468
so_meteor_contest        2.987  2.912
so_nbody         1.307  1.289
so_nested_loop   0.908  0.925
so_nsieve        1.679  1.614
so_nsieve_bits   2.131  2.092
so_object        0.620  0.625
so_partial_sums  1.623  1.675
so_pidigits      1.135  1.190
so_random        0.357  0.321
so_reverse_complement    0.619  0.583
so_sieve         0.493  0.496
so_spectralnorm  1.749  1.737

Speedup ratio: compare with the result of `before' (greater is better)
name    after
so_ackermann    1.057
so_array        0.958
so_binary_trees 1.022
so_concatenate  1.024
so_count_words  1.077
so_exception    1.049
so_fannkuch     1.004
so_fasta        1.009
so_k_nucleotide 0.983
so_lists        1.007
so_mandelbrot   0.946
so_matrix       1.072
so_meteor_contest       1.026
so_nbody        1.013
so_nested_loop  0.982
so_nsieve       1.040
so_nsieve_bits  1.018
so_object       0.992
so_partial_sums 0.969
so_pidigits     0.954
so_random       1.111
so_reverse_complement   1.062
so_sieve        0.994
so_spectralnorm 1.007

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 07:15:08 +00:00
shyouhei 31ecd18f1a s/CALL_SIMPLE_METHOD/DISPATCH_ORIGINAL_INSN/
Now that DISPATCH_ORIGINAL_INSN is introduced, we can replace
CALL_SIMPLE_METHOD with DISPATCH_ORIGINAL_INSN. These two macros
differ in size very much and results in this big difference in
compiled binary size. This changeset reduces the size of
vm_exec_core from 32,352 bytes to 27,008 bytes on my machine.  As
a result it yields slightly better performance.
Closes [GH-1779].

-----------------------------------------------------------
benchmark results:
minimum results in each 3 measurements.
Execution time (sec)
name    before  after
so_ackermann     0.484  0.454
so_array         0.837  0.779
so_binary_trees  5.928  5.801
so_concatenate   3.473  3.543
so_count_words   0.201  0.222
so_exception     0.255  0.252
so_fannkuch      1.080  1.019
so_fasta         1.459  1.463
so_k_nucleotide  1.218  1.180
so_lists         0.499  0.484
so_mandelbrot    2.189  2.324
so_matrix        0.510  0.496
so_meteor_contest        3.025  2.925
so_nbody         1.319  1.273
so_nested_loop   0.941  0.932
so_nsieve        1.806  1.647
so_nsieve_bits   2.151  2.078
so_object        0.632  0.621
so_partial_sums  1.560  1.632
so_pidigits      1.190  1.183
so_random        0.333  0.353
so_reverse_complement    0.604  0.586
so_sieve         0.521  0.481
so_spectralnorm  1.774  1.722

Speedup ratio: compare with the result of `before' (greater is better)
name    after
so_ackermann    1.065
so_array        1.075
so_binary_trees 1.022
so_concatenate  0.980
so_count_words  0.903
so_exception    1.009
so_fannkuch     1.059
so_fasta        0.997
so_k_nucleotide 1.032
so_lists        1.032
so_mandelbrot   0.942
so_matrix       1.028
so_meteor_contest       1.034
so_nbody        1.036
so_nested_loop  1.009
so_nsieve       1.097
so_nsieve_bits  1.035
so_object       1.018
so_partial_sums 0.956
so_pidigits     1.006
so_random       0.943
so_reverse_complement   1.032
so_sieve        1.083
so_spectralnorm 1.030

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 07:04:50 +00:00
shyouhei 7d4ad74f22 also use sp_inc in vm core
Now that sp_inc attributes are officially provided as inline
functions. Why not use them directly from the vm core, not just
by the compiler. By doing so, it is now possible for us to
optimize stack manipulations. We can now know exactly how many
words of stack space an instruction consumes before it actually
does. This changeset deletes some lines from insns.def because
they are no longer needed.  As a result it reduces the size of
vm_exec_core function from 32,400 bytes to 32,352 bytes on my
machine.

It seems it does not affect performance:

-----------------------------------------------------------
benchmark results:
minimum results in each 3 measurements.
Execution time (sec)
name    before  after
loop_for         1.093  1.061
loop_generator   1.156  1.152
loop_times       0.982  0.974
loop_whileloop   0.549  0.587
loop_whileloop2  0.115  0.121

Speedup ratio: compare with the result of `before' (greater is better)
name    after
loop_for        1.030
loop_generator  1.003
loop_times      1.008
loop_whileloop  0.935
loop_whileloop2 0.949

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 06:56:56 +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
shyouhei 9a8b38cacf extensive use of instruction attributes
Instead of using magic numbers, let us define a series of attributes
and use them from the VM core.  Proper function declarations makes
these attributes inlined in most modern compilers.  On my machine
exact same binary is generated with or without this changeset.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29 06:47:05 +00:00
svn 582951e2c8 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-28 21:57:39 +00:00
normal ea675ee4e7 doc/signals.rdoc: new document work-in-progress
We need a longer document to inform users of caveats
related to Signal.trap usage.  This is still incomplete,
and we can fill in and edit other bits as needed.

* doc/signals.rdoc: new document
  [ruby-core:85107] [Misc #14222]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-28 21:57:38 +00:00
svn 823926f484 * 2018-01-29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-28 21:07:14 +00:00
normal 26b3dc4922 uri/common: reduce allocations and retained objects
Thanks to Sam Saffron for this patch, it shows
a nice reduction which affects many web applications:

  require 'memory_profiler'

  MemoryProfiler.report do
    require 'uri'
  end.pretty_print

Before:

Total allocated: 986643 bytes (15159 objects)
Total retained:  246370 bytes (2532 objects)

After:

Total allocated: 926903 bytes (13665 objects)
Total retained:  208570 bytes (1587 objects)

* lib/uri/common.rb: reduce allocations and retained objects
  [ruby-core:85161] [Feature #14410]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-28 21:07:13 +00:00
nobu 2e12695929 method.h: VM_METHOD_TYPE_MINIMUM_BITS
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-28 14:16:48 +00:00
nobu c0d22698e3 parse.y (parser_append_options): shorter alias LOC
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-28 14:05:39 +00:00
nobu e47da4ddf3 method.h: BITFIELD in rb_method_definition_t
* method.h (rb_method_definition_struct): use BITFIELD for
  rb_method_type_t.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-28 10:35:28 +00:00
normal 46bfa65fcc internal.h: add BITFIELD macro to aid C99 users
I plan to use this macro to pack other enums in the VM.

* internal.h: add BITFIELD macro
* method.h: use BITFIELD for rb_method_visibility_t
  [ruby-core:85074] [Misc #14395]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 21:04:42 +00:00
svn 6cf78f0e67 * 2018-01-28
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 21:04:37 +00:00
normal 72b7bd0af5 vm_core: use "int" for living_thread_num
We treat this as "int" through the vm_living_thread_num API
anyways, and "pid_t" is still 32-bits with glibc on 64-bit
platforms.  I expect it'll be a long time before anybody needs
more than 2 billion native threads.  For now, let's save one
cacheline on x86-64 (as reported by pahole(1)):

	before:  size: 1288, cachelines: 21, members: 45
	 after:  size: 1280, cachelines: 20, members: 45

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 21:04:36 +00:00
k0kubun 6cb0126773 insns.def: [DOC] update supported attributes [ci skip]
which are changed at r62051.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 13:50:28 +00:00
nobu 7ea65f9be2 compile.c: try to convert in massign `for`
* compile.c (compile_for_masgn): try to convert to an Array if an
  element of massign `for` is not an Array.
  [ruby-core:84931] [Bug #14374]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 10:41:43 +00:00
nobu d0fa578cdc array.c: rb_check_to_array
* array.c (rb_check_to_array): conversion to array by to_a method.
  returns nil if not possible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 09:27:47 +00:00
nobu 9473f86fb0 defined? returns nil for toplevel constant lookup
* variable.c (rb_const_defined_0): toplevel constant lookup has
  been removed, should return nil too.
  [ruby-core:85142] [Bug #14407] [Fix GH-1800]

From: Gonzalo <grzuy0@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 06:12:09 +00:00
nobu 17d8433d27 vcs.rb: prepend DebugSystem to VCS
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 06:11:23 +00:00
nobu 27db7101c6 vm_insnhelper.c: avoid intermediate array
* vm_insnhelper.c (vm_expandarray): get rid of creating
  intermediate Array object when conversion failed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 05:35:47 +00:00
k0kubun fe18a62347 bare_instructions.rb: show class name on inspect
as it's helpful for debugging.

I'm not sure what's the good output for RubyVM::TraceInstructions, so I
left it as it is.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 04:14:29 +00:00
kazu ef83b306e2 Fix duplicated HAVE_NAN
And remove redundant `HAVE_*` macros,
and use `USE_RB_*` macros instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 04:14:26 +00:00
k0kubun 3e458f15c8 insns2vm.rb: add missing word to help
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 02:14:20 +00:00
k0kubun c8e5796f61 insns2vm.rb: make #generate_parser private
which is only used by #router.

To make it private, we need to stop defining them on top-level.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 02:14:20 +00:00
k0kubun be27efdb83 dumper.rb: stop getting --destdir option value
via current directory. It's kind of a global state and fragile to
implementation changes in other places, and how the `Dir.getwd` is set
is not obvious from just reading around `RubyVM::Dumper#initialize` if
it depends on the global state.

tool/ruby_vm/controllers/application_controller.rb: explicitly pass
destdir to RubyVM::Dumper.

tool/ruby_vm/scripts/insns2vm.rb: explicitly pass destdir parsed from
optparse.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 01:59:08 +00:00
k0kubun d678c274aa win32/Makefile.sub: fix typo
Other places are using RT_VER. So I guess this is correct.
Currently AppVeyor CI is failing and I want to fix that.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-27 01:28:21 +00:00
svn 7561f7e35e * 2018-01-27
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-26 16:38:39 +00:00
usa d2bd7d7b98 need to declare the prototype of nan() if missing
* include/ruby/missing.h (nan): need to declare the prototype of nan() if
  missing.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-26 16:38:38 +00:00
nobu 78c81718d2 vcs.rb: old version cannot refine modules
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-26 13:38:00 +00:00
nobu eab10990ac vcs.rb: dcommit for each commit
svn to git bridge on ci.ruby-lang.org sometimes stalls when
dcommitting some commits at once.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-26 13:34:09 +00:00
nobu e168963d8a vcs.rb: debug print in system method
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-26 13:27:56 +00:00