Пример #1
0
 Object* CompiledMethod::default_executor(STATE, CallFrame* call_frame, Dispatch& msg,
                                          Arguments& args) {
   CompiledMethod* cm = as<CompiledMethod>(msg.method);
   cm->formalize(state, false);
   // Refactor
   cm->backend_method_->find_super_instructions();
   return cm->execute(state, call_frame, msg, args);
 }
Пример #2
0
  Object* CompiledMethod::default_executor(STATE, CallFrame* call_frame, Dispatch& msg,
                                           Arguments& args) {
    CompiledMethod* cm = as<CompiledMethod>(msg.method);
    const char* reason = 0;
    int ip = -1;

    if(!cm->internalize(state, &reason, &ip)) {
      Exception::bytecode_error(state, call_frame, cm, ip, reason);
      return 0;
    }

    // Refactor
    cm->backend_method_->find_super_instructions();
    return cm->execute(state, call_frame, msg, args);
  }
Пример #3
0
  ExecuteStatus CompiledMethod::activate(STATE, Executable* exec, Task* task, Message& msg) {
    CompiledMethod* meth = as<CompiledMethod>(msg.recv);
    Object* recv = msg.get_argument(0);
    Module* mod  = as<Module>(msg.get_argument(1));
    Array*  args = as<Array>(msg.get_argument(2));
    // Leave msg.block set and pass it through.

    msg.recv = recv;
    msg.method = meth;
    msg.module = mod;
    msg.set_arguments(state, args);
    msg.name = meth->name();
    msg.priv = true;
    msg.method_missing = false;

    // NOTE even when we're activating a method_missing, we don't
    // push the name given, because there really isn't one. So if
    // this is used to call a method_missing, you have to supply all
    // the args.
    return meth->execute(state, task, msg);
  }
Пример #4
0
  Object* CompiledMethod::default_executor(STATE, CallFrame* call_frame,
                          Executable* exec, Module* mod, Arguments& args)
  {
    LockableScopedLock lg(state, &state->shared, __FILE__, __LINE__);

    CompiledMethod* cm = as<CompiledMethod>(exec);
    if(cm->execute == default_executor) {
      const char* reason = 0;
      int ip = -1;

      OnStack<4> os(state, cm, exec, mod, args.argument_container_location());
      GCTokenImpl gct;

      if(!cm->internalize(state, gct, &reason, &ip)) {
        Exception::bytecode_error(state, call_frame, cm, ip, reason);
        return 0;
      }
    }

    lg.unlock();

    return cm->execute(state, call_frame, exec, mod, args);
  }
Пример #5
0
 ExecuteStatus CompiledMethod::default_executor(STATE, Task* task, Message& msg) {
   CompiledMethod* cm = as<CompiledMethod>(msg.method);
   cm->formalize(state, false);
   return cm->execute(state, task, msg);
 }