summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2018-08-30Update `RITE_BINARY_FORMAT_VER` and `RITE_VM_VER`.Yukihiro "Matz" Matsumoto
The bytecode format was updated so the header version constants must be updated as well.
2018-08-30Use `mrb_ensure_hash_type()` to check if an operand is a `Hash`; fix #4097Yukihiro "Matz" Matsumoto
2018-08-30Add new function `mrb_ensure_hash_type()`; ref #4097Yukihiro "Matz" Matsumoto
Unlike `mrb_check_hash_type()` that returns `nil` if the argument is not a `Hash`, `mrb_ensure_hash_type()` raises a `TypeError` exception.
2018-08-30Separate meta-programming features to `mruby-metaprog` gem.Yukihiro "Matz" Matsumoto
We assume meta-programming is less used in embedded environments. We have moved following methods: * Kernel module global_variables, local_variables, singleton_class, instance_variables, instance_variables_defined?, instance_variable_get, instance_variable_set, methods, private_methods, public_methods, protected_methods, singleton_methods, define_singleton_methods * Module class class_variables, class_variables_defined?, class_variable_get, class_variable_set, remove_class_variable, included_modules, instance_methods, remove_method, method_removed, constants * Module class methods constants, nesting Note: Following meta-programming methods are kept in the core: * Module class alias_method, undef_method, ancestors, const_defined?, const_get, const_set, remove_const, method_defined?, define_method * Toplevel object define_method `mruby-metaprog` gem is linked by default (specified in default.gembox). When it is removed, it will save 40KB (stripped:8KB) on x86-64 environment last time I measured.
2018-08-30Remove consequent `OP_RETURN` by peephole optimization.Yukihiro "Matz" Matsumoto
2018-08-30Need to clear `mrb->c->cibase->ridx` (toplevel ridx) at L_STOP; fix #4092Yukihiro "Matz" Matsumoto
This problem only appears when `mrb` executed multiple times (i.e. `mirb`)
2018-08-30`uint16_t` is too small for reference count; fix #4093Yukihiro "Matz" Matsumoto
Use `uint32_t` instead. Theoretically `uint32_t` can overflow as well, but I think it is sufficient size for embeddable Ruby VM.
2018-08-30The operand of `OP_ARYDUP` may not be an array; fix #4094Yukihiro "Matz" Matsumoto
This commit also fix #4096.
2018-08-29Fix off-by-one error in `OP_EPUSH` and `OP_ONERR`; fix #4095Yukihiro "Matz" Matsumoto
2018-08-29Merge pull request #4080 from 'ukrainskiysergey-node_negate_fix'Yukihiro "Matz" Matsumoto
2018-08-29Merge branch 'node_negate_fix' of https://github.com/ukrainskiysergey/mruby ↵Yukihiro "Matz" Matsumoto
into ukrainskiysergey-node_negate_fix
2018-08-29Check the size of rescue&ensure stacks; ref #4088Yukihiro "Matz" Matsumoto
Those small stack indexes can cause integer overflow.
2018-08-29Fix type of `eidx` and `ridx` from `uint8_t` to `uint16_t`; fix #4088Yukihiro "Matz" Matsumoto
A byte was too small to hold ensure&rescue stacks indexes.
2018-08-29Simplified `#ifdef` nesting in `codedump.c`; fix #4089Yukihiro "Matz" Matsumoto
`printf()` and related functions should not be called when `MRB_DISABLE_STDIO` is defined.
2018-08-29Check iseq buffer size before code emission; fix #4090Yukihiro "Matz" Matsumoto
The type of `s->pc` is now `uint16_t` that can be overflowed easily. Need more checks.
2018-08-29Move back `mrb_define_alias` to `mruby.h` to avoid breakage.Yukihiro "Matz" Matsumoto
2018-08-28Merge branch 'mruby2-draft'Yukihiro "Matz" Matsumoto
2018-08-25Reduce integer casting warnings.Yukihiro "Matz" Matsumoto
2018-08-25fixup! New bytecode implementation of mruby VM.Yukihiro "Matz" Matsumoto
2018-08-25Hash splat `**` should not be ignored.Yukihiro "Matz" Matsumoto
Implemented by adding `OP_HASHCAT` that merges hashes.
2018-08-25Fixed a bug in `OP_HASHADD`.Yukihiro "Matz" Matsumoto
2018-08-25Remove unused `Hash#__update` method.Yukihiro "Matz" Matsumoto
2018-08-25Add a new function `mrb_hash_merge()`.Yukihiro "Matz" Matsumoto
2018-08-25Remove unused `NODE_*` constants from `node.h`.Yukihiro "Matz" Matsumoto
2018-08-25Add `NODE_KW_HASH` support in `mrb_parser_dump()`.Yukihiro "Matz" Matsumoto
2018-08-25Remove `arg_value` from `parse.y`.Yukihiro "Matz" Matsumoto
2018-08-25Add bytecode support for `MRB_WORD_BOXING`.Yukihiro "Matz" Matsumoto
2018-08-25New bytecode implementation of mruby VM.Yukihiro "Matz" Matsumoto
2018-08-25Try to fix a fragile `File#mtime` test.Yukihiro "Matz" Matsumoto
2018-08-25Remove potential path to avoid uninitialized variable access.Yukihiro "Matz" Matsumoto
2018-08-25Simplify `mruby-inline-struct` tests.Yukihiro "Matz" Matsumoto
`gcc -O3` raises error on truncation using `snprintf`.
2018-08-25Make `Array.new` to accept both integers and floats.Yukihiro "Matz" Matsumoto
This time we used `Integral` module which is mruby specific.
2018-08-25Fix misspelling words in commentsKazuhiro Sera
2018-08-25Fixed the corner case bug in `String#{gsub!,sub!}`.Yukihiro "Matz" Matsumoto
`"a".sub!("a", "a")` should not return `nil`.
2018-08-25irep is released when Fiber is terminatedpyama86
2018-08-25Reimplement `Hash#compact!` to conform the standard behavior.Yukihiro "Matz" Matsumoto
`Hash#compact!` should return `nil` if the receiver does not change.
2018-08-25Rename ambiguous function names.Yukihiro "Matz" Matsumoto
`mrb_iv_p` -> `mrb_iv_name_sym_p` `mrb_iv_check` -> `mrb_iv_name_sym_check`
2018-08-25Remove utility functions: `mrb_vm_iv_{get,set}`.Yukihiro "Matz" Matsumoto
2018-08-25Revert 04dbbff.Yukihiro "Matz" Matsumoto
Use segment list for instance variable again to reduce memory.
2018-08-25Small refactoring.Yukihiro "Matz" Matsumoto
The macro `RCLASS_SUPER`, `RCLASS_IV_TBL` and `RCLASS_M_TBL` are removed from `include/mruby/class.h`.
2018-08-25Small refactoring of `flodivmod()`.Yukihiro "Matz" Matsumoto
2018-08-25Fix mrb_value size with MRB_WORD_BOXING on 32-bit modedearblue
2018-08-25Simply use `snprintf` instead of custom `fmt_fp`,Yukihiro "Matz" Matsumoto
Unless `MRB_DISABLE_STDIO` is set. `snprintf` is used anyway if mruby is configured to use `stdio`. This change reduces 8KB of program size on the Linux box.
2018-08-25Remove `nregs` member from `mrb_callinfo`.Yukihiro "Matz" Matsumoto
This means reducing one word per a call frame.
2018-08-25Should update `ci->env` to share the environment; fix #4073Yukihiro "Matz" Matsumoto
2018-08-25Reorganize flags values for classes; fix #3975Yukihiro "Matz" Matsumoto
Renamed flag macro names as well: `MRB_FLAG_IS_FROZEN` -> `MRB_FL_OBJ_FROZEN` `MRB_FLAG_IS_PREPENDED` -> `MRB_FL_CLASS_IS_PREPENDED` `MRB_FLAG_IS_ORIGIN` -> `MRB_FL_CLASS_IS_ORIGIN` `MRB_FLAG_IS_INHERITED` -> `MRB_FL_CLASS_IS_INHERITED`
2018-08-25Check size of the integer multiply before actual overflow; fix #4062Yukihiro "Matz" Matsumoto
2018-08-18`Kernel#p` should return an array of arguments; fix #4083Yukihiro "Matz" Matsumoto
Although the return value is not defined in ISO, it is better to behave as CRuby does.
2018-08-13Try to fix a fragile `File#mtime` test.Yukihiro "Matz" Matsumoto
2018-08-13Remove potential path to avoid uninitialized variable access.Yukihiro "Matz" Matsumoto