| Age | Commit message (Collapse) | Author |
|
|
|
chore: fix spelling
|
|
Reorganize `mcall()` in `mruby-method`
|
|
The following methods will be made static.
- `Class#new`
- `Proc#call`
- `Kernel#catch`
Previously, static const RProc could not be registered as a method, but this has been changed to allow it.
|
|
Use `mrb_exec_irep()`. If possible, re-entry into the VM will be suppressed.
Note that due to the effect of being a tail-call, the backtrace of `Method#call` will be lost, and it will look as if the target method was called directly.
This change fixes the problem of infinite loops when redefining methods that make block calls using `mruby-method`.
```console
% bin/mruby -e 'mm = method(:proc); define_method(:proc, ->(*a, &b) { mm.call(*a, &b) }); p proc { 1 }'
trace (most recent call last):
[257] -e:1
[256] -e:1:in proc
[255] -e:1:in proc
...SNIP...
[1] -e:1:in proc
-e:1:in proc: stack level too deep (SystemStackError)
```
|
|
Change the old `mrb_exec_irep()` as-is to static `mrb_exec_irep_vm()`.
Extract the VM entry part from the old `exec_irep()` in `mruby-eval/src/eval.c` and make it the core of the new `mrb_exec_irep()`.
|
|
|
|
Under C++, there is no implicit conversion from `int` to `enum`, which caused a compilation error.
|
|
- (old) `undefined method 'foo'`
- (new) `no superclass method 'foo'`
|
|
|
|
Add support for partial backtraces
|
|
|
|
Adds debug source information (line/file) when mrbc uses -g.
This commit results in usable backtraces for all gems when build_config
is setup with enable_debug.
|
|
When debug information is omitted within ireps, show that a stack
frame existed rather than silently hiding it.
|
|
|
|
|
|
Fix `SIGSEGV` with mruby-method + mruby-catch
|
|
- `mrb_num_div_int(mrb,x,y)` -> `mrb_div_int(mrb,x,y)`
- `mrb_num_div_flo(mrb,x,y)` -> `mrb_div_flo(x,y)`
They are internal function not supposed to be used outside of the core.
|
|
Previously, the following code would cause a `SIGSEGV`.
```ruby
mm = method(:throw)
define_method(:throw, ->(*args) { mm.call(*args) })
catch { |tag| throw tag }
```
I think the reason is in the `mrb_yield_with_class()` function:
- Even if a C function is called, `CI_ACC_SKIP` is used
- `cipop()` is not done if globally jumping from a C function
|
|
- define `MRB_TT_COMPLEX`
- change object structure (`struct RComplex`)
- add memory management for `MRB_TT_COMPLEX`
- avoid operator overloading as much as possible
- as a result, performance improved a log
- should work with and without `Rational` defined
|
|
- define `MRB_TT_RATIONAL`
- change object structure (`struct RRational`)
- add memory management for `MRB_TT_RATIONAL`
- avoid operator overloading as much as possible
- implement division overloading in C
- as a result, performance improved a lot
|
|
Since `mruby` does not have `Bignum`, `Float#divmod` could overflow, so
it will return `Float` values when the divided value does not fit in
`mrb_int`. This behavior will be changed when `Bignum` is introduced to
`mruby` in the future.
|
|
|
|
#### Before this patch:
```console
$ bin/mruby -e 'p(Float::NAN/0)'
Infinity
```
#### After this patch (same as Ruby):
```console
$ bin/mruby -e 'p(Float::NAN/0)'
NaN
```
|
|
|
|
It used to be return the default value if available, but it should
ignore the default value for behavior consistency. CRuby will adopt
this behavior too in the future. [ruby-bugs:16908]
|
|
|
|
|
|
Add new pool value type `IREP_TT_BIGINT` and generate integer overflow
error in the VM. In the future, `mruby` will support `Bignum` for
integers bigger than `mrb_int` (probably using `mpz`).
|
|
bug(presym): Fix mrb_cmp declaration of <=> symbol for funcall
|
|
|
|
|
|
|
|
|
|
|
|
Fixes C++03 compilation.
|
|
|
|
- Added to `mruby-binding-core`
- `Binding#local_variable_defined?`
- `Binding#local_variable_get`
- `Binding#local_variable_set`
- `Binding#local_variables`
- `Binding#receiver`
- `Binding#source_location`
- `Binding#inspect`
- Added to `mruby-proc-binding`
- `Proc#binding`
The reason for separating `Proc#binding` is that core-mrbgems has a method that returns a closure object to minimize possible problems with being able to manipulate internal variables.
By separating it as different mrbgem, each user can judge this problem and incorporate it arbitrarily.
|
|
Make changes to make `Binding` work.
At the same time, it separates `Binding#eval`, which depends on `mruby-eval`, from `mruby-binding-core`.
|
|
|
|
|
|
shuujii/fix-type-tag-that-set-to-NilClass-and-FalseClass
Fix type tag that set to `NilClass` and `FalseClass`
|
|
shuujii/add--s-option-to-mrbc-for-make-variable-static
Add `-s` option to `mrbc` for make variable static
|
|
|
|
|
|
|
|
|
|
|
|
In `h_check_modified()`, in the case of `MRB_NO_BOXING`, `ht_ea()` or
`ht_ea_capa()` for AR may read uninitialized area. Therefore, do not use
those macros for AR in `MRB_NO_BOXING` (but in the case of `MRB_64BIT`,
`ht_ea_capa()` is the same as `ar_ea_capa()`, so use it).
fix #5332
|
|
|