예제 #1
0
inline void c_Continuation::nextImpl(FI& fi) {
  const_assert(!hhvm);
  ASSERT(m_running);
  try {
    if (m_isMethod) {
      MethodCallPackage mcp;
      mcp.isObj = m_obj.get();
      if (mcp.isObj) {
        mcp.obj = mcp.rootObj = m_obj.get();
      } else {
        mcp.rootCls = getCalledClass().get();
      }
      fi.setStaticClassName(getCalledClass());
      (m_callInfo->getMeth1Args())(mcp, 1, this);
    } else {
      (m_callInfo->getFunc1Args())(NULL, 1, this);
    }
  } catch (Object e) {
    if (e.instanceof("exception")) {
      m_running = false;
      m_done = true;
      m_value.setNull();
      throw_exception(e);
    } else {
      throw;
    }
  }
  m_running = false;
}
예제 #2
0
inline void c_Continuation::nextImpl(FI& fi) {
  const_assert(!hhvm);
  preNext();
  try {
    if (m_isMethod) {
      MethodCallPackage mcp;
      mcp.isObj = hhvm || m_obj.get();
      if (mcp.isObj) {
        mcp.obj = mcp.rootObj = m_obj.get();
      } else {
        mcp.rootCls = m_called_class.get();
      }
      mcp.extra = m_extra;
      if (!hhvm) {
        fi.setStaticClassName(m_called_class);
      }
      (m_callInfo->getMeth1Args())(mcp, 1, this);
    } else {
      if (hhvm) {
        MethodCallPackage mcp;
        mcp.isObj = false;
        mcp.obj = mcp.rootObj = NULL;
        mcp.extra = m_extra;
        (m_callInfo->getMeth1Args())(mcp, 1, this);
      } else {
        (m_callInfo->getFunc1Args())(m_extra, 1, this);
      }
    }
  } catch (Object e) {
    if (e.instanceof("exception")) {
      m_running = false;
      m_done = true;
      throw_exception(e);
    } else {
      throw;
    }
  }
  m_running = false;
}