namespace NormalSwitch { using System; using Benchmark; delegate int SwitchCase(int x); class DynamicGeneratedCode { // these functions play the role of the dynamic generated code public static int add_10(int x) { return x+10; } public static int mul_2(int x) { return x*2; } public static int sub_3(int x) { return x-3; } } class Test { public static int interpret(object[] bytecode) { SwitchCase add_10 = new SwitchCase(DynamicGeneratedCode.add_10); SwitchCase mul_2 = new SwitchCase(DynamicGeneratedCode.mul_2); SwitchCase sub_3 = new SwitchCase(DynamicGeneratedCode.sub_3); int accumulator = 0; for(int i=0; i