Skip to content

Commit

Permalink
* vm_core.h, vm_insnhelper.c (vm_call_method): revive
Browse files Browse the repository at this point in the history
  VM_CALL_OPT_SEND_BIT and use it to recognize "send" method.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ko1 committed Jul 28, 2009
1 parent 8c0e622 commit 07de51f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Wed Jul 29 03:34:46 2009 Koichi Sasada <ko1@atdot.net>

* vm_core.h, vm_insnhelper.c (vm_call_method): revive
VM_CALL_OPT_SEND_BIT and use it to recognize "send" method.

Wed Jul 29 03:11:59 2009 Koichi Sasada <ko1@atdot.net>

* proc.c (rb_method_entry_arity): support not_implemented method.
Expand Down
1 change: 1 addition & 0 deletions vm_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ typedef struct {
#define VM_CALL_TAILCALL_BIT (0x01 << 5)
#define VM_CALL_TAILRECURSION_BIT (0x01 << 6)
#define VM_CALL_SUPER_BIT (0x01 << 7)
#define VM_CALL_OPT_SEND_BIT (0x01 << 8)

#define VM_SPECIAL_OBJECT_VMCORE 0x01
#define VM_SPECIAL_OBJECT_CBASE 0x02
Expand Down
6 changes: 2 additions & 4 deletions vm_insnhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp,
ID id, const rb_method_entry_t *me, VALUE recv)
{
VALUE val;
int opt_send = 0;

start_method_dispatch:

Expand Down Expand Up @@ -567,8 +566,7 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp,
me = rb_method_entry(CLASS_OF(recv), id);
num -= 1;
DEC_SP(1);
flag |= VM_CALL_FCALL_BIT;
opt_send = 1;
flag |= VM_CALL_FCALL_BIT | VM_CALL_OPT_SEND_BIT;

goto start_method_dispatch;
}
Expand Down Expand Up @@ -607,7 +605,7 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp,
}
val = vm_method_missing(th, id, recv, num, blockptr, stat);
}
else if (!opt_send && (me->flag & NOEX_MASK) & NOEX_PROTECTED) {
else if (!(flag & VM_CALL_OPT_SEND_BIT) && (me->flag & NOEX_MASK) & NOEX_PROTECTED) {
VALUE defined_class = me->klass;

if (TYPE(defined_class) == T_ICLASS) {
Expand Down

0 comments on commit 07de51f

Please sign in to comment.