diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-28 11:02:30 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-28 11:02:30 +0000 |
commit | 9f60791a0412cae804f13ed3e746a634c7a0731b (patch) | |
tree | 49b3f9ff4924a622e13fbdfc9478d34717d19378 /vm_insnhelper.h | |
parent | 683eafd973e4db60756f6ee12e1b066e316f026f (diff) |
* vm_core.h: revisit the structure of frame, block and env.
[Bug #12628]
This patch introduce many changes.
* Introduce concept of "Block Handler (BH)" to represent
passed blocks.
* move rb_control_frame_t::flag to ep[0] (as a special local
variable). This flags represents not only frame type, but also
env flags such as escaped.
* rename `rb_block_t` to `struct rb_block`.
* Make Proc, Binding and RubyVM::Env objects wb-protected.
Check [Bug #12628] for more details.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r-- | vm_insnhelper.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h index 69eaaacf2e..18fabde187 100644 --- a/vm_insnhelper.h +++ b/vm_insnhelper.h @@ -104,7 +104,7 @@ enum vm_regan_acttype { /* deal with variables */ /**********************************************************/ -#define GET_PREV_EP(ep) ((VALUE *)((ep)[0] & ~0x03)) +#define GET_PREV_EP(ep) ((VALUE *)((ep)[VM_ENV_DATA_INDEX_SPECVAL] & ~0x03)) #define GET_GLOBAL(entry) rb_gvar_get((struct rb_global_entry*)(entry)) #define SET_GLOBAL(entry, val) rb_gvar_set((struct rb_global_entry*)(entry), (val)) @@ -148,7 +148,7 @@ enum vm_regan_acttype { #define CI_SET_FASTPATH(ci, func, enabled) /* do nothing */ #endif -#define GET_BLOCK_PTR() ((rb_block_t *)(GC_GUARDED_PTR_REF(GET_LEP()[0]))) +#define GET_BLOCK_HANDLER() (GET_LEP()[VM_ENV_DATA_INDEX_SPECVAL]) /**********************************************************/ /* deal with control flow 3: exception */ @@ -173,7 +173,7 @@ enum vm_regan_acttype { #define CALL_SIMPLE_METHOD(recv_) do { \ struct rb_calling_info calling; \ - calling.blockptr = NULL; \ + calling.block_handler = VM_BLOCK_HANDLER_NONE; \ calling.argc = ci->orig_argc; \ vm_search_method(ci, cc, calling.recv = (recv_)); \ CALL_METHOD(&calling, ci, cc); \ @@ -189,7 +189,7 @@ static VALUE make_no_method_exception(VALUE exc, VALUE format, VALUE obj, int argc, const VALUE *argv, int priv); static inline struct vm_throw_data * -THROW_DATA_NEW(VALUE val, rb_control_frame_t *cf, VALUE st) +THROW_DATA_NEW(VALUE val, const rb_control_frame_t *cf, VALUE st) { return (struct vm_throw_data *)rb_imemo_new(imemo_throw_data, val, (VALUE)cf, st, 0); } |