Exemple #1
0
        public override void Emit(FleeILGenerator ilg, IServiceProvider services)
        {
            BranchManager bm = new BranchManager();

            bm.GetLabel("falseLabel", ilg);
            bm.GetLabel("endLabel", ilg);

            if (ilg.IsTemp == true)
            {
                // If this is a fake emit, then do a fake emit and return
                this.EmitConditional(ilg, services, bm);
                return;
            }

            FleeILGenerator ilgTemp = this.CreateTempFleeILGenerator(ilg);

            Utility.SyncFleeILGeneratorLabels(ilg, ilgTemp);

            // Emit fake conditional to get branch target positions
            this.EmitConditional(ilgTemp, services, bm);

            bm.ComputeBranches();

            // Emit real conditional now that we have the branch target locations
            this.EmitConditional(ilg, services, bm);
        }
Exemple #2
0
        public override void Emit(YaleIlGenerator ilGenerator, ExpressionContext context)
        {
            var branchManager = new BranchManager();

            branchManager.GetLabel("falseLabel", ilGenerator);
            branchManager.GetLabel("endLabel", ilGenerator);

            if (ilGenerator.IsTemp)
            {
                // If this is a fake emit, then do a fake emit and return
                EmitConditional(ilGenerator, context, branchManager);
                return;
            }

            var ilgTemp = CreateTempIlGenerator(ilGenerator);

            Utility.SyncFleeIlGeneratorLabels(ilGenerator, ilgTemp);

            // Emit fake conditional to get branch target positions
            EmitConditional(ilgTemp, context, branchManager);

            branchManager.ComputeBranches();

            // Emit real conditional now that we have the branch target locations
            EmitConditional(ilGenerator, context, branchManager);
        }
Exemple #3
0
		public override void Emit(FleeILGenerator ilg, IServiceProvider services)
		{
			var bm = new BranchManager();
			bm.GetLabel("falseLabel", ilg);
			bm.GetLabel("endLabel", ilg);

			if (ilg.IsTemp == true) {
				// If this is a fake emit, then do a fake emit and return
				this.EmitConditional(ilg, services, bm);
				return;
			}

			var ilgTemp = this.CreateTempFleeILGenerator(ilg);
			Utility.SyncFleeILGeneratorLabels(ilg, ilgTemp);

			// Emit fake conditional to get branch target positions
			this.EmitConditional(ilgTemp, services, bm);

			bm.ComputeBranches();

			// Emit real conditional now that we have the branch target locations
			this.EmitConditional(ilg, services, bm);
		}
Exemple #4
0
        public override void Emit(FleeILGenerator ilg, IServiceProvider services)
        {
            if ((MyTargetCollectionType != null))
            {
                this.EmitCollectionIn(ilg, services);
            }
            else
            {
                BranchManager bm = new BranchManager();
                bm.GetLabel("endLabel", ilg);
                bm.GetLabel("trueTerminal", ilg);

                // Do a fake emit to get branch positions
                FleeILGenerator ilgTemp = this.CreateTempFleeILGenerator(ilg);
                Utility.SyncFleeILGeneratorLabels(ilg, ilgTemp);

                this.EmitListIn(ilgTemp, services, bm);

                bm.ComputeBranches();

                // Do the real emit
                this.EmitListIn(ilg, services, bm);
            }
        }
Exemple #5
0
        public override void Emit(YaleIlGenerator ilGenerator, ExpressionContext context)
        {
            if ((targetCollectionType != null))
            {
                EmitCollectionIn(ilGenerator, context);
            }
            else
            {
                var branchManager = new BranchManager();
                branchManager.GetLabel("endLabel", ilGenerator);
                branchManager.GetLabel("trueTerminal", ilGenerator);

                // Do a fake emit to get branch positions
                var ilgTemp = CreateTempIlGenerator(ilGenerator);
                Utility.SyncFleeIlGeneratorLabels(ilGenerator, ilgTemp);

                EmitListIn(ilgTemp, context, branchManager);

                branchManager.ComputeBranches();

                // Do the real emit
                EmitListIn(ilGenerator, context, branchManager);
            }
        }
Exemple #6
0
		public override void Emit(FleeILGenerator ilg, IServiceProvider services)
		{
			if ((MyTargetCollectionType != null)) {
				this.EmitCollectionIn(ilg, services);

			} else {
				var bm = new BranchManager();
				bm.GetLabel("endLabel", ilg);
				bm.GetLabel("trueTerminal", ilg);

				// Do a fake emit to get branch positions
				var ilgTemp = this.CreateTempFleeILGenerator(ilg);
				Utility.SyncFleeILGeneratorLabels(ilg, ilgTemp);

				this.EmitListIn(ilgTemp, services, bm);

				bm.ComputeBranches();

				// Do the real emit
				this.EmitListIn(ilg, services, bm);
			}
		}