Ejemplo n.º 1
0
TypedValue * fg1_stream_socket_client(TypedValue* rv, HPHP::VM::ActRec* ar, long long count) {
    TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
    switch (count) {
    default: // count >= 6
        if ((args-5)->m_type != KindOfObject) {
            tvCastToObjectInPlace(args-5);
        }
    case 5:
        if ((args-4)->m_type != KindOfInt64) {
            tvCastToInt64InPlace(args-4);
        }
    case 4:
        if ((args-3)->m_type != KindOfDouble) {
            tvCastToDoubleInPlace(args-3);
        }
    case 3:
    case 2:
    case 1:
        break;
    }
    if (!IS_STRING_TYPE((args-0)->m_type)) {
        tvCastToStringInPlace(args-0);
    }
    VRefParamValue defVal1 = null;
    VRefParamValue defVal2 = null;
    fh_stream_socket_client((rv), (Value*)(args-0), (count > 1) ? (args-1) : (TypedValue*)(&defVal1), (count > 2) ? (args-2) : (TypedValue*)(&defVal2), (count > 3) ? (args[-3].m_data.dbl) : (double)(0.0), (count > 4) ? (int)(args[-4].m_data.num) : (int)(0), (count > 5) ? (Value*)(args-5) : (Value*)(&null_object));
    if (rv->m_type == KindOfUninit) rv->m_type = KindOfNull;
    return rv;
}
Ejemplo n.º 2
0
TypedValue * fg1_time_sleep_until(TypedValue* rv, HPHP::VM::ActRec* ar, int64_t count) {
  TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
  rv->m_type = KindOfBoolean;
  tvCastToDoubleInPlace(args-0);
  rv->m_data.num = (fh_time_sleep_until((args[-0].m_data.dbl))) ? 1LL : 0LL;
  return rv;
}
Ejemplo n.º 3
0
bool tvCoerceParamToDoubleInPlace(TypedValue* tv) {
  tvUnboxIfNeeded(tv);
  if (!tvCanBeCoercedToNumber(tv)) {
    return false;
  }
  tvCastToDoubleInPlace(tv);
  return true;
}
Ejemplo n.º 4
0
int64_t convCellToDblHelper(TypedValue tv) {
  try {
    tvCastToDoubleInPlace(&tv); // consumes a ref on counted values
                                // but not if an exception happens. (REVIEW)
    return tv.m_data.num;
  } catch (...) {
    // spill tv back to stack. unwinder
    // will take care of decreffing it.
    VMRegAnchor _;
    TypedValue* spillSlot = (TypedValue *)vmsp();
    spillSlot->m_data.num = tv.m_data.num;
    spillSlot->m_type = tv.m_type;
    throw;
  }
}
Ejemplo n.º 5
0
TypedValue * fg1_curl_multi_select(TypedValue* rv, HPHP::VM::ActRec* ar, int64_t count) {
  TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
  switch (count) {
  default: // count >= 2
    if ((args-1)->m_type != KindOfDouble) {
      tvCastToDoubleInPlace(args-1);
    }
  case 1:
    break;
  }
  if ((args-0)->m_type != KindOfObject) {
    tvCastToObjectInPlace(args-0);
  }
  fh_curl_multi_select((rv), &args[-0].m_data, (count > 1) ? (args[-1].m_data.dbl) : (double)(1.0));
  if (rv->m_type == KindOfUninit) rv->m_type = KindOfNull;
  return rv;
}
Ejemplo n.º 6
0
TypedValue * fg1_stream_socket_accept(TypedValue* rv, HPHP::VM::ActRec* ar, long long count) {
    TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
    switch (count) {
    default: // count >= 3
    case 2:
        if ((args-1)->m_type != KindOfDouble) {
            tvCastToDoubleInPlace(args-1);
        }
    case 1:
        break;
    }
    if ((args-0)->m_type != KindOfObject) {
        tvCastToObjectInPlace(args-0);
    }
    VRefParamValue defVal2 = null;
    fh_stream_socket_accept((rv), (Value*)(args-0), (count > 1) ? (args[-1].m_data.dbl) : (double)(0.0), (count > 2) ? (args-2) : (TypedValue*)(&defVal2));
    if (rv->m_type == KindOfUninit) rv->m_type = KindOfNull;
    return rv;
}
Ejemplo n.º 7
0
void fg1_time_sleep_until(TypedValue* rv, ActRec* ar, int32_t count) {
  TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
  tvCastToDoubleInPlace(args-0);
  rv->m_type = KindOfBoolean;
  rv->m_data.num = (fh_time_sleep_until((args[-0].m_data.dbl))) ? 1LL : 0LL;
}