From b25d4862708a5a0b16d8e9b63ccec5db33ead2a7 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 31 Mar 2019 12:15:50 +0900 Subject: [PATCH] 0.4.41 released and updated readmes. --- README.md | 15 +- docs/{inside.md => inside-il2c.md} | 9 + docs/supported-features.md | 4 +- pack.bat | 2 +- pack.sh | 2 +- .../MT3620Blink/MT3620Blink.csproj | 2 +- .../src/MT3620Blink/MT3620Blink/Application.c | 318 +++++++----- .../src/MT3620Blink/MT3620Blink/Descriptor.c | 108 ++-- .../src/MT3620Blink/MT3620Blink/Event.c | 37 +- .../src/MT3620Blink/MT3620Blink/GpioInput.c | 24 +- .../src/MT3620Blink/MT3620Blink/GpioOutput.c | 4 +- .../src/MT3620Blink/MT3620Blink/Program.c | 462 +++++++++++------- .../src/MT3620Blink/MT3620Blink/Timer.c | 101 ++-- 13 files changed, 661 insertions(+), 427 deletions(-) rename docs/{inside.md => inside-il2c.md} (98%) diff --git a/README.md b/README.md index addff9b7..117cccfa 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,14 @@ |AppVeyor|master|[![AppVeyor (.NET 4.5 / .NET Core 2.0)](https://ci.appveyor.com/api/projects/status/bwqk4p8x05vckl0x/branch/master?svg=true)](https://ci.appveyor.com/project/kekyo/il2c/branch/master) [![AppVeyor tests](https://img.shields.io/appveyor/tests/kekyo/il2c/master.svg)](https://ci.appveyor.com/project/kekyo/il2c/branch/master/tests)
![Build Stats](https://buildstats.info/appveyor/chart/kekyo/il2c?branch=master&includeBuildsFromPullRequest=false)| |AppVeyor|devel|[![AppVeyor (.NET 4.5 / .NET Core 2.0)](https://ci.appveyor.com/api/projects/status/bwqk4p8x05vckl0x/branch/devel?svg=true)](https://ci.appveyor.com/project/kekyo/il2c/branch/devel) [![AppVeyor tests](https://img.shields.io/appveyor/tests/kekyo/il2c/devel.svg)](https://ci.appveyor.com/project/kekyo/il2c/branch/devel/tests)
![Build Stats](https://buildstats.info/appveyor/chart/kekyo/il2c?branch=devel&includeBuildsFromPullRequest=false)| -| NuGet | Current | +| Building package | Current | +|:---|:---| +| IL2C.Build | [![NuGet IL2C.Build](https://img.shields.io/nuget/v/IL2C.Build.svg?style=flat)](https://www.nuget.org/packages/IL2C.Build) + +| Library packages | Current | |:---|:---| | IL2C.Interop | [![NuGet IL2C.Interop](https://img.shields.io/nuget/v/IL2C.Interop.svg?style=flat)](https://www.nuget.org/packages/IL2C.Interop) | IL2C.Core | [![NuGet IL2C.Core](https://img.shields.io/nuget/v/IL2C.Core.svg?style=flat)](https://www.nuget.org/packages/IL2C.Core) -| IL2C.Build | [![NuGet IL2C.Build](https://img.shields.io/nuget/v/IL2C.Build.svg?style=flat)](https://www.nuget.org/packages/IL2C.Build) ## What's this? @@ -21,9 +24,9 @@ * **Better predictability of runtime costs** Better human readability of C source code translated by IL2C. * **Very tiny footprint requirements** - We are thinking about how to fit from large system with many resources to tiny embedded system. + We're thinking about how to fit from large system with many resources to tiny embedded system. (KB order for the non-OSes system) * **Better code/runtime portability** - Minimum requirement is only C99 compiler. + Minimum requirement is only C99 compiler. The runtime minimum requires only the heap, CAS instructions, (POSIX) signal and setjmp/longjmp. Additional better feature is threading API (Win32, pthreads and FreeRTOS.) * **Better interoperabilities for existed C libraries** You can use the standard .NET interop technics (like P/Invoke.) * **Containing seamless building systems for major C toolkits** @@ -74,9 +77,9 @@ IL2C current status is **experimental**, read a simple ["Getting started"](docs/ And also you can read a blog post using case for the Azure Sphere: ["Try writing code using both the Azure Sphere Development Kit and C#" (My blog)](https://www.kekyo.net/2019/01/04/6917). -### IL2C's core +### Inside IL2C -See ["Inside IL2C"](docs/inside.md) . +If you need understanding deep knowledge for IL2C, see ["Inside IL2C"](docs/inside-il2c.md) . ## Overall status diff --git a/docs/inside.md b/docs/inside-il2c.md similarity index 98% rename from docs/inside.md rename to docs/inside-il2c.md index 46a25a00..1d9c8ad1 100644 --- a/docs/inside.md +++ b/docs/inside-il2c.md @@ -290,6 +290,7 @@ Toughly you can understand meaning these fields, I'll tell you important fields: | IL2C_TYPE_VALUE | A value type. | | IL2C_TYPE_INTEGER | A integer (numeric but not floating point) type. The boxing operator uses on bothe narrowing and widing storage size. | | IL2C_TYPE_VARIABLE | A variable type, only using with array, string and delegate types. | + | IL2C_TYPE_MARK_HANDLER | The GC traverser using custom mark handler for this type. | | IL2C_TYPE_UNSIGNED_INTEGER | A unsigned integer (numeric but not floating point) type. The boxing operator uses on bothe narrowing and widing storage size. | | IL2C_TYPE_STATIC | A static type (sealed abstract). It doesn't have the VTables. | | IL2C_TYPE_INTERFACE | A interface type. [It has lesser fields than another types](https://github.com/kekyo/IL2C/blob/03fe578a5e1aa959a3463a2b6f13491ee0fd042a/IL2C.Runtime/src/il2c_private.h#L67). | @@ -410,10 +411,18 @@ Helper function: [il2c_get_uninitialized_object__(IL2C_RUNTIME_TYPE type)](https ### Static instance walking +### Custom mark handler + ### Except constants ## Exception handling +## Threading + +### Monitor locking + +### Arbitrary thread handling + ## Interoperabilities ### P/Invoke diff --git a/docs/supported-features.md b/docs/supported-features.md index c1bc28b1..8cd1e1b1 100644 --- a/docs/supported-features.md +++ b/docs/supported-features.md @@ -65,7 +65,9 @@ | Heap compaction (GC) | | Exception throw and handles | Partial supported | | Async exception throws | Partial supported | -| Monitor lock features | +| Monitor lock features | Supported | +| Threading features | Supported | +| Synchronization features | | Interop (P/Invoke) | Partial supported | | Interop (IL2C/Invoke) | Partial supported | | Can handle unsafe pointers | diff --git a/pack.bat b/pack.bat index c7a87412..6626bfbf 100644 --- a/pack.bat +++ b/pack.bat @@ -1,7 +1,7 @@ @echo off setlocal enabledelayedexpansion -set VERSION=0.4.35 +set VERSION=0.4.41 if exist artifacts ( ren artifacts artifacts_ diff --git a/pack.sh b/pack.sh index c8c6abf6..6cbf8b10 100644 --- a/pack.sh +++ b/pack.sh @@ -1,6 +1,6 @@ #!/bin/sh -VERSION=0.4.35 +VERSION=0.4.41 rm -rf artifacts mkdir artifacts diff --git a/samples/AzureSphere/MT3620Blink/MT3620Blink.csproj b/samples/AzureSphere/MT3620Blink/MT3620Blink.csproj index 4a404645..83cd17e4 100644 --- a/samples/AzureSphere/MT3620Blink/MT3620Blink.csproj +++ b/samples/AzureSphere/MT3620Blink/MT3620Blink.csproj @@ -30,6 +30,6 @@ - + diff --git a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Application.c b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Application.c index e0f70e34..4ccd3646 100644 --- a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Application.c +++ b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Application.c @@ -65,24 +65,27 @@ void MT3620Blink_Application__ctor(MT3620Blink_Application* this__) stack1_0__ = MT3620Blink_Interops_epoll_create1(stack1_0__); /* IL_0007: call MT3620Blink.Descriptor..ctor : Application.cs(28) */ MT3620Blink_Descriptor__ctor((MT3620Blink_Descriptor*)frame__.stack0_0__, stack1_0__); - /* IL_000c: ldarg.0 : Application.cs(30) */ + /* IL_000c: nop : Application.cs(28) */ + /* IL_000d: nop */ + /* IL_000e: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_000d: ldarg.0 : Application.cs(30) */ + /* IL_000f: ldarg.0 : Application.cs(30) */ frame__.stack1_1__ = this__; - /* IL_000e: newobj MT3620Blink.Application.AbortEvent..ctor : Application.cs(30) */ + /* IL_0010: newobj MT3620Blink.Application.AbortEvent..ctor : Application.cs(30) */ frame__.stack1_2__ = il2c_get_uninitialized_object(MT3620Blink_Application_AbortEvent); MT3620Blink_Application_AbortEvent__ctor(frame__.stack1_2__, frame__.stack1_1__); - /* IL_0013: stfld MT3620Blink.Application.abort : Application.cs(30) */ + /* IL_0015: stfld MT3620Blink.Application.abort : Application.cs(30) */ frame__.stack0_0__->abort = frame__.stack1_2__; - /* IL_0018: ldarg.0 : Application.cs(31) */ + /* IL_001a: ldarg.0 : Application.cs(31) */ frame__.stack0_0__ = this__; - /* IL_0019: ldarg.0 : Application.cs(31) */ + /* IL_001b: ldarg.0 : Application.cs(31) */ frame__.stack1_1__ = this__; - /* IL_001a: ldfld MT3620Blink.Application.abort : Application.cs(31) */ + /* IL_001c: ldfld MT3620Blink.Application.abort : Application.cs(31) */ frame__.stack1_2__ = frame__.stack1_1__->abort; - /* IL_001f: call MT3620Blink.Application.RegisterDescriptor : Application.cs(31) */ + /* IL_0021: call MT3620Blink.Application.RegisterDescriptor : Application.cs(31) */ MT3620Blink_Application_RegisterDescriptor(frame__.stack0_0__, il2c_cast_to_interface(MT3620Blink_IEPollListener, MT3620Blink_Application_AbortEvent, frame__.stack1_2__)); - /* IL_0024: ret : Application.cs(32) */ + /* IL_0026: nop : Application.cs(31) */ + /* IL_0027: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -110,9 +113,16 @@ void MT3620Blink_Application_Dispose(MT3620Blink_Application* this__) { il2c_assert(this__ != NULL); + //------------------- + // [3-3] Local variables (!objref): + + bool local0__ = false; + //------------------- // [3-4] Evaluation stacks (!objref): + int32_t stack0_2__; + bool stack0_3__; untyped_ptr stack1_0__; //------------------- @@ -125,30 +135,43 @@ void MT3620Blink_Application_Dispose(MT3620Blink_Application* this__) //------------------- // [3-6] IL body: - /* IL_0000: ldarg.0 : Application.cs(36) */ + /* IL_0000: nop : Application.cs(35) */ + /* IL_0001: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0001: call MT3620Blink.Descriptor.Dispose : Application.cs(36) */ + /* IL_0002: call MT3620Blink.Descriptor.Dispose : Application.cs(36) */ MT3620Blink_Descriptor_Dispose((MT3620Blink_Descriptor*)frame__.stack0_0__); - /* IL_0006: ldarg.0 : Application.cs(38) */ + /* IL_0007: nop : Application.cs(36) */ + /* IL_0008: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0007: ldfld MT3620Blink.Application.abort : Application.cs(38) */ + /* IL_0009: ldfld MT3620Blink.Application.abort : Application.cs(38) */ frame__.stack0_1__ = frame__.stack0_0__->abort; - /* IL_000c: brfalse.s IL_0020 : Application.cs(38) */ - if (frame__.stack0_1__ == NULL) goto IL_0020; - /* IL_000e: ldarg.0 : Application.cs(40) */ + /* IL_000e: ldnull : Application.cs(38) */ + stack1_0__ = NULL; + /* IL_000f: cgt.un : Application.cs(38) */ + stack0_2__ = (uintptr_t)frame__.stack0_1__ > (uintptr_t)stack1_0__; + /* IL_0011: stloc.0 : Application.cs(38) */ + local0__ = (bool)stack0_2__; + /* IL_0012: ldloc.0 : Application.cs(38) */ + stack0_3__ = local0__; + /* IL_0013: brfalse.s IL_002a : Application.cs(38) */ + if (stack0_3__ == false) goto IL_002a; + /* IL_0015: nop : Application.cs(39) */ + /* IL_0016: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_000f: ldfld MT3620Blink.Application.abort : Application.cs(40) */ + /* IL_0017: ldfld MT3620Blink.Application.abort : Application.cs(40) */ frame__.stack0_1__ = frame__.stack0_0__->abort; - /* IL_0014: callvirt MT3620Blink.Descriptor.Dispose : Application.cs(40) */ + /* IL_001c: callvirt MT3620Blink.Descriptor.Dispose : Application.cs(40) */ frame__.stack0_1__->vptr0__->Dispose((MT3620Blink_Descriptor*)frame__.stack0_1__); - /* IL_0019: ldarg.0 : Application.cs(41) */ + /* IL_0021: nop : Application.cs(40) */ + /* IL_0022: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_001a: ldnull : Application.cs(41) */ + /* IL_0023: ldnull : Application.cs(41) */ stack1_0__ = NULL; - /* IL_001b: stfld MT3620Blink.Application.abort : Application.cs(41) */ + /* IL_0024: stfld MT3620Blink.Application.abort : Application.cs(41) */ frame__.stack0_0__->abort = (MT3620Blink_Application_AbortEvent*)stack1_0__; -IL_0020: - /* IL_0020: ret : Application.cs(43) */ + /* IL_0029: nop : Application.cs(42) */ +IL_002a: + /* IL_002a: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -216,64 +239,65 @@ void MT3620Blink_Application_RegisterDescriptor(MT3620Blink_Application* this__, //------------------- // [3-6] IL body: - /* IL_0000: ldarg.1 : Application.cs(47) */ + /* IL_0000: nop : Application.cs(46) */ + /* IL_0001: ldarg.1 */ frame__.stack0_0__ = target; - /* IL_0001: ldc.i4.3 : Application.cs(47) */ + /* IL_0002: ldc.i4.3 : Application.cs(47) */ stack1_0__ = 3; - /* IL_0002: call System.Runtime.InteropServices.GCHandle.Alloc : Application.cs(47) */ + /* IL_0003: call System.Runtime.InteropServices.GCHandle.Alloc : Application.cs(47) */ stack0_1__ = System_Runtime_InteropServices_GCHandle_Alloc_1(il2c_adjusted_reference(frame__.stack0_0__), (System_Runtime_InteropServices_GCHandleType)stack1_0__); - /* IL_0007: stloc.0 : Application.cs(47) */ + /* IL_0008: stloc.0 : Application.cs(47) */ handle = stack0_1__; - /* IL_0008: ldloca.s local2__ : Application.cs(49) */ + /* IL_0009: ldloca.s local2__ : Application.cs(49) */ stack0_2__ = &local2__; - /* IL_000a: initobj MT3620Blink.epoll_event : Application.cs(49) */ + /* IL_000b: initobj MT3620Blink.epoll_event : Application.cs(49) */ memset(stack0_2__, 0x00, sizeof *stack0_2__); - /* IL_0010: ldloca.s local2__ : Application.cs(49) */ + /* IL_0011: ldloca.s local2__ : Application.cs(49) */ stack0_2__ = &local2__; - /* IL_0012: ldsfld MT3620Blink.Interops.EPOLLIN : Application.cs(49) */ + /* IL_0013: ldsfld MT3620Blink.Interops.EPOLLIN : Application.cs(49) */ stack1_1__ = MT3620Blink_Interops_EPOLLIN; - /* IL_0017: stfld MT3620Blink.epoll_event.events : Application.cs(49) */ + /* IL_0018: stfld MT3620Blink.epoll_event.events : Application.cs(49) */ stack0_2__->events = stack1_1__; - /* IL_001c: ldloca.s local2__ : Application.cs(49) */ + /* IL_001d: ldloca.s local2__ : Application.cs(49) */ stack0_2__ = &local2__; - /* IL_001e: ldloca.s local3__ : Application.cs(49) */ + /* IL_001f: ldloca.s local3__ : Application.cs(49) */ stack1_2__ = &local3__; - /* IL_0020: initobj MT3620Blink.epoll_data_t : Application.cs(49) */ + /* IL_0021: initobj MT3620Blink.epoll_data_t : Application.cs(49) */ memset(stack1_2__, 0x00, sizeof *stack1_2__); - /* IL_0026: ldloca.s local3__ : Application.cs(49) */ + /* IL_0027: ldloca.s local3__ : Application.cs(49) */ stack1_2__ = &local3__; - /* IL_0028: ldloc.0 : Application.cs(49) */ + /* IL_0029: ldloc.0 : Application.cs(49) */ stack2_0__ = handle; - /* IL_0029: call System.Runtime.InteropServices.GCHandle.ToIntPtr : Application.cs(49) */ + /* IL_002a: call System.Runtime.InteropServices.GCHandle.ToIntPtr : Application.cs(49) */ stack2_1__ = System_Runtime_InteropServices_GCHandle_ToIntPtr(stack2_0__); - /* IL_002e: call System.Runtime.InteropServices.NativePointer.op_Implicit : Application.cs(49) */ + /* IL_002f: call System.Runtime.InteropServices.NativePointer.op_Implicit : Application.cs(49) */ stack2_2__ = System_Runtime_InteropServices_NativePointer_op_Implicit(stack2_1__); - /* IL_0033: stfld MT3620Blink.epoll_data_t.ptr : Application.cs(49) */ + /* IL_0034: stfld MT3620Blink.epoll_data_t.ptr : Application.cs(49) */ stack1_2__->ptr = stack2_2__; - /* IL_0038: ldloc.3 : Application.cs(49) */ + /* IL_0039: ldloc.3 : Application.cs(49) */ stack1_3__ = local3__; - /* IL_0039: stfld MT3620Blink.epoll_event.data : Application.cs(49) */ + /* IL_003a: stfld MT3620Blink.epoll_event.data : Application.cs(49) */ stack0_2__->data = stack1_3__; - /* IL_003e: ldloc.2 : Application.cs(49) */ + /* IL_003f: ldloc.2 : Application.cs(49) */ stack0_3__ = local2__; - /* IL_003f: stloc.1 : Application.cs(49) */ + /* IL_0040: stloc.1 : Application.cs(49) */ ev = stack0_3__; - /* IL_0040: ldarg.0 : Application.cs(54) */ + /* IL_0041: ldarg.0 : Application.cs(54) */ frame__.stack0_4__ = this__; - /* IL_0041: call MT3620Blink.Descriptor.get_Identity : Application.cs(54) */ + /* IL_0042: call MT3620Blink.Descriptor.get_Identity : Application.cs(54) */ stack0_5__ = MT3620Blink_Descriptor_get_Identity((MT3620Blink_Descriptor*)frame__.stack0_4__); - /* IL_0046: ldsfld MT3620Blink.Interops.EPOLL_CTL_ADD : Application.cs(54) */ + /* IL_0047: ldsfld MT3620Blink.Interops.EPOLL_CTL_ADD : Application.cs(54) */ stack1_0__ = MT3620Blink_Interops_EPOLL_CTL_ADD; - /* IL_004b: ldarg.1 : Application.cs(54) */ + /* IL_004c: ldarg.1 : Application.cs(54) */ frame__.stack2_3__ = target; - /* IL_004c: callvirt MT3620Blink.IEPollListener.get_Identity : Application.cs(54) */ + /* IL_004d: callvirt MT3620Blink.IEPollListener.get_Identity : Application.cs(54) */ stack2_4__ = frame__.stack2_3__->vptr0__->get_Identity(il2c_adjusted_reference(frame__.stack2_3__)); - /* IL_0051: ldloca.s ev : Application.cs(54) */ + /* IL_0052: ldloca.s ev : Application.cs(54) */ stack3_0__ = &ev; - /* IL_0053: call MT3620Blink.Interops.epoll_ctl : Application.cs(54) */ + /* IL_0054: call MT3620Blink.Interops.epoll_ctl : Application.cs(54) */ stack0_5__ = MT3620Blink_Interops_epoll_ctl(stack0_5__, stack1_0__, stack2_4__, stack3_0__); - /* IL_0058: pop : Application.cs(54) */ - /* IL_0059: ret */ + /* IL_0059: pop : Application.cs(54) */ + /* IL_005a: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -331,38 +355,40 @@ void MT3620Blink_Application_UnregisterDescriptor(MT3620Blink_Application* this_ //------------------- // [3-6] IL body: - /* IL_0000: ldarg.1 : Application.cs(63) */ + /* IL_0000: nop : Application.cs(62) */ + /* IL_0001: ldarg.1 */ frame__.stack0_0__ = target; - /* IL_0001: ldc.i4.3 : Application.cs(63) */ + /* IL_0002: ldc.i4.3 : Application.cs(63) */ stack1_0__ = 3; - /* IL_0002: call System.Runtime.InteropServices.GCHandle.Alloc : Application.cs(63) */ + /* IL_0003: call System.Runtime.InteropServices.GCHandle.Alloc : Application.cs(63) */ stack0_1__ = System_Runtime_InteropServices_GCHandle_Alloc_1(il2c_adjusted_reference(frame__.stack0_0__), (System_Runtime_InteropServices_GCHandleType)stack1_0__); - /* IL_0007: stloc.0 : Application.cs(63) */ + /* IL_0008: stloc.0 : Application.cs(63) */ handle = stack0_1__; - /* IL_0008: ldloca.s handle : Application.cs(64) */ + /* IL_0009: ldloca.s handle : Application.cs(64) */ stack0_2__ = &handle; - /* IL_000a: call System.Runtime.InteropServices.GCHandle.Free : Application.cs(64) */ + /* IL_000b: call System.Runtime.InteropServices.GCHandle.Free : Application.cs(64) */ System_Runtime_InteropServices_GCHandle_Free(stack0_2__); - /* IL_000f: ldloca.s ev : Application.cs(66) */ + /* IL_0010: nop : Application.cs(64) */ + /* IL_0011: ldloca.s ev */ stack0_3__ = &ev; - /* IL_0011: initobj MT3620Blink.epoll_event : Application.cs(66) */ + /* IL_0013: initobj MT3620Blink.epoll_event : Application.cs(66) */ memset(stack0_3__, 0x00, sizeof *stack0_3__); - /* IL_0017: ldarg.0 : Application.cs(68) */ + /* IL_0019: ldarg.0 : Application.cs(68) */ frame__.stack0_4__ = this__; - /* IL_0018: call MT3620Blink.Descriptor.get_Identity : Application.cs(68) */ + /* IL_001a: call MT3620Blink.Descriptor.get_Identity : Application.cs(68) */ stack0_5__ = MT3620Blink_Descriptor_get_Identity((MT3620Blink_Descriptor*)frame__.stack0_4__); - /* IL_001d: ldsfld MT3620Blink.Interops.EPOLL_CTL_DEL : Application.cs(68) */ + /* IL_001f: ldsfld MT3620Blink.Interops.EPOLL_CTL_DEL : Application.cs(68) */ stack1_0__ = MT3620Blink_Interops_EPOLL_CTL_DEL; - /* IL_0022: ldarg.1 : Application.cs(68) */ + /* IL_0024: ldarg.1 : Application.cs(68) */ frame__.stack2_0__ = target; - /* IL_0023: callvirt MT3620Blink.IEPollListener.get_Identity : Application.cs(68) */ + /* IL_0025: callvirt MT3620Blink.IEPollListener.get_Identity : Application.cs(68) */ stack2_1__ = frame__.stack2_0__->vptr0__->get_Identity(il2c_adjusted_reference(frame__.stack2_0__)); - /* IL_0028: ldloca.s ev : Application.cs(68) */ + /* IL_002a: ldloca.s ev : Application.cs(68) */ stack3_0__ = &ev; - /* IL_002a: call MT3620Blink.Interops.epoll_ctl : Application.cs(68) */ + /* IL_002c: call MT3620Blink.Interops.epoll_ctl : Application.cs(68) */ stack0_5__ = MT3620Blink_Interops_epoll_ctl(stack0_5__, stack1_0__, stack2_1__, stack3_0__); - /* IL_002f: pop : Application.cs(68) */ - /* IL_0030: ret */ + /* IL_0031: pop : Application.cs(68) */ + /* IL_0032: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -406,7 +432,8 @@ void MT3620Blink_Application_Abort(MT3620Blink_Application* this__) frame__.stack0_1__ = frame__.stack0_0__->abort; /* IL_0006: callvirt MT3620Blink.Event.Pulse : Application.cs(76) */ MT3620Blink_Event_Pulse((MT3620Blink_Event*)frame__.stack0_1__); - /* IL_000b: ret : Application.cs(76) */ + /* IL_000b: nop : Application.cs(76) */ + /* IL_000c: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -442,23 +469,26 @@ void MT3620Blink_Application_Run(MT3620Blink_Application* this__) MT3620Blink_epoll_event ev; memset(&ev, 0x00, sizeof ev); int32_t numEventsOccurred = 0; + bool local2__ = false; + bool local3__ = false; System_Runtime_InteropServices_GCHandle handle; memset(&handle, 0x00, sizeof handle); + bool local6__ = false; //------------------- // [3-4] Evaluation stacks (!objref): bool stack0_1__; - MT3620Blink_epoll_event* stack0_2__; - int32_t stack0_3__; + int32_t stack0_2__; + MT3620Blink_epoll_event* stack0_3__; MT3620Blink_epoll_event stack0_4__; MT3620Blink_epoll_data_t stack0_5__; System_Runtime_InteropServices_NativePointer stack0_6__; intptr_t stack0_7__; System_Runtime_InteropServices_GCHandle stack0_8__; System_Runtime_InteropServices_GCHandle* stack0_9__; - MT3620Blink_epoll_event* stack1_0__; - int32_t stack1_1__; + int32_t stack1_0__; + MT3620Blink_epoll_event* stack1_1__; int32_t stack2_0__; int32_t stack3_0__; @@ -472,72 +502,103 @@ void MT3620Blink_Application_Run(MT3620Blink_Application* this__) //------------------- // [3-6] IL body: - /* IL_0000: br.s IL_004b */ - goto IL_004b; -IL_0002: - /* IL_0002: ldloca.s ev : Application.cs(82) */ - stack0_2__ = &ev; - /* IL_0004: initobj MT3620Blink.epoll_event : Application.cs(82) */ - memset(stack0_2__, 0x00, sizeof *stack0_2__); - /* IL_000a: ldarg.0 : Application.cs(83) */ + /* IL_0000: nop : Application.cs(79) */ + /* IL_0001: br.s IL_005f */ + goto IL_005f; +IL_0003: + /* IL_0003: nop : Application.cs(81) */ + /* IL_0004: ldloca.s ev */ + stack0_3__ = &ev; + /* IL_0006: initobj MT3620Blink.epoll_event : Application.cs(82) */ + memset(stack0_3__, 0x00, sizeof *stack0_3__); + /* IL_000c: ldarg.0 : Application.cs(83) */ frame__.stack0_0__ = this__; - /* IL_000b: call MT3620Blink.Descriptor.get_Identity : Application.cs(83) */ - stack0_3__ = MT3620Blink_Descriptor_get_Identity((MT3620Blink_Descriptor*)frame__.stack0_0__); - /* IL_0010: ldloca.s ev : Application.cs(83) */ - stack1_0__ = &ev; - /* IL_0012: ldc.i4.1 : Application.cs(83) */ + /* IL_000d: call MT3620Blink.Descriptor.get_Identity : Application.cs(83) */ + stack0_2__ = MT3620Blink_Descriptor_get_Identity((MT3620Blink_Descriptor*)frame__.stack0_0__); + /* IL_0012: ldloca.s ev : Application.cs(83) */ + stack1_1__ = &ev; + /* IL_0014: ldc.i4.1 : Application.cs(83) */ stack2_0__ = 1; - /* IL_0013: ldc.i4.m1 : Application.cs(83) */ + /* IL_0015: ldc.i4.m1 : Application.cs(83) */ stack3_0__ = -1; - /* IL_0014: call MT3620Blink.Interops.epoll_wait : Application.cs(83) */ - stack0_3__ = MT3620Blink_Interops_epoll_wait(stack0_3__, stack1_0__, stack2_0__, stack3_0__); - /* IL_0019: stloc.1 : Application.cs(83) */ - numEventsOccurred = stack0_3__; - /* IL_001a: ldloc.1 : Application.cs(85) */ - stack0_3__ = numEventsOccurred; - /* IL_001b: ldc.i4.m1 : Application.cs(85) */ - stack1_1__ = -1; - /* IL_001c: beq.s IL_0053 : Application.cs(85) */ - if (stack0_3__ == stack1_1__) goto IL_0053; - /* IL_001e: ldloc.1 : Application.cs(89) */ - stack0_3__ = numEventsOccurred; - /* IL_001f: ldc.i4.1 : Application.cs(89) */ - stack1_1__ = 1; - /* IL_0020: bne.un.s IL_004b : Application.cs(89) */ - if (stack0_3__ != stack1_1__) goto IL_004b; - /* IL_0022: ldloc.0 : Application.cs(91) */ + /* IL_0016: call MT3620Blink.Interops.epoll_wait : Application.cs(83) */ + stack0_2__ = MT3620Blink_Interops_epoll_wait(stack0_2__, stack1_1__, stack2_0__, stack3_0__); + /* IL_001b: stloc.1 : Application.cs(83) */ + numEventsOccurred = stack0_2__; + /* IL_001c: ldloc.1 : Application.cs(85) */ + stack0_2__ = numEventsOccurred; + /* IL_001d: ldc.i4.m1 : Application.cs(85) */ + stack1_0__ = -1; + /* IL_001e: ceq : Application.cs(85) */ + stack0_2__ = (int32_t)stack0_2__ == (int32_t)stack1_0__; + /* IL_0020: stloc.2 : Application.cs(85) */ + local2__ = (bool)stack0_2__; + /* IL_0021: ldloc.2 : Application.cs(85) */ + stack0_1__ = local2__; + /* IL_0022: brfalse.s IL_0027 : Application.cs(85) */ + if (stack0_1__ == false) goto IL_0027; + /* IL_0024: nop : Application.cs(86) */ + /* IL_0025: br.s IL_006e */ + goto IL_006e; +IL_0027: + /* IL_0027: ldloc.1 : Application.cs(89) */ + stack0_2__ = numEventsOccurred; + /* IL_0028: ldc.i4.1 : Application.cs(89) */ + stack1_0__ = 1; + /* IL_0029: ceq : Application.cs(89) */ + stack0_2__ = (int32_t)stack0_2__ == (int32_t)stack1_0__; + /* IL_002b: stloc.3 : Application.cs(89) */ + local3__ = (bool)stack0_2__; + /* IL_002c: ldloc.3 : Application.cs(89) */ + stack0_1__ = local3__; + /* IL_002d: brfalse.s IL_005e : Application.cs(89) */ + if (stack0_1__ == false) goto IL_005e; + /* IL_002f: nop : Application.cs(90) */ + /* IL_0030: ldloc.0 */ stack0_4__ = ev; - /* IL_0023: ldfld MT3620Blink.epoll_event.data : Application.cs(91) */ + /* IL_0031: ldfld MT3620Blink.epoll_event.data : Application.cs(91) */ stack0_5__ = stack0_4__.data; - /* IL_0028: ldfld MT3620Blink.epoll_data_t.ptr : Application.cs(91) */ + /* IL_0036: ldfld MT3620Blink.epoll_data_t.ptr : Application.cs(91) */ stack0_6__ = stack0_5__.ptr; - /* IL_002d: call System.Runtime.InteropServices.NativePointer.op_Implicit : Application.cs(91) */ + /* IL_003b: call System.Runtime.InteropServices.NativePointer.op_Implicit : Application.cs(91) */ stack0_7__ = System_Runtime_InteropServices_NativePointer_op_Implicit_1(stack0_6__); - /* IL_0032: call System.Runtime.InteropServices.GCHandle.FromIntPtr : Application.cs(91) */ + /* IL_0040: call System.Runtime.InteropServices.GCHandle.FromIntPtr : Application.cs(91) */ stack0_8__ = System_Runtime_InteropServices_GCHandle_FromIntPtr(stack0_7__); - /* IL_0037: stloc.2 : Application.cs(91) */ + /* IL_0045: stloc.s handle : Application.cs(91) */ handle = stack0_8__; - /* IL_0038: ldloca.s handle : Application.cs(92) */ + /* IL_0047: ldloca.s handle : Application.cs(92) */ stack0_9__ = &handle; - /* IL_003a: call System.Runtime.InteropServices.GCHandle.get_Target : Application.cs(92) */ + /* IL_0049: call System.Runtime.InteropServices.GCHandle.get_Target : Application.cs(92) */ frame__.stack0_10__ = System_Runtime_InteropServices_GCHandle_get_Target(stack0_9__); - /* IL_003f: castclass MT3620Blink.IEPollListener : Application.cs(92) */ + /* IL_004e: castclass MT3620Blink.IEPollListener : Application.cs(92) */ frame__.stack0_11__ = il2c_castclass(frame__.stack0_10__, MT3620Blink_IEPollListener); - /* IL_0044: stloc.3 : Application.cs(92) */ + /* IL_0053: stloc.s target : Application.cs(92) */ frame__.target = frame__.stack0_11__; - /* IL_0045: ldloc.3 : Application.cs(93) */ + /* IL_0055: ldloc.s target : Application.cs(93) */ frame__.stack0_11__ = frame__.target; - /* IL_0046: callvirt MT3620Blink.IEPollListener.OnRaised : Application.cs(93) */ + /* IL_0057: callvirt MT3620Blink.IEPollListener.OnRaised : Application.cs(93) */ frame__.stack0_11__->vptr0__->OnRaised(il2c_adjusted_reference(frame__.stack0_11__)); -IL_004b: - /* IL_004b: ldarg.0 : Application.cs(80) */ + /* IL_005c: nop : Application.cs(93) */ + /* IL_005d: nop */ +IL_005e: + /* IL_005e: nop */ +IL_005f: + /* IL_005f: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_004c: ldfld MT3620Blink.Application.abortFlag : Application.cs(80) */ + /* IL_0060: ldfld MT3620Blink.Application.abortFlag : Application.cs(80) */ stack0_1__ = frame__.stack0_0__->abortFlag; - /* IL_0051: brfalse.s IL_0002 : Application.cs(80) */ - if (stack0_1__ == false) goto IL_0002; -IL_0053: - /* IL_0053: ret : Application.cs(96) */ + /* IL_0065: ldc.i4.0 : Application.cs(80) */ + stack1_0__ = 0; + /* IL_0066: ceq : Application.cs(80) */ + stack0_2__ = (int32_t)stack0_1__ == (int32_t)stack1_0__; + /* IL_0068: stloc.s local6__ : Application.cs(80) */ + local6__ = (bool)stack0_2__; + /* IL_006a: ldloc.s local6__ : Application.cs(80) */ + stack0_1__ = local6__; + /* IL_006c: brtrue.s IL_0003 : Application.cs(80) */ + if (stack0_1__ != false) goto IL_0003; +IL_006e: + /* IL_006e: ret : Application.cs(96) */ il2c_unlink_execution_frame(&frame__); return; } @@ -619,13 +680,14 @@ void MT3620Blink_Application_AbortEvent__ctor(MT3620Blink_Application_AbortEvent frame__.stack0_0__ = this__; /* IL_0001: call MT3620Blink.Event..ctor : Application.cs(17) */ MT3620Blink_Event__ctor((MT3620Blink_Event*)frame__.stack0_0__); - /* IL_0006: ldarg.0 : Application.cs(18) */ + /* IL_0006: nop : Application.cs(17) */ + /* IL_0007: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0007: ldarg.1 : Application.cs(18) */ + /* IL_0008: ldarg.1 : Application.cs(18) */ frame__.stack1_0__ = parent; - /* IL_0008: stfld MT3620Blink.Application.AbortEvent.parent : Application.cs(18) */ + /* IL_0009: stfld MT3620Blink.Application.AbortEvent.parent : Application.cs(18) */ frame__.stack0_0__->parent = frame__.stack1_0__; - /* IL_000d: ret : Application.cs(18) */ + /* IL_000e: ret : Application.cs(18) */ il2c_unlink_execution_frame(&frame__); return; } diff --git a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Descriptor.c b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Descriptor.c index 6a916d83..0438938c 100644 --- a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Descriptor.c +++ b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Descriptor.c @@ -36,8 +36,8 @@ typedef struct MT3620Blink_Descriptor__ctor_EXECUTION_FRAME_DECL const uint16_t valueCount__; //-------------------- objref MT3620Blink_Descriptor* stack0_0__; - System_String* stack0_2__; - System_Exception* stack0_3__; + System_String* stack0_3__; + System_Exception* stack0_4__; il2c_boxedtype(System_Int32)* stack1_1__; } MT3620Blink_Descriptor__ctor_EXECUTION_FRAME__; @@ -48,10 +48,16 @@ void MT3620Blink_Descriptor__ctor(MT3620Blink_Descriptor* this__, int32_t fd) { il2c_assert(this__ != NULL); + //------------------- + // [3-3] Local variables (!objref): + + bool local0__ = false; + //------------------- // [3-4] Evaluation stacks (!objref): int32_t stack0_1__; + bool stack0_2__; int32_t stack1_0__; //------------------- @@ -68,33 +74,43 @@ void MT3620Blink_Descriptor__ctor(MT3620Blink_Descriptor* this__, int32_t fd) frame__.stack0_0__ = this__; /* IL_0001: call System.Object..ctor : Descriptor.cs(7) */ System_Object__ctor((System_Object*)frame__.stack0_0__); - /* IL_0006: ldarg.1 : Descriptor.cs(9) */ + /* IL_0006: nop : Descriptor.cs(7) */ + /* IL_0007: nop */ + /* IL_0008: ldarg.1 */ stack0_1__ = fd; - /* IL_0007: ldc.i4.0 : Descriptor.cs(9) */ + /* IL_0009: ldc.i4.0 : Descriptor.cs(9) */ stack1_0__ = 0; - /* IL_0008: bge.s IL_0020 : Descriptor.cs(9) */ - if (stack0_1__ >= stack1_0__) goto IL_0020; - /* IL_000a: ldstr "Invalid descriptor: " : Descriptor.cs(11) */ - frame__.stack0_2__ = MT3620Blink_string0__; - /* IL_000f: ldarg.1 : Descriptor.cs(11) */ + /* IL_000a: clt : Descriptor.cs(9) */ + stack0_1__ = (int32_t)stack0_1__ < (int32_t)stack1_0__; + /* IL_000c: stloc.0 : Descriptor.cs(9) */ + local0__ = (bool)stack0_1__; + /* IL_000d: ldloc.0 : Descriptor.cs(9) */ + stack0_2__ = local0__; + /* IL_000e: brfalse.s IL_0027 : Descriptor.cs(9) */ + if (stack0_2__ == false) goto IL_0027; + /* IL_0010: nop : Descriptor.cs(10) */ + /* IL_0011: ldstr "Invalid descriptor: " */ + frame__.stack0_3__ = MT3620Blink_string0__; + /* IL_0016: ldarg.1 : Descriptor.cs(11) */ stack1_0__ = fd; - /* IL_0010: box System.Int32 : Descriptor.cs(11) */ + /* IL_0017: box System.Int32 : Descriptor.cs(11) */ frame__.stack1_1__ = il2c_box(&stack1_0__, System_Int32); - /* IL_0015: call System.String.Concat : Descriptor.cs(11) */ - frame__.stack0_2__ = System_String_Concat_4((System_Object*)frame__.stack0_2__, (System_Object*)frame__.stack1_1__); - /* IL_001a: newobj System.Exception..ctor : Descriptor.cs(11) */ - frame__.stack0_3__ = il2c_get_uninitialized_object(System_Exception); - System_Exception__ctor_1(frame__.stack0_3__, frame__.stack0_2__); - /* IL_001f: throw : Descriptor.cs(11) */ - il2c_throw(frame__.stack0_3__); -IL_0020: - /* IL_0020: ldarg.0 : Descriptor.cs(13) */ + /* IL_001c: call System.String.Concat : Descriptor.cs(11) */ + frame__.stack0_3__ = System_String_Concat_4((System_Object*)frame__.stack0_3__, (System_Object*)frame__.stack1_1__); + /* IL_0021: newobj System.Exception..ctor : Descriptor.cs(11) */ + frame__.stack0_4__ = il2c_get_uninitialized_object(System_Exception); + System_Exception__ctor_1(frame__.stack0_4__, frame__.stack0_3__); + /* IL_0026: throw : Descriptor.cs(11) */ + il2c_throw(frame__.stack0_4__); +IL_0027: + /* IL_0027: ldarg.0 : Descriptor.cs(13) */ frame__.stack0_0__ = this__; - /* IL_0021: ldarg.1 : Descriptor.cs(13) */ + /* IL_0028: ldarg.1 : Descriptor.cs(13) */ stack1_0__ = fd; - /* IL_0022: call MT3620Blink.Descriptor.set_Identity : Descriptor.cs(13) */ + /* IL_0029: call MT3620Blink.Descriptor.set_Identity : Descriptor.cs(13) */ MT3620Blink_Descriptor_set_Identity(frame__.stack0_0__, stack1_0__); - /* IL_0027: ret : Descriptor.cs(14) */ + /* IL_002e: nop : Descriptor.cs(13) */ + /* IL_002f: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -121,10 +137,16 @@ void MT3620Blink_Descriptor_Dispose(MT3620Blink_Descriptor* this__) { il2c_assert(this__ != NULL); + //------------------- + // [3-3] Local variables (!objref): + + bool local0__ = false; + //------------------- // [3-4] Evaluation stacks (!objref): int32_t stack0_1__; + bool stack0_2__; int32_t stack1_0__; //------------------- @@ -137,29 +159,43 @@ void MT3620Blink_Descriptor_Dispose(MT3620Blink_Descriptor* this__) //------------------- // [3-6] IL body: - /* IL_0000: ldarg.0 : Descriptor.cs(18) */ + /* IL_0000: nop : Descriptor.cs(17) */ + /* IL_0001: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0001: call MT3620Blink.Descriptor.get_Identity : Descriptor.cs(18) */ + /* IL_0002: call MT3620Blink.Descriptor.get_Identity : Descriptor.cs(18) */ stack0_1__ = MT3620Blink_Descriptor_get_Identity(frame__.stack0_0__); - /* IL_0006: ldc.i4.0 : Descriptor.cs(18) */ + /* IL_0007: ldc.i4.0 : Descriptor.cs(18) */ + stack1_0__ = 0; + /* IL_0008: clt : Descriptor.cs(18) */ + stack0_1__ = (int32_t)stack0_1__ < (int32_t)stack1_0__; + /* IL_000a: ldc.i4.0 : Descriptor.cs(18) */ stack1_0__ = 0; - /* IL_0007: blt.s IL_001c : Descriptor.cs(18) */ - if (stack0_1__ < stack1_0__) goto IL_001c; - /* IL_0009: ldarg.0 : Descriptor.cs(20) */ + /* IL_000b: ceq : Descriptor.cs(18) */ + stack0_1__ = (int32_t)stack0_1__ == (int32_t)stack1_0__; + /* IL_000d: stloc.0 : Descriptor.cs(18) */ + local0__ = (bool)stack0_1__; + /* IL_000e: ldloc.0 : Descriptor.cs(18) */ + stack0_2__ = local0__; + /* IL_000f: brfalse.s IL_0027 : Descriptor.cs(18) */ + if (stack0_2__ == false) goto IL_0027; + /* IL_0011: nop : Descriptor.cs(19) */ + /* IL_0012: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_000a: call MT3620Blink.Descriptor.get_Identity : Descriptor.cs(20) */ + /* IL_0013: call MT3620Blink.Descriptor.get_Identity : Descriptor.cs(20) */ stack0_1__ = MT3620Blink_Descriptor_get_Identity(frame__.stack0_0__); - /* IL_000f: call MT3620Blink.Interops.close : Descriptor.cs(20) */ + /* IL_0018: call MT3620Blink.Interops.close : Descriptor.cs(20) */ stack0_1__ = MT3620Blink_Interops_close(stack0_1__); - /* IL_0014: pop : Descriptor.cs(20) */ - /* IL_0015: ldarg.0 */ + /* IL_001d: pop : Descriptor.cs(20) */ + /* IL_001e: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0016: ldc.i4.m1 : Descriptor.cs(21) */ + /* IL_001f: ldc.i4.m1 : Descriptor.cs(21) */ stack1_0__ = -1; - /* IL_0017: call MT3620Blink.Descriptor.set_Identity : Descriptor.cs(21) */ + /* IL_0020: call MT3620Blink.Descriptor.set_Identity : Descriptor.cs(21) */ MT3620Blink_Descriptor_set_Identity(frame__.stack0_0__, stack1_0__); -IL_001c: - /* IL_001c: ret : Descriptor.cs(23) */ + /* IL_0025: nop : Descriptor.cs(21) */ + /* IL_0026: nop */ +IL_0027: + /* IL_0027: ret */ il2c_unlink_execution_frame(&frame__); return; } diff --git a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Event.c b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Event.c index 3f20e0d1..1bb45013 100644 --- a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Event.c +++ b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Event.c @@ -78,7 +78,9 @@ void MT3620Blink_Event__ctor(MT3620Blink_Event* this__) stack1_0__ = MT3620Blink_Interops_eventfd((uint32_t)stack1_0__, stack2_0__); /* IL_0012: call MT3620Blink.Descriptor..ctor : Event.cs(14) */ MT3620Blink_Descriptor__ctor((MT3620Blink_Descriptor*)frame__.stack0_0__, stack1_0__); - /* IL_0017: ret : Event.cs(16) */ + /* IL_0017: nop : Event.cs(14) */ + /* IL_0018: nop */ + /* IL_0019: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -122,18 +124,19 @@ void MT3620Blink_Event_Pulse(MT3620Blink_Event* this__) //------------------- // [3-6] IL body: - /* IL_0000: ldarg.0 : Event.cs(20) */ + /* IL_0000: nop : Event.cs(19) */ + /* IL_0001: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0001: call MT3620Blink.Descriptor.get_Identity : Event.cs(20) */ + /* IL_0002: call MT3620Blink.Descriptor.get_Identity : Event.cs(20) */ stack0_1__ = MT3620Blink_Descriptor_get_Identity((MT3620Blink_Descriptor*)frame__.stack0_0__); - /* IL_0006: ldc.i4.1 : Event.cs(20) */ + /* IL_0007: ldc.i4.1 : Event.cs(20) */ stack1_0__ = 1; - /* IL_0007: conv.i8 : Event.cs(20) */ + /* IL_0008: conv.i8 : Event.cs(20) */ stack1_1__ = (int64_t)stack1_0__; - /* IL_0008: call MT3620Blink.Interops.eventfd_write : Event.cs(20) */ + /* IL_0009: call MT3620Blink.Interops.eventfd_write : Event.cs(20) */ stack0_1__ = MT3620Blink_Interops_eventfd_write(stack0_1__, (uint64_t)stack1_1__); - /* IL_000d: pop : Event.cs(20) */ - /* IL_000e: ret */ + /* IL_000e: pop : Event.cs(20) */ + /* IL_000f: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -227,20 +230,22 @@ void MT3620Blink_Event_MT3620Blink_IEPollListener_OnRaised(MT3620Blink_Event* th //------------------- // [3-6] IL body: - /* IL_0000: ldarg.0 : Event.cs(27) */ + /* IL_0000: nop : Event.cs(26) */ + /* IL_0001: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0001: call MT3620Blink.Descriptor.get_Identity : Event.cs(27) */ + /* IL_0002: call MT3620Blink.Descriptor.get_Identity : Event.cs(27) */ stack0_1__ = MT3620Blink_Descriptor_get_Identity((MT3620Blink_Descriptor*)frame__.stack0_0__); - /* IL_0006: ldloca.s value : Event.cs(27) */ + /* IL_0007: ldloca.s value : Event.cs(27) */ stack1_0__ = &value; - /* IL_0008: call MT3620Blink.Interops.eventfd_read : Event.cs(27) */ + /* IL_0009: call MT3620Blink.Interops.eventfd_read : Event.cs(27) */ stack0_1__ = MT3620Blink_Interops_eventfd_read(stack0_1__, stack1_0__); - /* IL_000d: pop : Event.cs(27) */ - /* IL_000e: ldarg.0 */ + /* IL_000e: pop : Event.cs(27) */ + /* IL_000f: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_000f: callvirt MT3620Blink.Event.Received : Event.cs(28) */ + /* IL_0010: callvirt MT3620Blink.Event.Received : Event.cs(28) */ frame__.stack0_0__->vptr0__->Received(frame__.stack0_0__); - /* IL_0014: ret : Event.cs(29) */ + /* IL_0015: nop : Event.cs(28) */ + /* IL_0016: ret */ il2c_unlink_execution_frame(&frame__); return; } diff --git a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/GpioInput.c b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/GpioInput.c index a2c7a2a7..df87f968 100644 --- a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/GpioInput.c +++ b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/GpioInput.c @@ -61,7 +61,9 @@ void MT3620Blink_GpioInput__ctor(MT3620Blink_GpioInput* this__, int32_t gpioId) stack1_0__ = MT3620Blink_Interops_GPIO_OpenAsInput(stack1_0__); /* IL_0007: call MT3620Blink.Descriptor..ctor : GpioInput.cs(6) */ MT3620Blink_Descriptor__ctor((MT3620Blink_Descriptor*)frame__.stack0_0__, stack1_0__); - /* IL_000c: ret : GpioInput.cs(8) */ + /* IL_000c: nop : GpioInput.cs(6) */ + /* IL_000d: nop */ + /* IL_000e: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -120,21 +122,21 @@ bool MT3620Blink_GpioInput_get_Value(MT3620Blink_GpioInput* this__) stack1_0__ = &value; /* IL_0008: call MT3620Blink.Interops.GPIO_GetValue : GpioInput.cs(11) */ stack0_1__ = MT3620Blink_Interops_GPIO_GetValue(stack0_1__, stack1_0__); - /* IL_000d: brfalse.s IL_0011 : GpioInput.cs(11) */ - if (stack0_1__ == 0) goto IL_0011; + /* IL_000d: brfalse.s IL_0012 : GpioInput.cs(11) */ + if (stack0_1__ == 0) goto IL_0012; /* IL_000f: ldc.i4.0 : GpioInput.cs(11) */ stack0_1__ = 0; - /* IL_0010: ret : GpioInput.cs(11) */ - il2c_unlink_execution_frame(&frame__); - return (bool)stack0_1__; -IL_0011: - /* IL_0011: ldloc.0 : GpioInput.cs(11) */ + /* IL_0010: br.s IL_0016 : GpioInput.cs(11) */ + goto IL_0016; +IL_0012: + /* IL_0012: ldloc.0 : GpioInput.cs(11) */ stack0_2__ = value; - /* IL_0012: ldc.i4.1 : GpioInput.cs(11) */ + /* IL_0013: ldc.i4.1 : GpioInput.cs(11) */ stack1_1__ = 1; - /* IL_0013: ceq : GpioInput.cs(11) */ + /* IL_0014: ceq : GpioInput.cs(11) */ stack0_1__ = (int32_t)stack0_2__ == (int32_t)stack1_1__; - /* IL_0015: ret : GpioInput.cs(11) */ +IL_0016: + /* IL_0016: ret : GpioInput.cs(11) */ il2c_unlink_execution_frame(&frame__); return (bool)stack0_1__; } diff --git a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/GpioOutput.c b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/GpioOutput.c index ac5124c9..7f66dfaa 100644 --- a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/GpioOutput.c +++ b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/GpioOutput.c @@ -78,7 +78,9 @@ void MT3620Blink_GpioOutput__ctor(MT3620Blink_GpioOutput* this__, int32_t gpioId stack1_0__ = MT3620Blink_Interops_GPIO_OpenAsOutput(stack1_0__, stack2_0__, (MT3620Blink_GPIO_Value_Type)stack3_1__); /* IL_000f: call MT3620Blink.Descriptor..ctor : GpioOutput.cs(6) */ MT3620Blink_Descriptor__ctor((MT3620Blink_Descriptor*)frame__.stack0_0__, stack1_0__); - /* IL_0014: ret : GpioOutput.cs(11) */ + /* IL_0014: nop : GpioOutput.cs(6) */ + /* IL_0015: nop */ + /* IL_0016: ret */ il2c_unlink_execution_frame(&frame__); return; } diff --git a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Program.c b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Program.c index 2e3b93d9..78900ddf 100644 --- a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Program.c +++ b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Program.c @@ -3,6 +3,8 @@ #include #include +#include + #ifdef __cplusplus extern "C" { #endif @@ -86,24 +88,27 @@ void MT3620Blink_Program_GpioBlinker__ctor(MT3620Blink_Program_GpioBlinker* this frame__.stack0_0__ = this__; /* IL_0018: call MT3620Blink.Timer..ctor : Program.cs(14) */ MT3620Blink_Timer__ctor((MT3620Blink_Timer*)frame__.stack0_0__); - /* IL_001d: ldarg.0 : Program.cs(16) */ + /* IL_001d: nop : Program.cs(14) */ + /* IL_001e: nop */ + /* IL_001f: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_001e: ldarg.1 : Program.cs(16) */ + /* IL_0020: ldarg.1 : Program.cs(16) */ stack1_0__ = gpioId; - /* IL_001f: ldc.i4.0 : Program.cs(16) */ + /* IL_0021: ldc.i4.0 : Program.cs(16) */ stack2_1__ = 0; - /* IL_0020: ldc.i4.1 : Program.cs(16) */ + /* IL_0022: ldc.i4.1 : Program.cs(16) */ stack3_1__ = 1; - /* IL_0021: newobj MT3620Blink.GpioOutput..ctor : Program.cs(16) */ + /* IL_0023: newobj MT3620Blink.GpioOutput..ctor : Program.cs(16) */ frame__.stack1_2__ = il2c_get_uninitialized_object(MT3620Blink_GpioOutput); MT3620Blink_GpioOutput__ctor(frame__.stack1_2__, stack1_0__, (MT3620Blink_GPIO_OutputMode_Type)stack2_1__, (bool)stack3_1__); - /* IL_0026: stfld MT3620Blink.Program.GpioBlinker.output : Program.cs(16) */ + /* IL_0028: stfld MT3620Blink.Program.GpioBlinker.output : Program.cs(16) */ frame__.stack0_0__->output = frame__.stack1_2__; - /* IL_002b: ldarg.0 : Program.cs(20) */ + /* IL_002d: ldarg.0 : Program.cs(20) */ frame__.stack0_0__ = this__; - /* IL_002c: call MT3620Blink.Program.GpioBlinker.NextInterval : Program.cs(20) */ + /* IL_002e: call MT3620Blink.Program.GpioBlinker.NextInterval : Program.cs(20) */ MT3620Blink_Program_GpioBlinker_NextInterval(frame__.stack0_0__); - /* IL_0031: ret : Program.cs(21) */ + /* IL_0033: nop : Program.cs(20) */ + /* IL_0034: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -141,17 +146,20 @@ void MT3620Blink_Program_GpioBlinker_Dispose(MT3620Blink_Program_GpioBlinker* th //------------------- // [3-6] IL body: - /* IL_0000: ldarg.0 : Program.cs(25) */ + /* IL_0000: nop : Program.cs(24) */ + /* IL_0001: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0001: call MT3620Blink.Descriptor.Dispose : Program.cs(25) */ + /* IL_0002: call MT3620Blink.Descriptor.Dispose : Program.cs(25) */ MT3620Blink_Descriptor_Dispose((MT3620Blink_Descriptor*)frame__.stack0_0__); - /* IL_0006: ldarg.0 : Program.cs(26) */ + /* IL_0007: nop : Program.cs(25) */ + /* IL_0008: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0007: ldfld MT3620Blink.Program.GpioBlinker.output : Program.cs(26) */ + /* IL_0009: ldfld MT3620Blink.Program.GpioBlinker.output : Program.cs(26) */ frame__.stack0_1__ = frame__.stack0_0__->output; - /* IL_000c: callvirt MT3620Blink.Descriptor.Dispose : Program.cs(26) */ + /* IL_000e: callvirt MT3620Blink.Descriptor.Dispose : Program.cs(26) */ frame__.stack0_1__->vptr0__->Dispose((MT3620Blink_Descriptor*)frame__.stack0_1__); - /* IL_0011: ret : Program.cs(27) */ + /* IL_0013: nop : Program.cs(26) */ + /* IL_0014: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -197,29 +205,31 @@ void MT3620Blink_Program_GpioBlinker_Raised(MT3620Blink_Program_GpioBlinker* thi //------------------- // [3-6] IL body: - /* IL_0000: ldarg.0 : Program.cs(31) */ + /* IL_0000: nop : Program.cs(30) */ + /* IL_0001: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0001: ldfld MT3620Blink.Program.GpioBlinker.output : Program.cs(31) */ + /* IL_0002: ldfld MT3620Blink.Program.GpioBlinker.output : Program.cs(31) */ frame__.stack0_1__ = frame__.stack0_0__->output; - /* IL_0006: ldarg.0 : Program.cs(31) */ + /* IL_0007: ldarg.0 : Program.cs(31) */ frame__.stack1_0__ = this__; - /* IL_0007: ldfld MT3620Blink.Program.GpioBlinker.flag : Program.cs(31) */ + /* IL_0008: ldfld MT3620Blink.Program.GpioBlinker.flag : Program.cs(31) */ stack1_1__ = frame__.stack1_0__->flag; - /* IL_000c: callvirt MT3620Blink.GpioOutput.SetValue : Program.cs(31) */ + /* IL_000d: callvirt MT3620Blink.GpioOutput.SetValue : Program.cs(31) */ MT3620Blink_GpioOutput_SetValue(frame__.stack0_1__, stack1_1__); - /* IL_0011: ldarg.0 : Program.cs(32) */ + /* IL_0012: nop : Program.cs(31) */ + /* IL_0013: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0012: ldarg.0 : Program.cs(32) */ + /* IL_0014: ldarg.0 : Program.cs(32) */ frame__.stack1_0__ = this__; - /* IL_0013: ldfld MT3620Blink.Program.GpioBlinker.flag : Program.cs(32) */ + /* IL_0015: ldfld MT3620Blink.Program.GpioBlinker.flag : Program.cs(32) */ stack1_1__ = frame__.stack1_0__->flag; - /* IL_0018: ldc.i4.0 : Program.cs(32) */ + /* IL_001a: ldc.i4.0 : Program.cs(32) */ stack2_0__ = 0; - /* IL_0019: ceq : Program.cs(32) */ + /* IL_001b: ceq : Program.cs(32) */ stack1_2__ = (int32_t)stack1_1__ == (int32_t)stack2_0__; - /* IL_001b: stfld MT3620Blink.Program.GpioBlinker.flag : Program.cs(32) */ + /* IL_001d: stfld MT3620Blink.Program.GpioBlinker.flag : Program.cs(32) */ frame__.stack0_0__->flag = (bool)stack1_2__; - /* IL_0020: ret : Program.cs(33) */ + /* IL_0022: ret : Program.cs(33) */ il2c_unlink_execution_frame(&frame__); return; } @@ -266,45 +276,47 @@ void MT3620Blink_Program_GpioBlinker_NextInterval(MT3620Blink_Program_GpioBlinke //------------------- // [3-6] IL body: - /* IL_0000: ldarg.0 : Program.cs(37) */ + /* IL_0000: nop : Program.cs(36) */ + /* IL_0001: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0001: ldarg.0 : Program.cs(37) */ + /* IL_0002: ldarg.0 : Program.cs(37) */ frame__.stack1_0__ = this__; - /* IL_0002: ldfld MT3620Blink.Program.GpioBlinker.blinkIntervals : Program.cs(37) */ + /* IL_0003: ldfld MT3620Blink.Program.GpioBlinker.blinkIntervals : Program.cs(37) */ frame__.stack1_1__ = frame__.stack1_0__->blinkIntervals; - /* IL_0007: ldarg.0 : Program.cs(37) */ + /* IL_0008: ldarg.0 : Program.cs(37) */ frame__.stack2_0__ = this__; - /* IL_0008: ldfld MT3620Blink.Program.GpioBlinker.blinkIntervalIndex : Program.cs(37) */ + /* IL_0009: ldfld MT3620Blink.Program.GpioBlinker.blinkIntervalIndex : Program.cs(37) */ stack2_1__ = frame__.stack2_0__->blinkIntervalIndex; - /* IL_000d: ldelem.i8 : Program.cs(37) */ + /* IL_000e: ldelem.i8 : Program.cs(37) */ stack1_2__ = il2c_array_item(frame__.stack1_1__, int64_t, stack2_1__); - /* IL_000e: call MT3620Blink.Timer.SetInterval : Program.cs(37) */ + /* IL_000f: call MT3620Blink.Timer.SetInterval : Program.cs(37) */ MT3620Blink_Timer_SetInterval((MT3620Blink_Timer*)frame__.stack0_0__, stack1_2__); - /* IL_0013: ldarg.0 : Program.cs(39) */ + /* IL_0014: nop : Program.cs(37) */ + /* IL_0015: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0014: ldarg.0 : Program.cs(39) */ + /* IL_0016: ldarg.0 : Program.cs(39) */ frame__.stack1_0__ = this__; - /* IL_0015: ldfld MT3620Blink.Program.GpioBlinker.blinkIntervalIndex : Program.cs(39) */ + /* IL_0017: ldfld MT3620Blink.Program.GpioBlinker.blinkIntervalIndex : Program.cs(39) */ stack1_3__ = frame__.stack1_0__->blinkIntervalIndex; - /* IL_001a: ldc.i4.1 : Program.cs(39) */ + /* IL_001c: ldc.i4.1 : Program.cs(39) */ stack2_1__ = 1; - /* IL_001b: add : Program.cs(39) */ + /* IL_001d: add : Program.cs(39) */ stack1_3__ = stack1_3__ + stack2_1__; - /* IL_001c: stfld MT3620Blink.Program.GpioBlinker.blinkIntervalIndex : Program.cs(39) */ + /* IL_001e: stfld MT3620Blink.Program.GpioBlinker.blinkIntervalIndex : Program.cs(39) */ frame__.stack0_0__->blinkIntervalIndex = stack1_3__; - /* IL_0021: ldarg.0 : Program.cs(40) */ + /* IL_0023: ldarg.0 : Program.cs(40) */ frame__.stack0_0__ = this__; - /* IL_0022: ldarg.0 : Program.cs(40) */ + /* IL_0024: ldarg.0 : Program.cs(40) */ frame__.stack1_0__ = this__; - /* IL_0023: ldfld MT3620Blink.Program.GpioBlinker.blinkIntervalIndex : Program.cs(40) */ + /* IL_0025: ldfld MT3620Blink.Program.GpioBlinker.blinkIntervalIndex : Program.cs(40) */ stack1_3__ = frame__.stack1_0__->blinkIntervalIndex; - /* IL_0028: ldc.i4.3 : Program.cs(40) */ + /* IL_002a: ldc.i4.3 : Program.cs(40) */ stack2_1__ = 3; - /* IL_0029: rem : Program.cs(40) */ + /* IL_002b: rem : Program.cs(40) */ stack1_3__ = stack1_3__ % stack2_1__; - /* IL_002a: stfld MT3620Blink.Program.GpioBlinker.blinkIntervalIndex : Program.cs(40) */ + /* IL_002c: stfld MT3620Blink.Program.GpioBlinker.blinkIntervalIndex : Program.cs(40) */ frame__.stack0_0__->blinkIntervalIndex = stack1_3__; - /* IL_002f: ret : Program.cs(41) */ + /* IL_0031: ret : Program.cs(41) */ il2c_unlink_execution_frame(&frame__); return; } @@ -407,65 +419,68 @@ void MT3620Blink_Program_GpioPoller__ctor(MT3620Blink_Program_GpioPoller* this__ frame__.stack0_0__ = this__; /* IL_0001: call MT3620Blink.Timer..ctor : Program.cs(53) */ MT3620Blink_Timer__ctor((MT3620Blink_Timer*)frame__.stack0_0__); - /* IL_0006: ldarg.0 : Program.cs(57) */ + /* IL_0006: nop : Program.cs(53) */ + /* IL_0007: nop */ + /* IL_0008: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0007: ldarg.1 : Program.cs(57) */ + /* IL_0009: ldarg.1 : Program.cs(57) */ stack1_0__ = changeInputGpioId; - /* IL_0008: newobj MT3620Blink.GpioInput..ctor : Program.cs(57) */ + /* IL_000a: newobj MT3620Blink.GpioInput..ctor : Program.cs(57) */ frame__.stack1_1__ = il2c_get_uninitialized_object(MT3620Blink_GpioInput); MT3620Blink_GpioInput__ctor(frame__.stack1_1__, stack1_0__); - /* IL_000d: stfld MT3620Blink.Program.GpioPoller.changeInput : Program.cs(57) */ + /* IL_000f: stfld MT3620Blink.Program.GpioPoller.changeInput : Program.cs(57) */ frame__.stack0_0__->changeInput = frame__.stack1_1__; - /* IL_0012: ldarg.0 : Program.cs(58) */ + /* IL_0014: ldarg.0 : Program.cs(58) */ frame__.stack0_0__ = this__; - /* IL_0013: ldarg.0 : Program.cs(58) */ + /* IL_0015: ldarg.0 : Program.cs(58) */ frame__.stack1_2__ = this__; - /* IL_0014: ldfld MT3620Blink.Program.GpioPoller.changeInput : Program.cs(58) */ + /* IL_0016: ldfld MT3620Blink.Program.GpioPoller.changeInput : Program.cs(58) */ frame__.stack1_1__ = frame__.stack1_2__->changeInput; - /* IL_0019: callvirt MT3620Blink.GpioInput.get_Value : Program.cs(58) */ + /* IL_001b: callvirt MT3620Blink.GpioInput.get_Value : Program.cs(58) */ stack1_3__ = MT3620Blink_GpioInput_get_Value(frame__.stack1_1__); - /* IL_001e: stfld MT3620Blink.Program.GpioPoller.lastChangeInput : Program.cs(58) */ + /* IL_0020: stfld MT3620Blink.Program.GpioPoller.lastChangeInput : Program.cs(58) */ frame__.stack0_0__->lastChangeInput = stack1_3__; - /* IL_0023: ldarg.0 : Program.cs(60) */ + /* IL_0025: ldarg.0 : Program.cs(60) */ frame__.stack0_0__ = this__; - /* IL_0024: ldarg.2 : Program.cs(60) */ + /* IL_0026: ldarg.2 : Program.cs(60) */ stack1_0__ = exitInputGpioId; - /* IL_0025: newobj MT3620Blink.GpioInput..ctor : Program.cs(60) */ + /* IL_0027: newobj MT3620Blink.GpioInput..ctor : Program.cs(60) */ frame__.stack1_1__ = il2c_get_uninitialized_object(MT3620Blink_GpioInput); MT3620Blink_GpioInput__ctor(frame__.stack1_1__, stack1_0__); - /* IL_002a: stfld MT3620Blink.Program.GpioPoller.exitInput : Program.cs(60) */ + /* IL_002c: stfld MT3620Blink.Program.GpioPoller.exitInput : Program.cs(60) */ frame__.stack0_0__->exitInput = frame__.stack1_1__; - /* IL_002f: ldarg.0 : Program.cs(61) */ + /* IL_0031: ldarg.0 : Program.cs(61) */ frame__.stack0_0__ = this__; - /* IL_0030: ldarg.0 : Program.cs(61) */ + /* IL_0032: ldarg.0 : Program.cs(61) */ frame__.stack1_2__ = this__; - /* IL_0031: ldfld MT3620Blink.Program.GpioPoller.exitInput : Program.cs(61) */ + /* IL_0033: ldfld MT3620Blink.Program.GpioPoller.exitInput : Program.cs(61) */ frame__.stack1_1__ = frame__.stack1_2__->exitInput; - /* IL_0036: callvirt MT3620Blink.GpioInput.get_Value : Program.cs(61) */ + /* IL_0038: callvirt MT3620Blink.GpioInput.get_Value : Program.cs(61) */ stack1_3__ = MT3620Blink_GpioInput_get_Value(frame__.stack1_1__); - /* IL_003b: stfld MT3620Blink.Program.GpioPoller.lastExitInput : Program.cs(61) */ + /* IL_003d: stfld MT3620Blink.Program.GpioPoller.lastExitInput : Program.cs(61) */ frame__.stack0_0__->lastExitInput = stack1_3__; - /* IL_0040: ldarg.0 : Program.cs(63) */ + /* IL_0042: ldarg.0 : Program.cs(63) */ frame__.stack0_0__ = this__; - /* IL_0041: ldarg.3 : Program.cs(63) */ + /* IL_0043: ldarg.3 : Program.cs(63) */ frame__.stack1_4__ = blinker; - /* IL_0042: stfld MT3620Blink.Program.GpioPoller.blinker : Program.cs(63) */ + /* IL_0044: stfld MT3620Blink.Program.GpioPoller.blinker : Program.cs(63) */ frame__.stack0_0__->blinker = frame__.stack1_4__; - /* IL_0047: ldarg.0 : Program.cs(64) */ + /* IL_0049: ldarg.0 : Program.cs(64) */ frame__.stack0_0__ = this__; - /* IL_0048: ldarg.s app : Program.cs(64) */ + /* IL_004a: ldarg.s app : Program.cs(64) */ frame__.stack1_5__ = app; - /* IL_004a: stfld MT3620Blink.Program.GpioPoller.app : Program.cs(64) */ + /* IL_004c: stfld MT3620Blink.Program.GpioPoller.app : Program.cs(64) */ frame__.stack0_0__->app = frame__.stack1_5__; - /* IL_004f: ldarg.0 : Program.cs(65) */ + /* IL_0051: ldarg.0 : Program.cs(65) */ frame__.stack0_0__ = this__; - /* IL_0050: ldc.i4 100000000 : Program.cs(65) */ + /* IL_0052: ldc.i4 100000000 : Program.cs(65) */ stack1_0__ = 100000000; - /* IL_0055: conv.i8 : Program.cs(65) */ + /* IL_0057: conv.i8 : Program.cs(65) */ stack1_6__ = (int64_t)stack1_0__; - /* IL_0056: call MT3620Blink.Timer.SetInterval : Program.cs(65) */ + /* IL_0058: call MT3620Blink.Timer.SetInterval : Program.cs(65) */ MT3620Blink_Timer_SetInterval((MT3620Blink_Timer*)frame__.stack0_0__, stack1_6__); - /* IL_005b: ret : Program.cs(66) */ + /* IL_005d: nop : Program.cs(65) */ + /* IL_005e: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -503,23 +518,27 @@ void MT3620Blink_Program_GpioPoller_Dispose(MT3620Blink_Program_GpioPoller* this //------------------- // [3-6] IL body: - /* IL_0000: ldarg.0 : Program.cs(70) */ + /* IL_0000: nop : Program.cs(69) */ + /* IL_0001: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0001: call MT3620Blink.Descriptor.Dispose : Program.cs(70) */ + /* IL_0002: call MT3620Blink.Descriptor.Dispose : Program.cs(70) */ MT3620Blink_Descriptor_Dispose((MT3620Blink_Descriptor*)frame__.stack0_0__); - /* IL_0006: ldarg.0 : Program.cs(71) */ + /* IL_0007: nop : Program.cs(70) */ + /* IL_0008: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0007: ldfld MT3620Blink.Program.GpioPoller.changeInput : Program.cs(71) */ + /* IL_0009: ldfld MT3620Blink.Program.GpioPoller.changeInput : Program.cs(71) */ frame__.stack0_1__ = frame__.stack0_0__->changeInput; - /* IL_000c: callvirt MT3620Blink.Descriptor.Dispose : Program.cs(71) */ + /* IL_000e: callvirt MT3620Blink.Descriptor.Dispose : Program.cs(71) */ frame__.stack0_1__->vptr0__->Dispose((MT3620Blink_Descriptor*)frame__.stack0_1__); - /* IL_0011: ldarg.0 : Program.cs(72) */ + /* IL_0013: nop : Program.cs(71) */ + /* IL_0014: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0012: ldfld MT3620Blink.Program.GpioPoller.exitInput : Program.cs(72) */ + /* IL_0015: ldfld MT3620Blink.Program.GpioPoller.exitInput : Program.cs(72) */ frame__.stack0_1__ = frame__.stack0_0__->exitInput; - /* IL_0017: callvirt MT3620Blink.Descriptor.Dispose : Program.cs(72) */ + /* IL_001a: callvirt MT3620Blink.Descriptor.Dispose : Program.cs(72) */ frame__.stack0_1__->vptr0__->Dispose((MT3620Blink_Descriptor*)frame__.stack0_1__); - /* IL_001c: ret : Program.cs(73) */ + /* IL_001f: nop : Program.cs(72) */ + /* IL_0020: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -538,8 +557,8 @@ typedef struct MT3620Blink_Program_GpioPoller_Raised_EXECUTION_FRAME_DECL //-------------------- objref MT3620Blink_Program_GpioPoller* stack0_0__; MT3620Blink_GpioInput* stack0_1__; - MT3620Blink_Program_GpioBlinker* stack0_3__; - MT3620Blink_Application* stack0_4__; + MT3620Blink_Program_GpioBlinker* stack0_4__; + MT3620Blink_Application* stack0_5__; MT3620Blink_Program_GpioPoller* stack1_0__; } MT3620Blink_Program_GpioPoller_Raised_EXECUTION_FRAME__; @@ -554,12 +573,18 @@ void MT3620Blink_Program_GpioPoller_Raised(MT3620Blink_Program_GpioPoller* this_ // [3-3] Local variables (!objref): bool current = false; + bool local1__ = false; + bool local2__ = false; + bool local3__ = false; + bool local4__ = false; //------------------- // [3-4] Evaluation stacks (!objref): bool stack0_2__; + int32_t stack0_3__; bool stack1_1__; + int32_t stack1_2__; //------------------- // [3-5] Setup execution frame: @@ -571,73 +596,122 @@ void MT3620Blink_Program_GpioPoller_Raised(MT3620Blink_Program_GpioPoller* this_ //------------------- // [3-6] IL body: - /* IL_0000: ldarg.0 : Program.cs(77) */ + /* IL_0000: nop : Program.cs(76) */ + /* IL_0001: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0001: ldfld MT3620Blink.Program.GpioPoller.changeInput : Program.cs(77) */ + /* IL_0002: ldfld MT3620Blink.Program.GpioPoller.changeInput : Program.cs(77) */ frame__.stack0_1__ = frame__.stack0_0__->changeInput; - /* IL_0006: callvirt MT3620Blink.GpioInput.get_Value : Program.cs(77) */ + /* IL_0007: callvirt MT3620Blink.GpioInput.get_Value : Program.cs(77) */ stack0_2__ = MT3620Blink_GpioInput_get_Value(frame__.stack0_1__); - /* IL_000b: stloc.0 : Program.cs(77) */ + /* IL_000c: stloc.0 : Program.cs(77) */ current = stack0_2__; - /* IL_000c: ldloc.0 : Program.cs(78) */ + /* IL_000d: ldloc.0 : Program.cs(78) */ stack0_2__ = current; - /* IL_000d: ldarg.0 : Program.cs(78) */ + /* IL_000e: ldarg.0 : Program.cs(78) */ frame__.stack1_0__ = this__; - /* IL_000e: ldfld MT3620Blink.Program.GpioPoller.lastChangeInput : Program.cs(78) */ + /* IL_000f: ldfld MT3620Blink.Program.GpioPoller.lastChangeInput : Program.cs(78) */ stack1_1__ = frame__.stack1_0__->lastChangeInput; - /* IL_0013: beq.s IL_0023 : Program.cs(78) */ - if (stack0_2__ == stack1_1__) goto IL_0023; - /* IL_0015: ldloc.0 : Program.cs(80) */ + /* IL_0014: ceq : Program.cs(78) */ + stack0_3__ = (int32_t)stack0_2__ == (int32_t)stack1_1__; + /* IL_0016: ldc.i4.0 : Program.cs(78) */ + stack1_2__ = 0; + /* IL_0017: ceq : Program.cs(78) */ + stack0_3__ = (int32_t)stack0_3__ == (int32_t)stack1_2__; + /* IL_0019: stloc.1 : Program.cs(78) */ + local1__ = (bool)stack0_3__; + /* IL_001a: ldloc.1 : Program.cs(78) */ + stack0_2__ = local1__; + /* IL_001b: brfalse.s IL_0035 : Program.cs(78) */ + if (stack0_2__ == false) goto IL_0035; + /* IL_001d: nop : Program.cs(79) */ + /* IL_001e: ldloc.0 */ stack0_2__ = current; - /* IL_0016: brtrue.s IL_0023 : Program.cs(80) */ - if (stack0_2__ != false) goto IL_0023; - /* IL_0018: ldarg.0 : Program.cs(82) */ + /* IL_001f: ldc.i4.0 : Program.cs(80) */ + stack1_2__ = 0; + /* IL_0020: ceq : Program.cs(80) */ + stack0_3__ = (int32_t)stack0_2__ == (int32_t)stack1_2__; + /* IL_0022: stloc.2 : Program.cs(80) */ + local2__ = (bool)stack0_3__; + /* IL_0023: ldloc.2 : Program.cs(80) */ + stack0_2__ = local2__; + /* IL_0024: brfalse.s IL_0034 : Program.cs(80) */ + if (stack0_2__ == false) goto IL_0034; + /* IL_0026: nop : Program.cs(81) */ + /* IL_0027: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0019: ldfld MT3620Blink.Program.GpioPoller.blinker : Program.cs(82) */ - frame__.stack0_3__ = frame__.stack0_0__->blinker; - /* IL_001e: callvirt MT3620Blink.Program.GpioBlinker.NextInterval : Program.cs(82) */ - MT3620Blink_Program_GpioBlinker_NextInterval(frame__.stack0_3__); -IL_0023: - /* IL_0023: ldarg.0 : Program.cs(85) */ + /* IL_0028: ldfld MT3620Blink.Program.GpioPoller.blinker : Program.cs(82) */ + frame__.stack0_4__ = frame__.stack0_0__->blinker; + /* IL_002d: callvirt MT3620Blink.Program.GpioBlinker.NextInterval : Program.cs(82) */ + MT3620Blink_Program_GpioBlinker_NextInterval(frame__.stack0_4__); + /* IL_0032: nop : Program.cs(82) */ + /* IL_0033: nop */ +IL_0034: + /* IL_0034: nop */ +IL_0035: + /* IL_0035: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0024: ldloc.0 : Program.cs(85) */ + /* IL_0036: ldloc.0 : Program.cs(85) */ stack1_1__ = current; - /* IL_0025: stfld MT3620Blink.Program.GpioPoller.lastChangeInput : Program.cs(85) */ + /* IL_0037: stfld MT3620Blink.Program.GpioPoller.lastChangeInput : Program.cs(85) */ frame__.stack0_0__->lastChangeInput = stack1_1__; - /* IL_002a: ldarg.0 : Program.cs(87) */ + /* IL_003c: ldarg.0 : Program.cs(87) */ frame__.stack0_0__ = this__; - /* IL_002b: ldfld MT3620Blink.Program.GpioPoller.exitInput : Program.cs(87) */ + /* IL_003d: ldfld MT3620Blink.Program.GpioPoller.exitInput : Program.cs(87) */ frame__.stack0_1__ = frame__.stack0_0__->exitInput; - /* IL_0030: callvirt MT3620Blink.GpioInput.get_Value : Program.cs(87) */ + /* IL_0042: callvirt MT3620Blink.GpioInput.get_Value : Program.cs(87) */ stack0_2__ = MT3620Blink_GpioInput_get_Value(frame__.stack0_1__); - /* IL_0035: stloc.0 : Program.cs(87) */ + /* IL_0047: stloc.0 : Program.cs(87) */ current = stack0_2__; - /* IL_0036: ldloc.0 : Program.cs(88) */ + /* IL_0048: ldloc.0 : Program.cs(88) */ stack0_2__ = current; - /* IL_0037: ldarg.0 : Program.cs(88) */ + /* IL_0049: ldarg.0 : Program.cs(88) */ frame__.stack1_0__ = this__; - /* IL_0038: ldfld MT3620Blink.Program.GpioPoller.lastExitInput : Program.cs(88) */ + /* IL_004a: ldfld MT3620Blink.Program.GpioPoller.lastExitInput : Program.cs(88) */ stack1_1__ = frame__.stack1_0__->lastExitInput; - /* IL_003d: beq.s IL_004d : Program.cs(88) */ - if (stack0_2__ == stack1_1__) goto IL_004d; - /* IL_003f: ldloc.0 : Program.cs(90) */ + /* IL_004f: ceq : Program.cs(88) */ + stack0_3__ = (int32_t)stack0_2__ == (int32_t)stack1_1__; + /* IL_0051: ldc.i4.0 : Program.cs(88) */ + stack1_2__ = 0; + /* IL_0052: ceq : Program.cs(88) */ + stack0_3__ = (int32_t)stack0_3__ == (int32_t)stack1_2__; + /* IL_0054: stloc.3 : Program.cs(88) */ + local3__ = (bool)stack0_3__; + /* IL_0055: ldloc.3 : Program.cs(88) */ + stack0_2__ = local3__; + /* IL_0056: brfalse.s IL_0072 : Program.cs(88) */ + if (stack0_2__ == false) goto IL_0072; + /* IL_0058: nop : Program.cs(89) */ + /* IL_0059: ldloc.0 */ stack0_2__ = current; - /* IL_0040: brtrue.s IL_004d : Program.cs(90) */ - if (stack0_2__ != false) goto IL_004d; - /* IL_0042: ldarg.0 : Program.cs(92) */ + /* IL_005a: ldc.i4.0 : Program.cs(90) */ + stack1_2__ = 0; + /* IL_005b: ceq : Program.cs(90) */ + stack0_3__ = (int32_t)stack0_2__ == (int32_t)stack1_2__; + /* IL_005d: stloc.s local4__ : Program.cs(90) */ + local4__ = (bool)stack0_3__; + /* IL_005f: ldloc.s local4__ : Program.cs(90) */ + stack0_2__ = local4__; + /* IL_0061: brfalse.s IL_0071 : Program.cs(90) */ + if (stack0_2__ == false) goto IL_0071; + /* IL_0063: nop : Program.cs(91) */ + /* IL_0064: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0043: ldfld MT3620Blink.Program.GpioPoller.app : Program.cs(92) */ - frame__.stack0_4__ = frame__.stack0_0__->app; - /* IL_0048: callvirt MT3620Blink.Application.Abort : Program.cs(92) */ - MT3620Blink_Application_Abort(frame__.stack0_4__); -IL_004d: - /* IL_004d: ldarg.0 : Program.cs(95) */ + /* IL_0065: ldfld MT3620Blink.Program.GpioPoller.app : Program.cs(92) */ + frame__.stack0_5__ = frame__.stack0_0__->app; + /* IL_006a: callvirt MT3620Blink.Application.Abort : Program.cs(92) */ + MT3620Blink_Application_Abort(frame__.stack0_5__); + /* IL_006f: nop : Program.cs(92) */ + /* IL_0070: nop */ +IL_0071: + /* IL_0071: nop */ +IL_0072: + /* IL_0072: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_004e: ldloc.0 : Program.cs(95) */ + /* IL_0073: ldloc.0 : Program.cs(95) */ stack1_1__ = current; - /* IL_004f: stfld MT3620Blink.Program.GpioPoller.lastExitInput : Program.cs(95) */ + /* IL_0074: stfld MT3620Blink.Program.GpioPoller.lastExitInput : Program.cs(95) */ frame__.stack0_0__->lastExitInput = stack1_1__; - /* IL_0054: ret : Program.cs(96) */ + /* IL_0079: ret : Program.cs(96) */ il2c_unlink_execution_frame(&frame__); return; } @@ -738,6 +812,11 @@ typedef struct MT3620Blink_Program_Main_EXECUTION_FRAME_DECL int32_t MT3620Blink_Program_Main(void) { + //------------------- + // [3-3] Local variables (!objref): + + volatile int32_t local3__ = 0; + //------------------- // [3-4] Evaluation stacks (!objref): @@ -754,119 +833,148 @@ int32_t MT3620Blink_Program_Main(void) //------------------- // [3-6] IL body: - /* IL_0000: newobj MT3620Blink.Application..ctor : Program.cs(101) */ + /* IL_0000: nop : Program.cs(100) */ + /* IL_0001: newobj MT3620Blink.Application..ctor */ frame__.stack0_0__ = il2c_get_uninitialized_object(MT3620Blink_Application); MT3620Blink_Application__ctor(frame__.stack0_0__); - /* IL_0005: stloc.0 : Program.cs(101) */ + /* IL_0006: stloc.0 : Program.cs(101) */ frame__.app = frame__.stack0_0__; il2c_try(nest0, MT3620Blink_Program_Main_ExceptionFilter0__) { - /* IL_0006: ldsfld MT3620Blink.Interops.MT3620_RDB_LED1_RED : Program.cs(103) */ + /* IL_0007: nop : Program.cs(102) */ + /* IL_0008: ldsfld MT3620Blink.Interops.MT3620_RDB_LED1_RED */ stack0_1__ = MT3620Blink_Interops_MT3620_RDB_LED1_RED; - /* IL_000b: newobj MT3620Blink.Program.GpioBlinker..ctor : Program.cs(103) */ + /* IL_000d: newobj MT3620Blink.Program.GpioBlinker..ctor : Program.cs(103) */ frame__.stack0_2__ = il2c_get_uninitialized_object(MT3620Blink_Program_GpioBlinker); MT3620Blink_Program_GpioBlinker__ctor(frame__.stack0_2__, stack0_1__); - /* IL_0010: stloc.1 : Program.cs(103) */ + /* IL_0012: stloc.1 : Program.cs(103) */ frame__.ledBlinker = frame__.stack0_2__; il2c_try(nest1, MT3620Blink_Program_Main_ExceptionFilter1__) { - /* IL_0011: ldsfld MT3620Blink.Interops.MT3620_RDB_BUTTON_A : Program.cs(105) */ + /* IL_0013: nop : Program.cs(104) */ + /* IL_0014: ldsfld MT3620Blink.Interops.MT3620_RDB_BUTTON_A */ stack0_1__ = MT3620Blink_Interops_MT3620_RDB_BUTTON_A; - /* IL_0016: ldsfld MT3620Blink.Interops.MT3620_RDB_BUTTON_B : Program.cs(105) */ + /* IL_0019: ldsfld MT3620Blink.Interops.MT3620_RDB_BUTTON_B : Program.cs(105) */ stack1_0__ = MT3620Blink_Interops_MT3620_RDB_BUTTON_B; - /* IL_001b: ldloc.1 : Program.cs(105) */ + /* IL_001e: ldloc.1 : Program.cs(105) */ frame__.stack2_0__ = frame__.ledBlinker; - /* IL_001c: ldloc.0 : Program.cs(105) */ + /* IL_001f: ldloc.0 : Program.cs(105) */ frame__.stack3_0__ = frame__.app; - /* IL_001d: newobj MT3620Blink.Program.GpioPoller..ctor : Program.cs(105) */ + /* IL_0020: newobj MT3620Blink.Program.GpioPoller..ctor : Program.cs(105) */ frame__.stack0_3__ = il2c_get_uninitialized_object(MT3620Blink_Program_GpioPoller); MT3620Blink_Program_GpioPoller__ctor(frame__.stack0_3__, stack0_1__, stack1_0__, frame__.stack2_0__, frame__.stack3_0__); - /* IL_0022: stloc.2 : Program.cs(105) */ + /* IL_0025: stloc.2 : Program.cs(105) */ frame__.buttonPoller = frame__.stack0_3__; il2c_try(nest2, MT3620Blink_Program_Main_ExceptionFilter2__) { - /* IL_0023: ldloc.0 : Program.cs(111) */ + /* IL_0026: nop : Program.cs(110) */ + /* IL_0027: ldloc.0 */ frame__.stack0_0__ = frame__.app; - /* IL_0024: ldloc.1 : Program.cs(111) */ + /* IL_0028: ldloc.1 : Program.cs(111) */ frame__.stack1_1__ = frame__.ledBlinker; - /* IL_0025: callvirt MT3620Blink.Application.RegisterDescriptor : Program.cs(111) */ + /* IL_0029: callvirt MT3620Blink.Application.RegisterDescriptor : Program.cs(111) */ MT3620Blink_Application_RegisterDescriptor(frame__.stack0_0__, il2c_cast_to_interface(MT3620Blink_IEPollListener, MT3620Blink_Program_GpioBlinker, frame__.stack1_1__)); - /* IL_002a: ldloc.0 : Program.cs(112) */ + /* IL_002e: nop : Program.cs(111) */ + /* IL_002f: ldloc.0 */ frame__.stack0_0__ = frame__.app; - /* IL_002b: ldloc.2 : Program.cs(112) */ + /* IL_0030: ldloc.2 : Program.cs(112) */ frame__.stack1_2__ = frame__.buttonPoller; - /* IL_002c: callvirt MT3620Blink.Application.RegisterDescriptor : Program.cs(112) */ + /* IL_0031: callvirt MT3620Blink.Application.RegisterDescriptor : Program.cs(112) */ MT3620Blink_Application_RegisterDescriptor(frame__.stack0_0__, il2c_cast_to_interface(MT3620Blink_IEPollListener, MT3620Blink_Program_GpioPoller, frame__.stack1_2__)); - /* IL_0031: ldloc.0 : Program.cs(114) */ + /* IL_0036: nop : Program.cs(112) */ + /* IL_0037: ldloc.0 */ frame__.stack0_0__ = frame__.app; - /* IL_0032: callvirt MT3620Blink.Application.Run : Program.cs(114) */ + /* IL_0038: callvirt MT3620Blink.Application.Run : Program.cs(114) */ MT3620Blink_Application_Run(frame__.stack0_0__); - /* IL_0037: leave.s IL_0057 : Program.cs(115) */ + /* IL_003d: nop : Program.cs(114) */ + /* IL_003e: nop */ + /* IL_003f: leave.s IL_004c */ il2c_leave(nest2, 0); } il2c_finally(nest2) { - /* IL_0039: ldloc.2 : Program.cs(115) */ + /* IL_0041: ldloc.2 : Program.cs(115) */ frame__.stack0_3__ = frame__.buttonPoller; - /* IL_003a: brfalse.s IL_0042 : Program.cs(115) */ - if (frame__.stack0_3__ == NULL) goto IL_0042; - /* IL_003c: ldloc.2 : Program.cs(115) */ + /* IL_0042: brfalse.s IL_004b : Program.cs(115) */ + if (frame__.stack0_3__ == NULL) goto IL_004b; + /* IL_0044: ldloc.2 : Program.cs(115) */ frame__.stack0_3__ = frame__.buttonPoller; - /* IL_003d: callvirt System.IDisposable.Dispose : Program.cs(115) */ + /* IL_0045: callvirt System.IDisposable.Dispose : Program.cs(115) */ MT3620Blink_Program_GpioPoller_Dispose(il2c_adjusted_reference(frame__.stack0_3__)); - IL_0042: - /* IL_0042: endfinally : Program.cs(115) */ + /* IL_004a: nop : Program.cs(115) */ + IL_004b: + /* IL_004b: endfinally */ il2c_endfinally(nest2); } il2c_leave_to(nest2) { - il2c_leave_through(nest2, 0, nest1); + il2c_leave_bind(nest2, 0, IL_004c); } il2c_end_try(nest2); + IL_004c: + /* IL_004c: nop : Program.cs(116) */ + /* IL_004d: leave.s IL_005a */ + il2c_leave(nest1, 1); } il2c_finally(nest1) { - /* IL_0043: ldloc.1 : Program.cs(115) */ + /* IL_004f: ldloc.1 : Program.cs(116) */ frame__.stack0_2__ = frame__.ledBlinker; - /* IL_0044: brfalse.s IL_004c : Program.cs(115) */ - if (frame__.stack0_2__ == NULL) goto IL_004c; - /* IL_0046: ldloc.1 : Program.cs(115) */ + /* IL_0050: brfalse.s IL_0059 : Program.cs(116) */ + if (frame__.stack0_2__ == NULL) goto IL_0059; + /* IL_0052: ldloc.1 : Program.cs(116) */ frame__.stack0_2__ = frame__.ledBlinker; - /* IL_0047: callvirt System.IDisposable.Dispose : Program.cs(115) */ + /* IL_0053: callvirt System.IDisposable.Dispose : Program.cs(116) */ MT3620Blink_Program_GpioBlinker_Dispose(il2c_adjusted_reference(frame__.stack0_2__)); - IL_004c: - /* IL_004c: endfinally : Program.cs(115) */ + /* IL_0058: nop : Program.cs(116) */ + IL_0059: + /* IL_0059: endfinally */ il2c_endfinally(nest1); } il2c_leave_to(nest1) { - il2c_leave_through(nest1, 0, nest0); + il2c_leave_bind(nest1, 0, IL_004c); + il2c_leave_bind(nest1, 1, IL_005a); } il2c_end_try(nest1); + IL_005a: + /* IL_005a: nop : Program.cs(117) */ + /* IL_005b: leave.s IL_0068 */ + il2c_leave(nest0, 2); } il2c_finally(nest0) { - /* IL_004d: ldloc.0 : Program.cs(115) */ + /* IL_005d: ldloc.0 : Program.cs(117) */ frame__.stack0_0__ = frame__.app; - /* IL_004e: brfalse.s IL_0056 : Program.cs(115) */ - if (frame__.stack0_0__ == NULL) goto IL_0056; - /* IL_0050: ldloc.0 : Program.cs(115) */ + /* IL_005e: brfalse.s IL_0067 : Program.cs(117) */ + if (frame__.stack0_0__ == NULL) goto IL_0067; + /* IL_0060: ldloc.0 : Program.cs(117) */ frame__.stack0_0__ = frame__.app; - /* IL_0051: callvirt System.IDisposable.Dispose : Program.cs(115) */ + /* IL_0061: callvirt System.IDisposable.Dispose : Program.cs(117) */ MT3620Blink_Application_Dispose(il2c_adjusted_reference(frame__.stack0_0__)); - IL_0056: - /* IL_0056: endfinally : Program.cs(115) */ + /* IL_0066: nop : Program.cs(117) */ + IL_0067: + /* IL_0067: endfinally */ il2c_endfinally(nest0); } il2c_leave_to(nest0) { - il2c_leave_bind(nest0, 0, IL_0057); + il2c_leave_bind(nest0, 0, IL_004c); + il2c_leave_bind(nest0, 1, IL_005a); + il2c_leave_bind(nest0, 2, IL_0068); } il2c_end_try(nest0); -IL_0057: - /* IL_0057: ldc.i4.0 : Program.cs(119) */ +IL_0068: + /* IL_0068: ldc.i4.0 : Program.cs(119) */ stack0_1__ = 0; - /* IL_0058: ret : Program.cs(119) */ + /* IL_0069: stloc.3 : Program.cs(119) */ + local3__ = stack0_1__; + /* IL_006a: br.s IL_006c : Program.cs(119) */ + goto IL_006c; +IL_006c: + /* IL_006c: ldloc.3 : Program.cs(120) */ + stack0_1__ = local3__; + /* IL_006d: ret : Program.cs(120) */ il2c_unlink_execution_frame(&frame__); return stack0_1__; } diff --git a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Timer.c b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Timer.c index 212e84e4..6d5bd0dd 100644 --- a/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Timer.c +++ b/samples/AzureSphere/Mt3620App/src/MT3620Blink/MT3620Blink/Timer.c @@ -73,7 +73,9 @@ void MT3620Blink_Timer__ctor(MT3620Blink_Timer* this__) stack1_0__ = MT3620Blink_Interops_timerfd_create(stack1_0__, stack2_0__); /* IL_0010: call MT3620Blink.Descriptor..ctor : Timer.cs(14) */ MT3620Blink_Descriptor__ctor((MT3620Blink_Descriptor*)frame__.stack0_0__, stack1_0__); - /* IL_0015: ret : Timer.cs(16) */ + /* IL_0015: nop : Timer.cs(14) */ + /* IL_0016: nop */ + /* IL_0017: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -140,76 +142,77 @@ void MT3620Blink_Timer_SetInterval(MT3620Blink_Timer* this__, int64_t nsec) //------------------- // [3-6] IL body: - /* IL_0000: ldloca.s local3__ : Timer.cs(20) */ + /* IL_0000: nop : Timer.cs(19) */ + /* IL_0001: ldloca.s local3__ */ stack0_0__ = &local3__; - /* IL_0002: initobj MT3620Blink.timespec : Timer.cs(20) */ + /* IL_0003: initobj MT3620Blink.timespec : Timer.cs(20) */ memset(stack0_0__, 0x00, sizeof *stack0_0__); - /* IL_0008: ldloca.s local3__ : Timer.cs(20) */ + /* IL_0009: ldloca.s local3__ : Timer.cs(20) */ stack0_0__ = &local3__; - /* IL_000a: ldarg.1 : Timer.cs(20) */ + /* IL_000b: ldarg.1 : Timer.cs(20) */ stack1_0__ = nsec; - /* IL_000b: ldc.i4 1000000000 : Timer.cs(20) */ + /* IL_000c: ldc.i4 1000000000 : Timer.cs(20) */ stack2_0__ = 1000000000; - /* IL_0010: conv.i8 : Timer.cs(20) */ + /* IL_0011: conv.i8 : Timer.cs(20) */ stack2_1__ = (int64_t)stack2_0__; - /* IL_0011: div : Timer.cs(20) */ + /* IL_0012: div : Timer.cs(20) */ stack1_0__ = stack1_0__ / stack2_1__; - /* IL_0012: conv.i4 : Timer.cs(20) */ + /* IL_0013: conv.i4 : Timer.cs(20) */ stack1_1__ = (int32_t)stack1_0__; - /* IL_0013: stfld MT3620Blink.timespec.tv_sec : Timer.cs(20) */ + /* IL_0014: stfld MT3620Blink.timespec.tv_sec : Timer.cs(20) */ stack0_0__->tv_sec = stack1_1__; - /* IL_0018: ldloca.s local3__ : Timer.cs(20) */ + /* IL_0019: ldloca.s local3__ : Timer.cs(20) */ stack0_0__ = &local3__; - /* IL_001a: ldarg.1 : Timer.cs(20) */ + /* IL_001b: ldarg.1 : Timer.cs(20) */ stack1_0__ = nsec; - /* IL_001b: ldc.i4 1000000000 : Timer.cs(20) */ + /* IL_001c: ldc.i4 1000000000 : Timer.cs(20) */ stack2_0__ = 1000000000; - /* IL_0020: conv.i8 : Timer.cs(20) */ + /* IL_0021: conv.i8 : Timer.cs(20) */ stack2_1__ = (int64_t)stack2_0__; - /* IL_0021: rem : Timer.cs(20) */ + /* IL_0022: rem : Timer.cs(20) */ stack1_0__ = stack1_0__ % stack2_1__; - /* IL_0022: conv.i4 : Timer.cs(20) */ + /* IL_0023: conv.i4 : Timer.cs(20) */ stack1_1__ = (int32_t)stack1_0__; - /* IL_0023: stfld MT3620Blink.timespec.tv_nsec : Timer.cs(20) */ + /* IL_0024: stfld MT3620Blink.timespec.tv_nsec : Timer.cs(20) */ stack0_0__->tv_nsec = stack1_1__; - /* IL_0028: ldloc.3 : Timer.cs(20) */ + /* IL_0029: ldloc.3 : Timer.cs(20) */ stack0_1__ = local3__; - /* IL_0029: stloc.0 : Timer.cs(20) */ + /* IL_002a: stloc.0 : Timer.cs(20) */ tm = stack0_1__; - /* IL_002a: ldloca.s local4__ : Timer.cs(25) */ + /* IL_002b: ldloca.s local4__ : Timer.cs(25) */ stack0_2__ = &local4__; - /* IL_002c: initobj MT3620Blink.itimerspec : Timer.cs(25) */ + /* IL_002d: initobj MT3620Blink.itimerspec : Timer.cs(25) */ memset(stack0_2__, 0x00, sizeof *stack0_2__); - /* IL_0032: ldloca.s local4__ : Timer.cs(25) */ + /* IL_0033: ldloca.s local4__ : Timer.cs(25) */ stack0_2__ = &local4__; - /* IL_0034: ldloc.0 : Timer.cs(25) */ + /* IL_0035: ldloc.0 : Timer.cs(25) */ stack1_2__ = tm; - /* IL_0035: stfld MT3620Blink.itimerspec.it_value : Timer.cs(25) */ + /* IL_0036: stfld MT3620Blink.itimerspec.it_value : Timer.cs(25) */ stack0_2__->it_value = stack1_2__; - /* IL_003a: ldloca.s local4__ : Timer.cs(25) */ + /* IL_003b: ldloca.s local4__ : Timer.cs(25) */ stack0_2__ = &local4__; - /* IL_003c: ldloc.0 : Timer.cs(25) */ + /* IL_003d: ldloc.0 : Timer.cs(25) */ stack1_2__ = tm; - /* IL_003d: stfld MT3620Blink.itimerspec.it_interval : Timer.cs(25) */ + /* IL_003e: stfld MT3620Blink.itimerspec.it_interval : Timer.cs(25) */ stack0_2__->it_interval = stack1_2__; - /* IL_0042: ldloc.s local4__ : Timer.cs(25) */ + /* IL_0043: ldloc.s local4__ : Timer.cs(25) */ stack0_3__ = local4__; - /* IL_0044: stloc.1 : Timer.cs(25) */ + /* IL_0045: stloc.1 : Timer.cs(25) */ newValue = stack0_3__; - /* IL_0045: ldarg.0 : Timer.cs(31) */ + /* IL_0046: ldarg.0 : Timer.cs(31) */ frame__.stack0_4__ = this__; - /* IL_0046: call MT3620Blink.Descriptor.get_Identity : Timer.cs(31) */ + /* IL_0047: call MT3620Blink.Descriptor.get_Identity : Timer.cs(31) */ stack0_5__ = MT3620Blink_Descriptor_get_Identity((MT3620Blink_Descriptor*)frame__.stack0_4__); - /* IL_004b: ldc.i4.0 : Timer.cs(31) */ + /* IL_004c: ldc.i4.0 : Timer.cs(31) */ stack1_1__ = 0; - /* IL_004c: ldloca.s newValue : Timer.cs(31) */ + /* IL_004d: ldloca.s newValue : Timer.cs(31) */ stack2_2__ = &newValue; - /* IL_004e: ldloca.s dummy : Timer.cs(31) */ + /* IL_004f: ldloca.s dummy : Timer.cs(31) */ stack3_0__ = &dummy; - /* IL_0050: call MT3620Blink.Interops.timerfd_settime : Timer.cs(31) */ + /* IL_0051: call MT3620Blink.Interops.timerfd_settime : Timer.cs(31) */ stack0_5__ = MT3620Blink_Interops_timerfd_settime(stack0_5__, stack1_1__, stack2_2__, stack3_0__); - /* IL_0055: pop : Timer.cs(31) */ - /* IL_0056: ret */ + /* IL_0056: pop : Timer.cs(31) */ + /* IL_0057: ret */ il2c_unlink_execution_frame(&frame__); return; } @@ -306,26 +309,28 @@ void MT3620Blink_Timer_MT3620Blink_IEPollListener_OnRaised(MT3620Blink_Timer* th //------------------- // [3-6] IL body: - /* IL_0000: ldarg.0 : Timer.cs(38) */ + /* IL_0000: nop : Timer.cs(37) */ + /* IL_0001: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0001: call MT3620Blink.Descriptor.get_Identity : Timer.cs(38) */ + /* IL_0002: call MT3620Blink.Descriptor.get_Identity : Timer.cs(38) */ stack0_1__ = MT3620Blink_Descriptor_get_Identity((MT3620Blink_Descriptor*)frame__.stack0_0__); - /* IL_0006: ldloca.s timerData : Timer.cs(38) */ + /* IL_0007: ldloca.s timerData : Timer.cs(38) */ stack1_0__ = &timerData; - /* IL_0008: ldc.i4.8 : Timer.cs(38) */ + /* IL_0009: ldc.i4.8 : Timer.cs(38) */ stack2_0__ = 8; - /* IL_0009: conv.i8 : Timer.cs(38) */ + /* IL_000a: conv.i8 : Timer.cs(38) */ stack2_1__ = (int64_t)stack2_0__; - /* IL_000a: call System.UIntPtr.op_Explicit : Timer.cs(38) */ + /* IL_000b: call System.UIntPtr.op_Explicit : Timer.cs(38) */ stack2_2__ = System_UIntPtr_op_Explicit_2((uint64_t)stack2_1__); - /* IL_000f: call MT3620Blink.Interops.timerfd_read : Timer.cs(38) */ + /* IL_0010: call MT3620Blink.Interops.timerfd_read : Timer.cs(38) */ stack0_1__ = MT3620Blink_Interops_timerfd_read(stack0_1__, stack1_0__, stack2_2__); - /* IL_0014: pop : Timer.cs(38) */ - /* IL_0015: ldarg.0 */ + /* IL_0015: pop : Timer.cs(38) */ + /* IL_0016: ldarg.0 */ frame__.stack0_0__ = this__; - /* IL_0016: callvirt MT3620Blink.Timer.Raised : Timer.cs(39) */ + /* IL_0017: callvirt MT3620Blink.Timer.Raised : Timer.cs(39) */ frame__.stack0_0__->vptr0__->Raised(frame__.stack0_0__); - /* IL_001b: ret : Timer.cs(40) */ + /* IL_001c: nop : Timer.cs(39) */ + /* IL_001d: ret */ il2c_unlink_execution_frame(&frame__); return; }