Repository navigation
Reorganize mrb_callinfo - #5272
Merged
Merged
Conversation
This is because it is enough to express the range up to (-1..255) or (-3..255).
If there is `env`, `env->c` means `target_class`.
This enhances self-containment. Previously `mrb_context::stack` had the current call level stack, but now it owns it. The `mrb_context::stack` field, which is no longer needed, will be removed.
This enhances self-containment. - Changed the `mrb_callinfo::pc` field to point to itself. Previously it indicated the return destination of the previous call level. `mrb_callinfo::pc` will now hold the address to its own `proc->body.irep->iseq`. - Removed `mrb_callinfo::err` field. This is because `mrb_callinfo::pc - 1` is semantically the same as the previous `err`. - The `pc0` and `pc_save` variables in `mrb_vm_exec()` are no longer needed and have been deleted. - It removes the argument because `cipush()` doesn't need to save the previous `pc`.
…ruby#5261" This reverts commit a0c1e07. This is because the `mrb_callinfo::pc` has been reorganized, resulting in over-correction.
matz
reviewed
Jan 11, 2021
| if (c->vmexec) { | ||
| c->vmexec = FALSE; | ||
| mrb->c->ci->acc = CI_ACC_RESUMED; | ||
| c->cibase->pc = c->ci->pc; |
Member
There was a problem hiding this comment.
This line (saving the current execution point to cibase->pc) is an essential part of #5261 fix. Is it really OK to remove this line?
Contributor
Author
There was a problem hiding this comment.
Yes, it needs to be removed.
By this PR, in the case of child fiber, its cibase->pc already points to the address on cibase->proc->body.irep->iseq.
dearblue
added a commit
to dearblue/mruby
that referenced
this pull request
Jan 16, 2021
When I `#call` the "proc" object created by the `mrb_proc_new_cfunc()` function from Ruby space, the return value did not go into the correct stack position. This can destroy the calling variable. This issue is now caused by mruby#5272. sorry.
matz
added a commit
that referenced
this pull request
Jan 16, 2021
Fixed stack position of return value; ref #5272
Contributor
|
It seems that /mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c:529:23: error: no member named 'target_class' in 'mrb_callinfo'
c = mrb->c->ci->target_class->super;
~~~~~~~~~~ ^
1 error generated. |
Contributor
Author
|
Thank you for your report. I will fix it. |
dearblue
added a commit
to dearblue/mruby
that referenced
this pull request
Jan 17, 2021
This is a missing change in mruby#5272. This issue was reported by @shuujii. mruby#5272 (comment)
dearblue
added a commit
to dearblue/mruby
that referenced
this pull request
Jan 31, 2021
matz
added a commit
that referenced
this pull request
Feb 1, 2021
Remove unnecessary `ci0` variables; ref #5272
matz
added a commit
that referenced
this pull request
Sep 4, 2021
Otherwise `target_class` can be lost when it differs from `proc`'s `target_class`, e.g. when called from `instance_eval`. Also we should not pass `target_class` to `MRB_OBJ_ALLOC` since it checks instance type from the class, and `target_class` may not have proper information. ref #5272
dearblue
added a commit
to dearblue/mruby
that referenced
this pull request
Jun 25, 2022
If `ci->u.target_class` was `NULL`, the value of the argument was always ignored. This problem is caused by mruby#5272. ref. mruby#5725
dearblue
added a commit
to dearblue/mruby
that referenced
this pull request
Jul 30, 2022
GC may occur in the `c->stbase = mrb_malloc()` part of the `fiber_init()` function. The `SIGSEGV` happens because it references the `c->ci->stack` field without checking `c->ci`. This is caused by mruby#5272.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
mrb_callinfo::stackwill now indicate the current call level.Previously,
stackentsaved the previous stack.mrb_callinfo::pcwill now indicate the current call level.Previously, this saved the previous one.
This change reverts commit a0c1e07.
mrb_callinfo::argcandmrb_callinfo::accare represented byint16_t.mrb_callinfo::envandmrb_callinfo::target_classwith union.