| Age | Commit message (Collapse) | Author |
|
zubycz-work_for_merge
|
|
|
|
Co-Authored-By: n4o847 <[email protected]>
Co-Authored-By: smallkirby <[email protected]>
|
|
|
|
It uses `mrb_str_new_lit()` internally, but it doesn't need to express
it in the name of the function (macro).
|
|
Where fixnum overflow can happen.
|
|
- Integrate `Fixnum` and `Integer`
- Remove `Integral`
- `int / int -> int`
- Replace `mrb_fixnum()` to `mrb_int()`
- Replace `mrb_fixnum_value()` to `mrb_int_value()`.
- Use `mrb_integer_p()` instead of `mrb_fixnum_p()`
|
|
We still have `#define MRB_TT_FIXNUM MRB_TT_INTEGER` for compatibility.
|
|
TODO: Unlike CRuby, mruby's `Proc#parameters` does not distinguish
required keyword arguments and optional keyword arguments currently.
|
|
- `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT`
- `MRB_USE_FLOAT` => `MRB_USE_FLOAT32`
The former is to use `USE_XXX` naming convention. The latter is to make
sure `float` is 32bit float and not floating point number in general.
|
|
|
|
|
|
When a global jump occurs, look at the catch handler table to determine where to jump.
In that case, `pc` already shows the following instruction, but since the table shows `begin_offset ... end_offset`, the comparison is done with `begin_offset < pc && pc <= end_offset`.
If there is a corresponding handler, move `pc` to `handler.target_offset` and continue running the VM.
When a global jump across `ensure` is made by `return`, `break`, `next`, `redo` and `retry`, the extended `RBreak` object saves and restores the C-level execution position.
This extended `RBreak` can have tag information, which makes it a pseudo coroutine (the "tag" mimics CRuby).
The implementation of pseudo coroutines by `RBreak` is summarized by `CHECKPOINT_RESTORE ... CHECKPOINT_MAIN ... CHECKPOINT_END` and `throw_tagged_break` / `unwind_ensure` macros.
The restart of processing is branched by `RBREAK_TAG_FOREACH(DISPATCH_CHECKPOINTS)`.
- Not only `rescue` blocks but also `ensure` blocks are now sandwiched between `OP_EXCEPT` and `OP_RAISEIF`.
- Remove the function `ecall()`.
It is no longer necessary to re-enter the VM to perform an "ensure block".
This will resolves #1888.
- Added instruction `OP_JUW` (Jump while UnWind).
It jumps unconditionally like `OP_JMP`, but searches the catch handler table and executes the ensure block.
Since it searches the catch handler table, it is much heavier than `OP_JMP`.
|
|
- `OP_EXCEPT` checks if `mrb->exc` is `NULL`, `MRB_TT_EXCEPTION` or
`MRB_TT_BREAK`.
If `mrb->exc` is `NULL`, it will be replaced with `nil`.
- If `OP_RAISE` is `nil`, it does nothing and the immediately
following instruction is executed (like `OP_NOP`).
Also, in case of `RBreak` object, it moves to the processing for
`break`.
With this change, the instruction name is changed from
`OP_RAISE` to `OP_RAISEIF`.
|
|
The catch handler table is combined with iseq block.
This is to prevent the structure from growing by adding a field for the
catch handler table to the `mrb_irep` structure.
"iseq block" and "catch handler table":
[number of catch handler table (2 bytes)]
[number of byte code (4 bytes)]
[iseq (any bytes)]
[catch handlers (multiple of 7 bytes)]
catch handler:
[catch type (1 byte)]
[begin offset (2 bytes)]
[end offset (2 bytes)]
[target offset (2 bytes)]
catch type: enum mrb_catch_type (0 = rescue, 1 = ensure)
begin offset: Includes the specified instruction address
end offset: Does not include the specified instruction address
target offset: replaces pc with the specified instruction address
This table is not expanded by `read_irep_record_1()`.
The necessary elements are expanded one by one when used.
|
|
|
|
|
|
|
|
|
|
[ruby-bugs:15921]
|
|
They are included from `mruby.h` anyway, and including it ahead can
cause some errors regarding `INT32_MAX` etc. with C++ compiler.
|
|
|
|
- `MRB_64BIT`: the size of a pointer is 64 bits
- `MRB_INT64`: the size of `mrb_int` is 64 bits
|
|
|
|
Changes:
- `pool format is completely replaced
- supported types: `STR`, `INT32`, `INT64`, `FLOAT`
- `FLOAT` may be replaced by binary representation in the future
- insert `NUL` after string literals in `mrb` files
- `irep->pool` no longer store values in `mrb_value`
- instead it stores in `mrb_pool_value`
- less allocation
- `mrb_irep` can be stored in ROM
|
|
That stands for "local variable information".
|
|
- `pool`
- `syms`
- `reps`
|
|
I sometimes see Bison related problems in setting up build environments.
Therefore to remove Bison from build time dependencies, add `y.tab.c`
generated by Bison to the repository.
The reduction of dependency at build time also reduces the labor and time
for setup and installation in CI.
In addition, a path in `#line` directive is converted to a relative path so
that its path is constant regardless of development environments.
|
|
Except for support files e.g. `mruby-test/driver.c`, which are not
target of symbol collection via `rake gensym`.
|
|
|
|
|
|
|
|
|
|
|
|
Fix take over file scope variables with `mruby` and `mirb` command
|
|
|
|
|
|
|
|
- It can now deal with operands in the range of `OP_EXT*`.
- It can now call the same method as the variable name without arguments.
```ruby
def a
"Safe!"
end
a = "Auto!"
eval "a()" # call method `a`
```
|
|
I sometimes see Bison related problems in setting up build environments.
Therefore to remove Bison from build time dependencies, add `y.tab.c`
generated by Bison to the repository.
The reduction of dependency at build time also reduces the labor and time
for setup and installation in CI.
In addition, a path in `#line` directive is converted to a relative path so
that its path is constant regardless of development environments.
|
|
Instead we added `%define parse.error verbose`.
|
|
It was making a negative integer if the highest-order bit of a 16-bit
integer was 1.
no patched:
```ruby
p 0x7fff # => 32767
p 0x8000 # => -32768
p 0xffff # => -1
p 0x10000 # => 65536
```
|
|
Which loads 16bit integer to the register. The instruction number should
be reorder on massive instruction refactoring. The instruction is added
for `mruby/c` which had performance issue with `OP_EXT`. With this
instruction, `mruby/c` VM can just raise errors on `OP_EXT` extension
instructions.
|
|
|
|
|
|
This reverts commit 682a31f92b3ac86ca59f7e8e740197e50b4452e5.
Unfortunately, I couldn't run newer `bison` on TravisCI. Maybe next
time.
|
|
Recent `bison` warns for `%pure-parser`. We kept it since MacOS only
provide ancient `bison`, but the warning is noisy and there's no hope
that Apple will upgrade `bison`. MacOS users must install the newer
version of `bison`, by typing `brew install bison` for example.
Note that `brew` does not overwrite the `bison` execution path
automatically, so you need to update your `.bash_profile` as instructed
by `brew`.
|
|
|
|
|
|
Clean up defined local variables.
|