summaryrefslogtreecommitdiffhomepage
path: root/src/vm.c
AgeCommit message (Collapse)Author
2017-08-30Fixed a critical typo; ref #3798Yukihiro "Matz" Matsumoto
2017-08-29Need to update `ci` after `callinfo` stack reallocation; fix #3796Yukihiro "Matz" Matsumoto
2017-08-26Silence compiler warning regarding float condition; fix #3790Yukihiro "Matz" Matsumoto
2017-08-23Asserted bidx < ci->nregs for OP_SEND and OP_SUPERChristopher Aue
2017-08-18Separate `mrb_str_buf_new` and `mrb_str_new_capa`.Yukihiro "Matz" Matsumoto
`mrb_str_buf_new` is an old function that ensures capacity size of `MRB_STR_BUF_MIN_SIZE` minimum. Usually one need to use `mrb_str_new_capa` instead.
2017-08-18Reset ci in OP_SUPER after potential reallocChristopher Aue
2017-08-12Reintroduced not storing converted proc directly in the stackChristopher Aue
2017-08-12Removed unneeded ci->nregs checks in OP_SEND and OP_SUPERChristopher Aue
Because of #3504 `ci->nregs = bidx+1` was introduced in b64f08784cc50861dec80c26fce715982c02c9e9. This led to the follow up error #3551 whose fix introduced the `if (bidx >= ci->nregs)` check in 071164b7999d0932fd60fb3c580a6c374ab1cf4f and the `stack_extend(mrb, ci->nregs)` in 93d802987e722444d0520a8d3f28002841c4f825. Then, the code causing #3504 reappeared again in #3590. The fix for it moved the code dealing with the block in OP_SUPER from below the `cipush` to above the `cipush` in d9fb8b69b0621e8cd2c7c43fd8511a83718d7e45. The `if (bidx >= ci->nregs) { ... }` from then on works with the original callinfo and not the pushed one. `ci->nregs` needed to be modified for the pushed one because it is initialized to 0. But for the original ci it is propertly set and a check is not needed.
2017-08-12Extended stack always based on ci->nregsChristopher Aue
2017-08-12Refactored variable usage in OP_SEND and OP_SUPERChristopher Aue
2017-08-11Remove some empty lines; ref #3778Yukihiro "Matz" Matsumoto
2017-08-11Refactored OP_SEND and OP_SUPER and calculate argc right at the topChristopher Aue
2017-08-11Defer `mid` update after `unshift`; ref #3776Yukihiro "Matz" Matsumoto
2017-08-11Merge branch 'super_method_missing_fix' of ↵Yukihiro "Matz" Matsumoto
https://github.com/christopheraue/mruby into christopheraue-super_method_missing_fix
2017-08-11Silence integer type conversion warnings.Yukihiro "Matz" Matsumoto
2017-08-10Fixed calling missing method through super with 126 argsChristopher Aue
2017-08-09Replaced tabs with spacesChristopher Aue
2017-08-09Wrong blkargs pos for vararg; ref #3768Yukihiro "Matz" Matsumoto
2017-08-09The block argument offset saved in the env was wrong; fix #3768Yukihiro "Matz" Matsumoto
When the method takes variable number of argument (`argc = -1`), the block argument offset should be `-1` not `0`.
2017-08-08Float values divided by zero should honor signs; fix #3766Yukihiro "Matz" Matsumoto
It also fixes unexpected resurrection of #3745 by #3752
2017-08-08Set the current `pc` as the error position in `OP_ERR`; ref #3765Yukihiro "Matz" Matsumoto
2017-08-01Implements `Module::nesting' (15.2.2.3.2); ref #600, #3200Yukihiro "Matz" Matsumoto
2017-07-27Embed small size array elements in the heap.Yukihiro "Matz" Matsumoto
It reduces the memory consumption and sometimes improve the performance as well. For example, the consumed memory size of `bench/bm_ao_render.rb` is reduced from 1.2GB to 1GB, and its total execution time become 18.795 sec from 22.229 sec.
2017-07-27Remove loop from `OP_POPERR`.Yukihiro "Matz" Matsumoto
2017-07-25`0/0` should not be infinity; fix #3752Yukihiro "Matz" Matsumoto
2017-07-24Clear mrb_callinfo struct by zero initializer.Yukihiro "Matz" Matsumoto
2017-07-21Need to unshare env on OP_R_BREAK too.Yukihiro "Matz" Matsumoto
2017-07-21Move NULL check to `mrb_env_unshare()`; ref #3750Yukihiro "Matz" Matsumoto
2017-07-21Should not raise `LocalJumpError` on funcall'ed frame; fix #3750Yukihiro "Matz" Matsumoto
2017-07-19Avoid C undefined behavior of division by zero; close #3745Yukihiro "Matz" Matsumoto
2017-07-18Simplify `mrb_gc_arena_restore()` to reduce overhead.Yukihiro "Matz" Matsumoto
It will no longer shrink arena region. Instead `vm.c` uses a static function `mrb_gc_arena_shrink()` to shrink.
2017-07-12Add `inline` modifier to `cipush()` and `cipop()` functions.Yukihiro "Matz" Matsumoto
2017-07-05Check stack size before accessing env stack; fix #3727Yukihiro "Matz" Matsumoto
2017-07-01`break` should not cross fiber-context boundary; fix #3724Yukihiro "Matz" Matsumoto
2017-07-01`super` may be called from a block; fix #3723Yukihiro "Matz" Matsumoto
2017-06-21Should call `ecall()` before callinfo adjustment; fix #3715Yukihiro "Matz" Matsumoto
2017-06-20#3711 fixMiura Hideki
2017-06-17Store operands to local variables.Yukihiro "Matz" Matsumoto
Mostly for debugging purpose.
2017-06-16Allow `break` from a block called by `mrb_yield`; close #3359Yukihiro "Matz" Matsumoto
This means #3701 is now OK to merge.
2017-06-16Need to unshare env from top callinfo; fix #3685Yukihiro "Matz" Matsumoto
2017-06-15Call write barriers for stack-modified fibers; fix #3699Yukihiro "Matz" Matsumoto
2017-06-15Protect the last exception object from GC in `ecall`; fix #3702Yukihiro "Matz" Matsumoto
2017-06-15Save the register value in a local variable for ease of debugging.Yukihiro "Matz" Matsumoto
2017-06-15Ensure size of the stack before handling exceptions; fix #3693Yukihiro "Matz" Matsumoto
2017-06-15Ensure size of the stack in OP_CALL.Yukihiro "Matz" Matsumoto
2017-06-14Clear stack in OP_CALL; fix #3694Yukihiro "Matz" Matsumoto
2017-06-14Fixed uninitialized local variable bug; ref #3692Yukihiro "Matz" Matsumoto
2017-06-14Avoid out-of-bound access of VM stack in OP_SENDB; fix #3692Yukihiro "Matz" Matsumoto
2017-06-03Revert "Simplify rescue stack management; ref #3683"Yukihiro "Matz" Matsumoto
This reverts commit eb5a606fe209944d0757301edb331ed7ff0fd31f and 079f310fbc9c23b97f062230c32bd91ac65e4835. The rescue stack works differently from ensure stack, so the change caused #3686 and #3688. It might take long to solve the problems, so that I would revert the changes for now. Fix #3688
2017-06-03Check if a block is a lambda before marking it orphan; ref #3640Yukihiro "Matz" Matsumoto