summaryrefslogtreecommitdiffhomepage
path: root/include
AgeCommit message (Collapse)Author
2020-10-12Split `MRB_BINARY_FORMAT` to major and minor.Yukihiro "Matz" Matsumoto
The minor versions should be upper compatible. So mere opcode, section addition can be done without breaking compiled binary.
2020-10-12Update opcode reference and comment.Yukihiro "Matz" Matsumoto
- no OP_EXT_ anymore - OP_LOADI16 in right position
2020-10-12Remove `OP_EXT[123]` from operands.Yukihiro "Matz" Matsumoto
2020-10-12Add `const` to `irep` structure to place data on ROM.Yukihiro "Matz" Matsumoto
2020-10-12Specify the size of `struct RStringEmbed` array part.Yukihiro "Matz" Matsumoto
2020-10-12Clarify the use of `MRB_64BIT` and `MRB_INT64` in `dump.c` and `load.c`.Yukihiro "Matz" Matsumoto
- `MRB_64BIT`: the size of a pointer is 64 bits - `MRB_INT64`: the size of `mrb_int` is 64 bits
2020-10-12Generate C struct from `irep` instead of binary dump.Yukihiro "Matz" Matsumoto
2020-10-12Generate C source file to represent `mrb_irep` structures.Yukihiro "Matz" Matsumoto
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.
2020-10-12Replace entire `irep->pool`.Yukihiro "Matz" Matsumoto
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
2020-10-12Rename `struct mrb_locals` to `struct mrb_lvinfo`.Yukihiro "Matz" Matsumoto
That stands for "local variable information".
2020-10-12Add `irep` C struct dump from `mrbc` with `-S` option.Yukihiro "Matz" Matsumoto
But we need more work: - recursive `irep` dump (`irep->reps`) - pool values dump (`irep->pool`)
2020-10-12Add `const` modifier to `mrb_irep` for `code_fetch_hook`.Yukihiro "Matz" Matsumoto
2020-10-12Stringify non C identifier symbols to stop macro errors by old gcc.Yukihiro "Matz" Matsumoto
2020-10-12Constify `irep` members.Yukihiro "Matz" Matsumoto
- `pool` - `syms` - `reps`
2020-10-12Change the arguments of following implicit conversion functions:Yukihiro "Matz" Matsumoto
- `mrb_convert_type` - `mrb_check_convert_type` Those function no longer take `tname` string representation of desired type, and take method symbols instead of `const char*` names. This is incompatible change. I hope no third-party gems use those functions.
2020-10-12Provide functions that take symbols instead of `const char*`.Yukihiro "Matz" Matsumoto
- mrb_define_class_id - mrb_define_module_id - mrb_define_method_id - mrb_define_singleton_method_id - mrb_define_module_function_id - mrb_define_const_id - mrb_undef_method_id - mrb_undef_class_method_id - mrb_class_defined_id - mrb_class_get_id - mrb_class_defined_under_id - mrb_class_get_under_id - mrb_module_get_id - mrb_module_get_under_id - mrb_define_class_under_id - mrb_define_module_under_id - mrb_exc_get_id
2020-10-12Add functions that take symbols as arguments.Yukihiro "Matz" Matsumoto
- :
2020-10-12Define a new function `mrb_funcall_id()`.Yukihiro "Matz" Matsumoto
`mrb_funcall_id()` takes `mrb_sym` instead of `char*` for a method name. You can use `MRB_SYM()`/`MRB_QSYM()` to specify the method to call.
2020-10-12Rename `MRB_OPSYM()` to `MRB_QSYM()`.Yukihiro "Matz" Matsumoto
Where `QSYM` means quoted symbols, which cannot be represented C symbols, so specify aliases instead. - operators: name of the operation, e.g. add for `+` - predicates: add `_p` suffix instead of `?` - bang methods: add `_b` suffix instead of `!` - instance variables: add `a_` prefix instead of `@` - global variables: add `d_` prefix instead of `@` - class variables: unsupported; don't use them
2020-10-12Create `MRB_OPSYM()` macro to refer symbols corresponding operators.Yukihiro "Matz" Matsumoto
For example, `MRB_OPSYM(add)` refers a symbol for `+`.
2020-10-12Undefine internal macros in `presym.h`.Yukihiro "Matz" Matsumoto
- MRB_PRESYM_CSYM - MRB_PRESYM_SYM
2020-10-12Add `MRB_SYM()` for inline symbols.Yukihiro "Matz" Matsumoto
2020-09-25Prohibit string changes by "s"/"z" specifier of `mrb_get_args()`dearblue
- The `s` specifier is a string pointer obtained without performing `mrb_str_modify()`, so it cannot be changed. - The `z` specifier cannot be changed because it is a string pointer obtained by `RSTRING_CSTR()` which returns `const char *`.
2020-09-10Merge pull request #4933 from dearblue/variablesYukihiro "Matz" Matsumoto
Fix take over file scope variables with `mruby` and `mirb` command
2020-09-03Remove `enum call_type`dearblue
It seems to be unnecessary from mruby-1.0.0 or earlier.
2020-08-29mruby-io: Fixing compilation issue under the legacy MinGW environmentSiZiOUS
Adding MRB_MINGW32_LEGACY in common.h in order to identify the legacy MinGW environment (i.e. NOT to be confused with MinGW-w64). For more info about MinGW defined macros, see: https://sourceforge.net/p/predef/wiki/Compilers/
2020-08-12Simplify MSVC detection to `mrb_static_assert`KOBAYASHI Shuji
2020-08-11Merge pull request #5062 from ↵Yukihiro "Matz" Matsumoto
shuujii/use-normal-static_assert-in-mrb_static_assert-as-much-as-possible Use normal `static_assert` in `mrb_static_assert` as much as possible
2020-08-11Use normal `static_assert` in `mrb_static_assert` as much as possibleKOBAYASHI Shuji
* `_Static_assert` can also be used with `-std=gnu99` on GCC >= 4.6. * `static_assert` can be used on MSVC. * `static_assert` can be used even on old G++/Clang++ if `__GXX_EXPERIMENTAL_CXX0X__` is defined.
2020-08-11Fix `mrb_int` and `size_t` combination warnings.Yukihiro "Matz" Matsumoto
2020-08-09Allow `mrb_static_assert()` to be used outside of functionsKOBAYASHI Shuji
The use of `struct` is an idea by @dearblue.
2020-08-08Reintroduce `mrb_static_assert`; #5051Yukihiro "Matz" Matsumoto
Note that the home brew version of `mrb_static_assert` only works within the function body. This reverts commit 8f99689.
2020-08-06Merge pull request #5059 from mruby/stableYukihiro "Matz" Matsumoto
Merge mruby 2.1.2
2020-08-06Merge master.Hiroshi Mimaki
2020-08-06Remove `mrb_static_assert` from the core; #5051Yukihiro "Matz" Matsumoto
2020-08-06Update release date.2.1.2Hiroshi Mimaki
2020-07-31Simplify `khash.h`.Yukihiro "Matz" Matsumoto
- Remove ` kh_put_prepare` function used only internally - Remove `n_occupied` member from `kh_` struct
2020-07-29Fixed shift width for `MRB_ENV_SET_BIDX()`dearblue
ref c07f24cd1 and close #5035
2020-07-24Improve prototype for `mrb_objspace_page_slot_size()`; ref #5032dearblue
If it qualify a return type that is not a pointer with `const`, the compiler ignores it.
2020-07-17Merge pull request #5038 from dearblue/bidxYukihiro "Matz" Matsumoto
Fixed shift width for `MRB_ENV_SET_BIDX()`
2020-07-16Fixed shift width for `MRB_ENV_SET_BIDX()`dearblue
ref c07f24cd1 and close #5035
2020-07-15mrb_ prefix conventionRory O'Connell
2020-07-13Use object iv table size in calculationRory OConnell
2020-07-13Use size of hash's table in calculationRory OConnell
2020-07-13All values use page slot size in calculationRory OConnell
2020-07-01Update version to `2.1.2`. (mruby 2.1.2 RC)2.1.2-rcHiroshi Mimaki
2020-06-25Change flag names in preparation of `REnv` refactoring.Yukihiro "Matz" Matsumoto
2020-06-20Add `mrb_get_arg1()` that retrieves single (and only) argument.Yukihiro "Matz" Matsumoto
`mrb_get_arg1()` raises `ArgumentError` if the method does not receive one argument. And replaces all `mrb_get_args(mrb, "o", &arg)` by the new function.
2020-06-15Remove unnecessary comments from `MRB_TT_*` definitions.Yukihiro "Matz" Matsumoto
2020-06-15Remove unused `MRB_TT_FILE`.Yukihiro "Matz" Matsumoto