summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-24 11:02:40 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-24 11:02:40 +0000
commit904b9e5d547f4f9a9f3236d2633f0cb6d7aae14c (patch)
tree8ea39d937eb9160f1a3ca8b750bf009e203a7a1d /insns.def
parent59202b7ab8147f3947900a919fcf82bc5f3e74e7 (diff)
* vm_macro.def: removed.
* insn_send.ci: added. this file includes send instruction body. * common.mk: ditto. * insns.def: ditto. * tool/insns2vm.rb: ditto. * vm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def130
1 files changed, 1 insertions, 129 deletions
diff --git a/insns.def b/insns.def
index 27b52b01f4..4b16695877 100644
--- a/insns.def
+++ b/insns.def
@@ -1152,135 +1152,7 @@ send
(...)
(VALUE val) // inc += - (op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));
{
- NODE *mn;
- VALUE recv;
- VALUE klass;
- rb_block_t *blockptr = 0;
- rb_num_t num;
- rb_num_t flag = op_flag;
- ID id = op_id;
-
- num = caller_setup_args(th, GET_CFP(), flag, op_argc, blockiseq, &blockptr);
-
- if (flag & VM_CALL_FCALL_BIT) {
- /* method(...) */
- recv = GET_SELF();
- }
- else {
- /* recv.method(...) */
- recv = TOPN(num);
- }
-
- klass = CLASS_OF(recv);
-
- mn = eval_method_search(id, klass, ic);
-
- if ((flag & VM_CALL_SEND_BIT) && mn && nd_type(mn->nd_body) == NODE_CFUNC) {
- NODE *node = mn->nd_body;
- extern VALUE rb_f_funcall(int argc, VALUE *argv, VALUE recv);
- extern VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
-
- if (node->nd_cfnc == rb_f_funcall || node->nd_cfnc == rb_f_send) {
- int i;
- VALUE sym = TOPN(num - 1);
- id = SYMBOL_P(sym) ? SYM2ID(sym) : rb_to_id(sym);
-
- /* shift arguments */
- for (i=num-1; i>0; i--) {
- TOPN(i) = TOPN(i-1);
- }
-
- mn = rb_method_node(klass, id);
-
- num -= 1;
- DEC_SP(1);
- }
-
- if (node->nd_cfnc == rb_f_funcall) {
- flag |= VM_CALL_FCALL_BIT;
- }
- }
-
-#if CURRENT_INSN_send || CURRENT_INSN_send_SC_xx_ax
-#if !YARV_AOT_COMPILED
- if (0) {
- if (0) {
- LABEL_IS_SC(start_init_in_send_for_opt_1):
- num = 1;
- recv = TOPN(1);
- }
- else if (0) {
- LABEL_IS_SC(start_init_in_send_for_opt_2):
- num = 2;
- recv = TOPN(2);
- }
- flag = 0;
- id = tmp_id;
- klass = CLASS_OF(recv);
- blockptr = 0;
- mn = rb_method_node(klass, id);
- }
- if (0) {
- LABEL_IS_SC(start_init_in_super):
- {
- rb_iseq_t *iseq = GET_ISEQ();
- rb_iseq_t *ip = iseq;
-
- num = tmp_num;
- flag = VM_CALL_FCALL_BIT;
- recv = GET_SELF();
-
- while (ip && !ip->klass) {
- ip = ip->parent_iseq;
- }
-
- if (ip == 0) {
- rb_raise(rb_eNoMethodError, "super called outside of method");
- }
-
- id = ip->defined_method_id;
-
- if (ip != ip->local_iseq) {
- /* defined by Module#define_method() */
- rb_control_frame_t *lcfp = GET_CFP();
-
- while (lcfp->iseq != ip) {
- VALUE *tdfp = GET_PREV_DFP(lcfp->dfp);
- while (1) {
- lcfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(lcfp);
- if (lcfp->dfp == tdfp) {
- break;
- }
- }
- }
-
- id = lcfp->method_id;
- klass = search_super_klass(lcfp->method_klass, recv);
-
- if (TOPN(num) == Qfalse) {
- /* for ZSUPER */
- int i;
- POPN(num);
- num = ip->argc;
- for (i = 0; i < ip->argc; i++) {
- PUSH(lcfp->dfp[i - ip->local_size]);
- }
- }
- }
- else {
- klass = search_super_klass(ip->klass, recv);
- }
-
- flag = VM_CALL_SUPER_BIT | VM_CALL_FCALL_BIT;
- blockptr = tmp_blockptr;
- mn = rb_method_node(klass, id);
- }
- }
- LABEL_IS_SC(start_method_dispatch):
-#endif
-#endif
- macro_eval_invoke_method(recv, klass, id, num, mn, blockptr);
- RUBY_VM_CHECK_INTS();
+#include "insn_send.ci"
}
/**