| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
- `MRB_64BIT`: the size of a pointer is 64 bits
- `MRB_INT64`: the size of `mrb_int` is 64 bits
|
|
|
|
|
|
Type `mrbc -S -B<init> -o<outfile> <rbfiles...>` to generate the C
source code that holds compiled `mrb_irep`.
Appending the following code to the bottom of the generated code,
`mruby` executes the compiled code:
```C
int
main()
{
mrb_state *mrb = mrb_open();
struct RProc *p = mrb_proc_new(mrb, &init_irep);
mrb_vm_run(mrb, p, mrb_top_self(mrb), 0);
mrb_close(mrb);
return 0;
}
```
Eventually static compile should use this representation, instead
of `uint8_t` array that holds `mrb` data, so that we can skip
interpreting `mrb` data.
|
|
We no longer need 4 bytes alignment after we moved to the byte oriented
instructions.
|
|
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
|
|
But we need more work:
- recursive `irep` dump (`irep->reps`)
- pool values dump (`irep->pool`)
|
|
- `pool`
- `syms`
- `reps`
|
|
The `FLAG_BYTEORDER_NATIVE` and `FLAG_BYTEORDER_NONATIVE` are no longer
needed.
|
|
Since `mruby 2.0`, compiled bytecode no longer depends on the
endian of the machine.
|
|
|
|
* mrb_sym2name -> mrb_sym_name
* mrb_sym2name_len -> mrb_sym_name_len
* mrb_sym2str -> mrb_sym_str
|
|
`%g` use shorter representation than `%e`.
|
|
Example:
# example.rb
p(2e308)
p(-2e308)
Good:
$ bin/mruby example.rb
inf
-inf
Bad:
$ bin/mrbc example.rb
$ bin/mruby -b example.mrb
0
-0
Cause:
Float infinity representation is `inf` on dump and it is converted by
corresponding `String#to_f` on load.
Treatment:
- Introduce new representations (`i`: +infinity, `I`: -infinity)
- Allow old representations (`inf`, `-inf`, `infinity`, `-infinity`) too
- Raise error for unknown representations (use corresponding `Kernel#Float`)
|
|
This patch slightly reduce memory consumption (2% for my test).
|
|
|
|
|
|
|
|
|
|
to 'uint16_t', possible loss of data
|
|
to 'uint16_t', possible loss of data
|
|
|
|
|
|
|
|
Otherwise, C++ compilers will skip this constant when producing object files.
|
|
|
|
|
|
changes:
* rename DISABLE_STDIO -> MRB_DISABLE_STDIO
* rename ENABLE_DEBUG -> MRB_ENABLE_DEBUG_HOOK
* no more opposite macro definitions (e.g. ENABLE_STDIO, DISABLE_DEBUG).
* rewrite above macro references throughout the code.
* update documents
|
|
IEC 60559 single format has 6 to 9 significant decimal digits precision.
However the printf conversion specifier e (and E, of course) already
writes 1 digit - the one before the decimal point - and precision
specifies the number of digits to write after the decimal point.
|
|
No need to optimize since a program only exits once and errors are rare.
Also the mruby source code doesn't have these kind of checks elsewhere.
The ones in {Time,Random}#initialize are kept because there it actually
matters
since initialization always happens and re-initialization is unlikely.
|
|
|
|
Not needed anymore since 85075bef7583edd0a48cfbdfaa632cbdacf78f2c
|
|
Some C compilers may allow other characters in identifiers such as $.
They may also implement C99's extended identifiers (\u30EB\u30D3\u30FC,
ルビー).
|
|
|
|
No need to write the same assertion in each case (except the default
one). Instead we can assert after the switch statement.
|
|
The new implementation is backwards incompatible, but I couldn't find
any usage outside mruby and I also couldn't think of a different and
good name.
All ISO C99 printf conversion specifiers for floating point numbers and
an optional precision are supported.
It is largely based on code from the MIT licensed musl libc
(http://www.musl-libc.org/) and its floating point printing is exact
(unlike the current code behind Float#to_s).
|
|
|
|
`mruby -b` now accepts both big/little endian mrb (compiled binary) files.
`mrbc` generates mrb files in big endian for .mrb files and in native endian
for C files (with -B option specified) by default. If you are cross compiling,
you need to specify target endian by -e/-E options if it is different from
host endian.
|
|
|
|
|
|
Add padding bytes before iseq block that may be used as mrb_code[].
Note that dumped mrb format has changed.
Based on a patch from kimu_shu <[email protected]>
|
|
|
|
for mrbtest
|
|
|
|
|
|
|
|
|