| Age | Commit message (Collapse) | Author |
|
|
|
That describes the changes in `mruby3`.
|
|
If this assertion fails, you have to define `MRB_USE_METHOD_T_STRUCT`.
|
|
It's the first change of renaming configuration options to `MRB_XXX` to
`MRB_USE_XXX` or `MRB_NO_XXX`.
|
|
|
|
On platforms where `time_t` is unsigned, negative time can be a result
of integer casting. Out-of-range error is too strict for those cases.
This fix does not address wrong time value in `MRB_WORD_BOXING`. It will
be addressed later (by introducing "big" integers).
|
|
|
|
On some platforms, `sizeof(mrb_value) > sizeof(void*)*3`, which makes
`MRB_ARY_EMBED_LEN_MAX` zero. And zero sized array cause compile errors.
|
|
|
|
|
|
Remove `#ifdef` from `union mrb_value_`.
|
|
|
|
|
|
|
|
Variables in jump destination block separate declaration and assignment.
|
|
Changes made after `setjmp()` are destroyed and need reassignment.
This problem is now caused by the addition of the `OP_JUW` instruction.
When actually building on FreeBSD 12.1 with `clang10 -fsanitize=address`, mrbtest "NameError#name [15.2.31.2.1]" is failed.
However, qualifying `pc` with `volatile` slows down significantly and increases the object code.
Suppress them by qualifying only the variables that restore `pc`.
|
|
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_PUSHERR`, `OP_POPERR`, `OP_EPUSH` and `OP_EPOP` are removed.
|
|
- `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.
|
|
|
|
|
|
Probably I misunderstand strict aliasing rule of C++. The fix in
4c001673b was other way around.
|
|
|
|
Since some compiler complains when we `typedef` `mrb_value`.
|
|
|
|
|
|
Clearing all method cache using `memset` is faster than conditional
clear by method id.
|
|
|
|
You don't need pointer tweaking on 32bit architecture, where pointers
fit in 32bit (lower half of mrb_value).
|
|
Tested only on Linux. You need to install 32bit relate libraries,
e.g. libc6-dev-i386.
|
|
|
|
|
|
On 64bit platforms: `MRB_NAN_BOXING`
On 32bit platforms: `MRB_WORD_BOXING`
On debugging: `MRB_NO_BOXING`
|
|
|
|
|
|
|
|
Since it's an internal static function.
|
|
When the array is very big, the simpler `mrb_write_barrier` causes
calling `gc_mark_children` for big arrays repeatedly. That would hinder
performance very badly.
|
|
|
|
Which is caused by `MRB_NAN_BOXING`.
|
|
|
|
|
|
Introduced `MRB_NO_METHOD_CACHE` which is inverse of `MRB_METHOD_CACHE`
that should be enabled intestinally. In addition, the default cache is
made bigger (128 -> 256).
|
|
|
|
|
|
|
|
|
|
The minor versions should be upper compatible. So mere opcode, section
addition can be done without breaking compiled binary.
|
|
- no OP_EXT_ anymore
- OP_LOADI16 in right position
|