Closed GoogleCodeExporter closed 8 years ago
Yay, that's a long sequence of logical operators :)
For a quick solution, just apply the attached patch - it will add a few bytes
to your generated IL, but will solve this issue.
The problem lies in forward branches - you can't tell if it's possible to use
the short form, because you don't know how much code will follow before the
target instruction. For some reason, I've assumed that the operands of the
conditional operator (used for logical and and or) will always generate less
than 128 bytes of IL. You've proved me wrong :)
Anyway, since RunSharp already generates long branches everywhere else, it's
probably correct to fix it by changing this last short branch to a long one and
worry about size optimization much later.
Original comment by StefanSi...@gmail.com
on 20 Aug 2010 at 9:42
Attachments:
Cool, I'll try it out now and let you know.
Thx
Original comment by carel.l...@gmail.com
on 20 Aug 2010 at 9:45
Stefan
The patch seems to be working!! The first 20000 rules have just generated
successfully. 10000 to go!
Thanks a lot. You've made my day. I'll let you know when I get all 30 000
rules generated successfully.
Original comment by carel.l...@gmail.com
on 20 Aug 2010 at 10:05
Yay!
It's running through! I'm parsing, type checking and translating 30 000 SAP
rules into IL within 15 seconds! Pretty impressive results! Assembly is 4.8MB.
If I generate the same rules first to C# syntax and then use the C# compiler I
generate the same set of rules in 9 seconds and the assembly is 3.8MB big. The
benefit now however is that because the rules change at run-time, I can use the
DynamicMethodGen to regenerate the method without having to worry about having
to unload the assembly which is not possible in as the latter solution
requires. I can just regen the method on the fly!
Thanks again for a great library.
Original comment by carel.l...@gmail.com
on 20 Aug 2010 at 10:53
This issue was closed by revision 77b5c4ab1c.
Original comment by StefanSi...@gmail.com
on 22 Aug 2010 at 9:10
Original issue reported on code.google.com by
carel.l...@gmail.com
on 20 Aug 2010 at 9:25