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
* 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
* 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
* 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
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
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
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
* 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
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
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
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
* 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
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
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
* 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
* 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
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
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
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
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
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
* 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
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