| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
During instruction translation (linked list -> iseq generation), we can
treat `TS_VALUE` and `TS_ISEQ` the same as they are just embedded in the
generated sequences. The only difference between `TS_ISE` and `TS_IC`
is that an inline storage entry may contain a markable `VALUE` pointer
at some point, so we need to flag the iseq as containing markable
objects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
orz!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
Objects loaded during iseq deserialization using arrays need to be added
to the compile time mark array so that they stay alive until iseqs
finish loading.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* compile.c (iseq_peephole_optimize): remove unreachable jump
instruction only. if it is labeled and referred from other
instructions, it is reachable and must not be removed.
[ruby-core:87830] [Bug #14897]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```
if L1
L0:
jump L2
L1:
...
L2:
```
was wrongly optimized to:
```
unless L2
L0:
L1:
...
L2:
```
To make it conservative, this optimization is now disabled when there is
any label between `if` and `jump` instructions.
Fixes [Bug #14897].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
* vm.c (core_hash_merge_kwd): simplified to merge the second hash
into the first hash.
* compile.c (compile_array): call core#hash_merge_kwd with 2
hashes always, by passing an new empty hash to at the first
iteration.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
This reverts commit a44c010764a16ae09aaed49d76eec055ca0057c8.
Refs #14845.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
Now endless range can be created by either a literal `(1..)` or explicit
range creation `Range.new(1, nil)`. [Bug #14845]
This change is intended for "early failure"; for example,
`(1..var).to_a` causes out of memory if `var` is inadvertently nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current VM_INSTRUCTION_SIZE is 198, so the linear search
painful during a major GC phase.
I noticed rb_vm_insn_addr2insn2 showing up at the top of some
profiles while working on some malloc-related stuff, so I
decided to attack it.
Most notably, the benchmark/bm_vm3_gc.rb improves by over 40%:
https://80x24.org/spew/20180602220554.GA9991@whir/raw
[ruby-core:87361] [Feature #14814]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c, iseq.c: extract body and param.keyword in iseq as
local variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* compile.c (ibf_dump_iseq_each): Fix a range of a conditional.
`positions` is only used when VM_INSN_INFO_TABLE_IMPL is 2.
And always `dump_body` is expected to be initialized by
`iseq->body`. For example, `dump_body->insns_info.size` is
used in `ibf_dump_insns_info_positions`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (iseq_peephole_optimize): initialize dniobj first, to
suppress a false warning by gcc 8.1.0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
Don't abuse struct RString to hold arbitrary memory region.
Raw pointer should just suffice.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
which has throw insn, not only ancestor iseqs of it.
I think we should remove catch_except_p flag and try to simplify the
catch table itself, to prevent similar bugs in the future.
test_jit.rb: add test to prevent the bug
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* compile.c (iseq_peephole_optimize): add dummy `putnil` after a
`jump` replacing an unconditional branch, to adjust removed
`dup`. [ruby-core:86666] [Bug #14708]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (iseq_peephole_optimize): copy not only `leave`, with
a non-operand instruction, which are not longer than `jump`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (iseq_peephole_optimize): more eliminatable
instructions before `pop` without side effects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (optimize_checktype): optimize `checktype` instruction
on a literal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* insns.def (checktype): split branchiftype to checktype and
branchif, to make branch condition negation possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (INSERT_BEFORE_INSN, INSERT_BEFORE_INSN1): rename
argument `prev` as `next`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (ibf_dump_object_struct): align range elements.
[ruby-core:86548] [Bug #14689]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds write barriers for objects marked from `rb_iseq_mark`.
r62851 introduced direct marking from iseqs to:
* keyword arg default values
* catch table iseqs
* VALUEs embedded in encoded instructions
This patch adds missing write barrier calls to those references.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (ibf_load_iseq_complete): use alternate hexadecimal
form for offset.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (ibf_load_iseq_each): iseq_size necessary to encode
positions is set in ibf_load_code(). [Bug #14660]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (ibf_dump_iseq_each): ensure succ_index_table pointer
field to be 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (IBF_ZERO): clear padding of struct not to include
garbages in dumped binary data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* compile.c (ibf_dump_iseq_each): do not dump succ_index_table
pointer. positions are dumped as integer arrays. pointer
values are meaningless outside the process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (ibf_dump_align): fill padding with zero, instead of
resizing only, not to leave garbages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* compile.c (compile_evstr): extract from iseq_compile_each.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (compile_if): branch to end_label is not used if
else_seq is not used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* compile.c (compile_if): rewind callinfo indexes used in
unreachable paths, to get rid of dumping unused callinfos.
[ruby-core:86399] [Bug #14553]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (add_insn_info, add_adjust_info): split for each
list->type, to remove unnecessary repeated conditions and casts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (add_insn_info): move return statement to suppress
missing-noreturn warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
* compile.c (ibf_load_iseq_each): manage iseq_size to point loaded
objects in iseq_encoded. now marking iseq scans iseq_encoded
directly.
* test/ruby/test_iseq.rb (test_to_binary_with_objects): skip for
now, but fix argument order of assert_equal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
We need to mark default values for kwarg methods. This also fixes
Bootsnap. IBF iseq loading needed to mark iseqs as "having markable
objects".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* compile.c (iseq_set_arguments): determine argument variable
indexes by the order, not by just IDs. arguments begin with `_`
can be duplicate, so by-ID index may result in a wrong value.
[ruby-core:86159] [Bug #14611]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (ibf_dump_object_object): fix a probable typo in the
function name, s/lbf/ibf/.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* compile.c (ibf_dump_align): resize the dump buffer.
rb_str_modify_expand expands the buffer but not set the length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* compile.c (ibf_dump_align): expand the buffer for alignment.
* compile.c (ibf_dump_iseq_list, ibf_dump_object_list): align as
ibf_offset_t. not all processors do not allow unaligned word,
or larger, access.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|