In addition to saving space by deduplicating, this also makes the
literals have code range like TestObjSpace#test_dump_string_coderange
expects. It's testing a detail, but we might as well use rb_fstring().
Note that `putstring` makes a mutable duplicate, so passing it an
fstring is fine.
There are several prism tests failing related to the `source_location`
for lambda returning line of the operator (`->`)
while original parser execution results in `source_location` line
pointing to the block opening location (`{` or `do`)
This commit changes `PM_LAMBDA_NODE` compilation case
to use block opening location instead of the whole node (operator)
opening location to get the line number to build block iseq
We're not using this anymore, and it doesn't make a lot of sense
outside the context of a compiler anyway, and in anyway it's wrong
when you have local variables written in default values.
https://github.com/ruby/prism/commit/5edbd9c25b
not defined
(https://github.com/ruby/irb/pull/853)
The issue (https://github.com/ruby/debug/issues/1064) is caused by a
combination of factors:
1. When user starts an IRB session without a history file, the
`@loaded_history_lines` ivar is not defined.
2. If the user then starts the `irb:rdbg` session, the history counter
is not set, because the `@loaded_history_lines` is not defined.
3. Because `irb:rdbg` saves the history before passing Ruby expression
to the debugger, it saves the history with duplicated lines. The number
grows in exponential order.
4. When the user exits the `irb:rdbg` session, the history file could be
bloated with duplicated lines.
This commit fixes the issue by resetting the history counter even when
`@loaded_history_lines` is not defined.
https://github.com/ruby/irb/commit/4afc98c258
Previously, `return *array, 1` didn't behave like `return [*array, 1]`
properly. Also, it crashed when splat and kwsplat is combined like in
`array = [*things, **hash]`.
Fix this by grouping `PM_ARGUMENTS_NODE` with `PM_ARRAY_NODE` handling and
combining splat and kwsplat handling.
* This is also faster than calling pm_encoding_utf_8_alpha_char/pm_encoding_utf_8_alnum_char
as those compute the character width and do extra checks.
https://github.com/ruby/prism/commit/4cb276ac4c
Previously, this would push the provided keywords onto the argument
splat. Add ruby2_keywords to the list of other checks for whether
it is safe for treating a given splat as mutable when the called
method accepts an anonymous splat.
Before this commit, we were mixing a lot of concerns with the prism
compile between RubyVM::InstructionSequence and the general entry
points to the prism parser/compiler.
This commit makes all of the various prism-related APIs mirror
their corresponding APIs in the existing parser/compiler. This means
we now have the correct frame naming, and it's much easier to follow
where the logic actually flows. Furthermore this consolidates a lot
of the prism initialization, making it easier to see where we could
potentially be raising errors.
with these guards in YJIT.
The previous commit was to fix "conflict" between two PRs, but I
actually wanted to use it here, which is why I filed the other one.
* YJIT: Add jit_prepare_for_gc function
* s/jit_prepare_routine_call/jit_prepare_non_leaf_call/
* s/jit_prepare_for_gc/jit_prepare_call_with_gc/
* Use jit_prepare_call_with_gc for leaf builtin
This reverts commit 7ded31d36dc78c1495b03a45ec1a3235fdd81f1e.
I was told from Travis CI support that their infra team has deployed a fix for
the issue we encountered with the s390x build environment.