summaryrefslogtreecommitdiffhomepage
path: root/src
AgeCommit message (Collapse)Author
2017-12-23Do not include object string representation in `NoMethodError` message.Yukihiro "Matz" Matsumoto
This information is not mandatory but causes a lot of problems in the past due to infinite recursion by redefining `to_str`, `inspect` etc.
2017-12-23`super` should raise `TypeError` when the receiver is switched; fix #3911Yukihiro "Matz" Matsumoto
The receiver can be switched using `#instance_eval` etc.
2017-12-23Avoid infinite recursion in `method_missing`; ref #3908Yukihiro "Matz" Matsumoto
2017-12-23May need more stack space in `mrb_funcall_with_block`; fix #3908Yukihiro "Matz" Matsumoto
2017-12-23Should not overwrite `ci->target_class` in `mrb_exec_irep()`.Yukihiro "Matz" Matsumoto
For example, the following code behaved wrong: ```ruby Object.instance_exec(1,2,3){|*a| def foo 42 end } p foo() ```
2017-12-23Make source compilable with C++17Lothar Scholz
Changes applied: - Removing "register" keyword - Fixing const pointer to pointer assignments - Adding type casts to rb_malloc calls
2017-12-20Do not need to take `target_class` from the upper proc.Yukihiro "Matz" Matsumoto
Since it is already set in `mrb_proc_new()`.
2017-12-20Should not overwrite `MRB_PROC_TARGET_CLASS(p)` if `p` has env; fix #3905Yukihiro "Matz" Matsumoto
2017-12-20Fixed method look-up for `method_missing` in OP_SUPER; ref #3905Yukihiro "Matz" Matsumoto
Method look-up for `OP_SUPER` should start from the superclass of the `target_class` but if it fails, the look-up for `method_missing` should start from the class of the receiver. The following code explains the case: ```ruby class Bar def foo super end end class Foo<Bar def method_missing(mid, *) p mid end end ``` Foo.new.foo
2017-12-20The superclass info should be taken from `TARGET_CLASS(ci->proc).Yukihiro "Matz" Matsumoto
Not from `ci->target_class` that may be switched using `class_eval` etc. fix #3899, fix #3906 We found out there is a mruby specific limitation that `super` may be screwed up when a method is defined in a module and `super` is called in the block with the target class switched (for example, `super` in `class_eval` block). Now we raise `RuntimeError` for such cases. The following code works in CRuby but not in mruby. ``` module M def foo "aaa".singleton_class.class_eval{super 2} end end class Foo def foo(*); end end class Bar<Foo include M end Bar.new.foo ```
2017-12-16Need to set `ci->proc` before calling methods; fix #3902Yukihiro "Matz" Matsumoto
2017-12-16Need to clear exception handler on `return`; fix #3898Yukihiro "Matz" Matsumoto
2017-12-15Check if destinations are too distant; fix #3900 fix #3901Yukihiro "Matz" Matsumoto
2017-12-13Retrieve operands at the beginning of `OP_SCLASS`.Yukihiro "Matz" Matsumoto
2017-12-13Fixed wrong `MRB_WITHOUT_FLOAT` condition; ref #3827Yukihiro "Matz" Matsumoto
2017-12-12Modifying frozen objects will raise `FrozenError`.Yukihiro "Matz" Matsumoto
`FrozenError` is a subclass of `RuntimeError` which used to be raised. [Ruby2.5]
2017-12-07Cancel df3507660 that does not do any good.Yukihiro "Matz" Matsumoto
2017-12-07Avoid updating to reallocated stack in `OP_RETURN`; fix #3870Yukihiro "Matz" Matsumoto
The code was introduced to address #3175 but it's no longer needed.
2017-12-06The `ci` should not be equal to `cibase` with `OP_R_BREAK`; #3871Yukihiro "Matz" Matsumoto
2017-12-06The proc with top-level env must be 'proc-closure'; fix #3871Yukihiro "Matz" Matsumoto
2017-12-06Limit `ecall()` depth to 32 (default).Yukihiro "Matz" Matsumoto
2017-12-06`mrb_method_search_vm()` should gives the defined class.Yukihiro "Matz" Matsumoto
Otherwise `super` may call a wrong method.
2017-12-05Need to set `ci->proc` when we have `RProc` structure.Yukihiro "Matz" Matsumoto
Mentioned in https://qiita.com/bamchoh/items/eabebbbb330cb0e0470a
2017-12-04Need to unshare env stack on `break`; fix #3866Yukihiro "Matz" Matsumoto
2017-12-04Remove temporary objects from GC arena in `mrb_vformat()'; #3863Yukihiro "Matz" Matsumoto
2017-12-04Check if `ci->proc` is not `NULL` and `MRB_PROC_CFUNC_P()`; fix #3867Yukihiro "Matz" Matsumoto
2017-12-04Pop exception objects from the bottom of GC arena; fix #3863Yukihiro "Matz" Matsumoto
2017-12-01The stack shift width should be determined by `p->upper`; fix #3864Yukihiro "Matz" Matsumoto
And check required register number from `ci->proc` as well. The fixes for #3859 and #3862 were incomplete.
2017-11-30Avoid calling `mrb_env_unshare()` when `env` is `NULL`.Yukihiro "Matz" Matsumoto
Small performance improvement by reducing function invocations.
2017-11-30Avoid double free() of env stack; fix #3860Yukihiro "Matz" Matsumoto
Should turn on `MRB_ENV_STACK_UNSHARED` flag only after env stack reallocation. `malloc()` may fail.
2017-11-30Wrong stack adjustment in `ecall()` (f35f975 #3859); fix #3862Yukihiro "Matz" Matsumoto
2017-11-30Stop infinite recursion in `Class#to_s`; fix #3861Yukihiro "Matz" Matsumoto
2017-11-29Clear `c->prev` on fiber termination.Yukihiro "Matz" Matsumoto
2017-11-29Need to free contexts when freeing fibers.Yukihiro "Matz" Matsumoto
Memory leak fixed; ref #3711
2017-11-29Set `MRB_FIBER_TERMINATED` flag on exception termination of a fiber.Yukihiro "Matz" Matsumoto
2017-11-29Add `most recent call last` message to the backtrace.Yukihiro "Matz" Matsumoto
2017-11-29Call all ensure clauses pushed at `OP_STOP`.Yukihiro "Matz" Matsumoto
2017-11-29No need to use `ecall_adjust()`.Yukihiro "Matz" Matsumoto
2017-11-29Fixed stack address adjustment in `ecall()`; fix #3859Yukihiro "Matz" Matsumoto
2017-11-29Need to evaluate ensure clauses at fiber termination.Yukihiro "Matz" Matsumoto
2017-11-29Remove unnecessary code; ref #3711Yukihiro "Matz" Matsumoto
2017-11-22Provide shortcut comparison methods for numbers for performance.Yukihiro "Matz" Matsumoto
2017-11-22Stack adjustment should be based on `p->upper`; fix #3857Yukihiro "Matz" Matsumoto
It used to be based on `ci->proc` but the callinfo position may be wrong when `ecall()` is called during stack rewinding from `OP_RETURN`.
2017-11-22Clear ensure stack after calling in `OP_EPOP`; #3855 3856Yukihiro "Matz" Matsumoto
2017-11-22No need to pop ensure stack if `eidx` is smaller than `epos`; #3855 #3856Yukihiro "Matz" Matsumoto
2017-11-22fixup! Remove fixed argument of `ecall()`; ref #3855 #3856Yukihiro "Matz" Matsumoto
2017-11-22Remove fixed argument of `ecall()`; ref #3855 #3856Yukihiro "Matz" Matsumoto
2017-11-22Should have marked all ensure stack entries; fix #3855 fix #3856Yukihiro "Matz" Matsumoto
2017-11-20Reduce the size of `struct RBreak` to reduce memory usage.Yukihiro "Matz" Matsumoto
The old size of `struct RBreak` was 56 bytes (`MRB_NO_BOXING`) and it's bigger than other object structures. That increase the size of `RVALUE` thus increase the total amount of memory consumption.
2017-11-20Add `MRB_METHOD_TABLE_INLINE` option.Yukihiro "Matz" Matsumoto
Now the method tables (in classes/modules and caches) keeps C function pointers without wrapping in `struct RProc` objects. For the sake of portability, `mrb_method_t` is represented by the struct and union, but if the most significant bit of the pointer is not used by the platform, `mrb_method_t` should be packed in `uintptr_t` to reduce memory usage. `MRB_METHOD_TABLE_INLINE` is turned on by default for linux.