protected override void EndCompile() { base.EndCompile(); while (this.cctorQueue.Count > 0) { CCtor cctor = this.cctorQueue.Dequeue(); cctor(); } }
/// <summary> /// Called after the method compiler has finished compiling the method. /// </summary> protected override void EndCompile() { // If we're compiling a type initializer, run it immediately. MethodAttributes attrs = MethodAttributes.SpecialName | MethodAttributes.RTSpecialName | MethodAttributes.Static; if ((this.Method.Attributes & attrs) == attrs && Method.Name == ".cctor") { CCtor cctor = (CCtor)Marshal.GetDelegateForFunctionPointer(address, typeof(CCtor)); assemblyCompiler.QueueCCtorForInvocationAfterCompilation(cctor); } base.EndCompile(); }
/// <summary> /// Called after the method compiler has finished compiling the method. /// </summary> protected override void EndCompile() { // If we're compiling a type initializer, run it immediately. MethodAttributes attrs = MethodAttributes.SpecialName | MethodAttributes.RTSpecialName | MethodAttributes.Static; if ((this.Method.Attributes & attrs) == attrs && this.Method.Name == ".cctor") { CCtor cctor = (CCtor)Marshal.GetDelegateForFunctionPointer(this.Method.Address, typeof(CCtor)); cctor(); } base.EndCompile(); //InstructionStatisticsStage.Instance.PrintStatistics(); }
/// <summary> /// Queues the C ctor for invocation after compilation. /// </summary> /// <param name="cctor">The cctor.</param> public void QueueCCtorForInvocationAfterCompilation(CCtor cctor) { cctorQueue.Enqueue(cctor); }
public void QueueCCtorForInvocationAfterCompilation(CCtor cctor) { //cctorQueue.Enqueue(cctor); }