| Age | Commit message (Collapse) | Author |
|
It became 32 bits in #5200, but only the upper 16 bits were printed.
|
|
|
|
Fix heap buffer overflow when dump irep
|
|
Currently, the size of writing in heap by write_irep_record() is
bigger than The size that is calculated by get_irep_record_size.
Therefore, irep is dumped over the size of allocating memory when we
execute dump_irep().
|
|
Follow commit 7150c6753933f12a2ba63769fb7b3a44cfcddd3d .
|
|
Previously, presym files were always created in `build/{presym,presym.inc}`.
However, this constraint is inconvenient because it is common to use
multiple build configurations and build targets in a single mruby tree.
Therefore, change to create presym file for each build target.
|
|
|
|
Jump target address is `operand (16bit)` + `address of next instruction`.
In addition, `ilen` was made `uint32_t` so that `iseq` length limitation
of 65536 is removed. Only jump target address should be within signed
16bit (-32768 .. 32767).
|
|
|
|
|
|
|
|
There's no efficiency difference since `cdump` is implemented.
|
|
However, compiling by `mrbc` fails with another issue (#5116).
|
|
|
|
Optimize `presym_find`
|
|
Also added `no-float.rb` target in `build_config`.
|
|
Chang to compare string length first.
### Benchmark
#### Code
* https://github.com/shuujii/mruby-presym_find-benchmark
#### Result
```console
Previous: 10.240772M i/s (25M times in 2.441222s)
New: 16.412985M i/s (25M times in 1.523184s)
```
|
|
|
|
|
|
|
|
|
|
Improved `Object#define_singleton_method`
|
|
Integrate the implementation with `Module#define_method`.
- Introduce the internal function `mrb_mod_define_method_m()` (no static)
- The `Object#define_singleton_method` method can now accept a second argument
|
|
| Previous Name | New Name |
|------------------------------|-------------------------|
| MRB_ENABLE_ALL_SYMBOLS | MRB_USE_ALL_SYMBOLS |
| MRB_ENABLE_SYMBOLL_ALL | MRB_USE_ALL_SYMBOLS |
| MRB_ENABLE_CXX_ABI | MRB_USE_CXX_ABI |
| MRB_ENABLE_CXX_EXCEPTION | MRB_USE_CXX_EXCEPTION |
| MRB_ENABLE_DEBUG_HOOK | MRB_USE_DEBUG_HOOK |
| MRB_DISABLE_DIRECT_THREADING | MRB_NO_DIRECT_THREADING |
| MRB_DISABLE_STDIO | MRB_NO_STDIO |
| ENABLE_LINENOISE | MRB_USE_LINENOISE |
| ENABLE_READLINE | MRB_USE_READLINE |
| DISABLE_MIRB_UNDERSCORE | MRB_NO_MIRB_UNDERSCORE |
| DISABLE_GEMS | MRB_NO_GEMS |
* `MRB_ENABLE_SYMBOLL_ALL` seems to be a typo, so it is fixed.
* `MRB_` prefix is added to those without.
* The previous names can also be used for compatibility.
|
|
shuujii/move-some-.rake-files-to-tasks-directory-for-consistency
Move some `.rake` files to `tasks` directory for consistency
|
|
|
|
|
|
|
|
This object is treated as an immediate value.
|
|
|
|
|
|
|
|
|
|
|
|
Check if irep->reps is NULL in lv_defined_p
|
|
|
|
shuujii/use-mrb_int_value-instead-of-mrb_fixnum_value-in-src-hash.c
Use `mrb_int_value` instead of `mrb_fixnum_value` in `src/hash.c`
|
|
|
|
|
|
I misunderstand the meaning of #4483. Sorry.
|
|
|
|
- Remove `mrb_ssize`
- Fix `MRB_FIXNUM_{MIN,MAX}` to 32 bits on `MRB_NAN_BOXING`
|
|
|
|
|
|
Avoid undefined behavior
|
|
### ASAN report (`MRB_INT32`)
```console
$ bin/mruby -ve '-0x40000000'
mruby 3.0.0preview (2020-10-16)
00001 NODE_SCOPE:
00001 NODE_BEGIN:
00001 NODE_NEGATE:
00001 NODE_INT 40000000 base 16
irep 0x6070000001e0 nregs=2 nlocals=1 pools=0 syms=0 reps=0 iseq=9
file: -e
/mruby/src/codedump.c:173:49: runtime error: left shift of 49152 by 16 places cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mruby/src/codedump.c:173:49 in
1 000 OP_LOADI32 R1 -1073741824
1 006 OP_RETURN R1
1 008 OP_STOP
/mruby/src/vm.c:1138:7: runtime error: left shift of 49152 by 16 places cannot be represented in type 'mrb_int' (aka 'int')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mruby/src/vm.c:1138:7 in
```
|
|
|
|
### Example (32-bit Word-boxing)
```ruby
# example.rb
int_count = ObjectSpace.count_objects[:T_INTEGER]||0
int = 1<<30
p (ObjectSpace.count_objects[:T_INTEGER]||0) - int_count
int = nil
GC.start
p (ObjectSpace.count_objects[:T_INTEGER]||0) - int_count
```
#### Before this patch:
```console
$ bin/mruby example.rb
1
1
```
#### After this patch:
```console
$ bin/mruby example.rb
1
0
```
|
|
|
|
Should raise `RangeError` if the operation overflows.
|