private ICInfo TryGetIC(GameObject g) { ICInfo i = null; icPools.TryGetValue(g, out i); return(i); }
public bool ResetIC(GameObject g) { if (icPools.ContainsKey(g)) { ICInfo info = TryGetIC(g); g.transform.position = info.pos; g.transform.eulerAngles = info.rote; return(true); } return(false); }
public bool BackupIC(GameObject g) { ICInfo info = TryGetIC(g); if (info == null) { info = new ICInfo(); icPools.Add(g, info); } info.obj = g; info.pos = g.transform.position; info.rote = g.transform.eulerAngles; return(true); }
void AddICMethod(mdr.DFunctionMetadata.InlineCachedMethod method, int index = -1) { if (index == -1) index = ReserveNewICIndex(); var icInfo = new ICInfo(); icInfo.ICMethod = method; _ics[index] = icInfo; }
void EndICMethod(int index = -1, int nextIndex = -1) { Trace.Assert(_ilGen != null, "No IC method is open!"); if (index == -1) index = ReserveNewICIndex(); if (nextIndex == -1) nextIndex = index + 1; Br(nextIndex); _ilGen.WriteComment("Installing this at index {0}", index); var icInfo = new ICInfo(); icInfo.IlGen = _ilGen; if (JSRuntime.Instance.Configuration.EnableParallelJit) { var runtime = JSRuntime.Instance; icInfo.JitTask = System.Threading.Tasks.Task.Factory.StartNew(() => { mdr.Runtime.Instance = JSRuntime.Instance = runtime; icInfo.ICMethod = icInfo.IlGen.EndICMethod(_currFuncMetadata); //icInfo.IlGen = null; }); } else icInfo.ICMethod = icInfo.IlGen.EndICMethod(_currFuncMetadata); _ics[index] = icInfo; _ilGen = null; }