Exemplo n.º 1
0
        private int EnsureLabelIndex(BranchLabel label) {
            if (label.HasRuntimeLabel) {
                return label.LabelIndex;
            }

            label.LabelIndex = _runtimeLabelCount;
            _runtimeLabelCount++;
            return label.LabelIndex;
        }
Exemplo n.º 2
0
 public void MarkLabel(BranchLabel label) {
     label.Mark(this);
 }
Exemplo n.º 3
0
 public void EmitGoto(BranchLabel label, bool hasResult, bool hasValue)
 {
     Emit(GotoInstruction.Create(EnsureLabelIndex(label), hasResult, hasValue));
 }
Exemplo n.º 4
0
        public BranchLabel MakeLabel() {
            if (_labels == null) {
                _labels = new List<BranchLabel>();
            }

            var label = new BranchLabel();
            _labels.Add(label);
            return label;
        }
Exemplo n.º 5
0
 public void EmitCoalescingBranch(BranchLabel leftNotNull) {
     EmitBranch(new CoalescingBranchInstruction(), leftNotNull);
 }
Exemplo n.º 6
0
 public void EmitEnterTryFinally(BranchLabel finallyStartLabel) {
     Emit(EnterTryFinallyInstruction.Create(EnsureLabelIndex(finallyStartLabel)));
 }
Exemplo n.º 7
0
 public void EmitEnterTryFinally(BranchLabel finallyStartLabel)
 {
     Emit(EnterTryFinallyInstruction.Create(EnsureLabelIndex(finallyStartLabel)));
 }
Exemplo n.º 8
0
 public void EmitBranch(BranchLabel label) {
     EmitBranch(new BranchInstruction(), label);
 }
Exemplo n.º 9
0
 public void EmitCoalescingBranch(BranchLabel leftNotNull)
 {
     EmitBranch(new CoalescingBranchInstruction(), leftNotNull);
 }
Exemplo n.º 10
0
 public void EmitBranchFalse(BranchLabel elseLabel)
 {
     EmitBranch(new BranchFalseInstruction(), elseLabel);
 }
Exemplo n.º 11
0
 public void EmitBranch(BranchLabel label, bool hasResult, bool hasValue)
 {
     EmitBranch(new BranchInstruction(hasResult, hasValue), label);
 }
Exemplo n.º 12
0
 public void EmitBranch(BranchLabel label)
 {
     EmitBranch(new BranchInstruction(), label);
 }
Exemplo n.º 13
0
 private void EmitBranch(OffsetInstruction instruction, BranchLabel label)
 {
     Emit(instruction);
     label.AddBranch(this, Count - 1);
 }
Exemplo n.º 14
0
 public void EmitGoto(BranchLabel label, bool hasResult, bool hasValue) {
     Emit(GotoInstruction.Create(EnsureLabelIndex(label), hasResult, hasValue));
 }
Exemplo n.º 15
0
 public void EmitLeaveExceptionHandler(bool hasValue, BranchLabel tryExpressionEndLabel)
 {
     Emit(LeaveExceptionHandlerInstruction.Create(EnsureLabelIndex(tryExpressionEndLabel), hasValue));
 }
Exemplo n.º 16
0
 private void EmitBranch(OffsetInstruction instruction, BranchLabel label) {
     Emit(instruction);
     label.AddBranch(this, Count - 1);
 }
Exemplo n.º 17
0
 public void EmitGoto(BranchLabel label, bool hasResult, bool hasValue) {
     Emit(new GotoInstruction(Count, hasResult, hasValue));
     label.AddBranch(Count - 1);
 }
Exemplo n.º 18
0
 public void EmitBranch(BranchLabel label, bool hasResult, bool hasValue) {
     EmitBranch(new BranchInstruction(hasResult, hasValue), label);
 }
Exemplo n.º 19
0
 public void EmitLeaveExceptionHandler(bool hasValue, BranchLabel startOfFinally) {
     EmitBranch(new LeaveExceptionHandlerInstruction(hasValue), startOfFinally);
 }
Exemplo n.º 20
0
 public void EmitBranchFalse(BranchLabel elseLabel) {
     EmitBranch(new BranchFalseInstruction(), elseLabel);
 }
 public void EmitBranchNull(BranchLabel elseLabel) {
     EmitBranch(new BranchNullInstruction(), elseLabel);
 }
Exemplo n.º 22
0
 public void EmitLeaveExceptionHandler(bool hasValue, BranchLabel tryExpressionEndLabel) {
     Emit(LeaveExceptionHandlerInstruction.Create(EnsureLabelIndex(tryExpressionEndLabel), hasValue));
 }
Exemplo n.º 23
0
 public void MarkLabel(BranchLabel label)
 {
     label.Mark(this);
 }