hphp/runtime/vm/jit/irgen-func-prologue.cpp
/*
 * Copy the closure's use variables from the closure object's properties onto
 * the stack.
 */
Copy the closure's use variables from the closure object's properties onto
the stack.
Copy the closure ' s use variables from the closure object ' s properties onto the stack .
void init_use_vars(IRGS& env, const Func* func, SSATmp* closure) {
  auto const cls = func->implCls();
  auto const nparams = func->numParams();
  assertx(func->isClosureBody());
  auto const nuse = cls->numDeclProperties();
  for (auto i = 0; i < nuse; ++i) {
    auto const ty =
      typeFromRAT(cls->declPropRepoAuthType(i), func->cls()) & TCell;
    auto const addr = gen(
      env,
      LdPropAddr,
      IndexData { cls->propSlotToIndex(i) },
      ty.lval(Ptr::Prop),
      closure
    );
    auto const prop = gen(env, LdMem, ty, addr);
    gen(env, StLoc, LocalId{nparams + i}, fp(env), prop);
    gen(env, IncRef, prop);
  }
}
void init_use_vars ( IRGS & env , const Func * func , SSATmp * closure ) { auto const cls = func -> implCls ( ) ; auto const nparams = func -> numParams ( ) ; assertx ( func -> isClosureBody ( ) ) ; auto const nuse = cls -> numDeclProperties ( ) ; for ( auto i = 0 ; i < nuse ; ++ i ) { auto const ty = typeFromRAT ( cls -> declPropRepoAuthType ( i ) , func -> cls ( ) ) & TCell ; auto const addr = gen ( env , LdPropAddr , IndexData { cls -> propSlotToIndex ( i ) } , ty . lval ( Ptr :: Prop ) , closure ) ; auto const prop = gen ( env , LdMem , ty , addr ) ; gen ( env , StLoc , LocalId { nparams + i } , fp ( env ) , prop ) ; gen ( env , IncRef , prop ) ; } }
Copy the closure's use variables from the closure object's properties onto
 the stack.
Copy the closure ' s use variables from the closure object ' s properties onto the stack .
// Closure object properties are the use vars.