示例#1
0
    /*
     * A simple monomorphic cache resolver. Does not support
     * method missing, so it must not be installed if method missing
     * was used.
     */
    ExecuteStatus mono_performer(STATE, Task* task, Message& msg) {
      if(likely(msg.lookup_from == msg.send_site->recv_class())) {
        msg.module = msg.send_site->module();
        msg.method = msg.send_site->method();

        msg.send_site->hits++;
      } else {
        msg.send_site->misses++;
        return basic_performer(state, task, msg);
      }

      return msg.method->execute(state, task, msg);
    }
示例#2
0
    /*
     * A simple monomorphic cache resolver. Does not support
     * method missing, so it must not be installed if method missing
     * was used.
     */
    Object* mono_performer(STATE, SendSite* ss, CallFrame* call_frame,
                           Dispatch& msg, Arguments& args) {
      if(likely(args.recv()->lookup_begin(state) == ss->recv_class())) {
        msg.module = ss->module();
        msg.method = ss->method();

        ss->hits++;
      } else {
        ss->misses++;
        return basic_performer(state, ss, call_frame, msg, args);
      }

      return msg.method->execute(state, call_frame, msg, args);
    }