Example #1
0
            protected void GenExecTimerStart(bool generateFinally)
            {
                ///Only call and new pass true here. However, in some cases, there are stuff on the .NET stack
                ///and creating an exception block will not be possible.
                ///for now we just disable the feature. If it is a major problem, for call/new when profiling is enabled
                ///we can use something like Operations.Internal.New/Call(timer, ref callFrame) to safely stop/start the timer
                generateFinally = false;

                if (JSRuntime.Instance.Configuration.ProfileExecuteTime)
                {
                    if (generateFinally)
                    {
                        //In this case assumption is that Stop was wrapped in a try, we need to make sure start happens no matter what
                        _ilGen.BeginFinallyBlock();
                        GenTimerStart(_execTimerVar);
                        _ilGen.EndExceptionBlock();
                    }
                    else
                    {
                        GenTimerStart(_execTimerVar);
                    }
                }
                //GenReadTicks(_execTimerTicks);
            }