예제 #1
0
        public void Write(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, bool haveDebugInfo, BinaryWriter writer)
        {
            writer.Write((uint)m_escapePathTerminators.Length);

            foreach (HighEscapePathTerminator terminator in m_escapePathTerminators)
                terminator.Write(fileBuilder, regionBuilder, writer);

            m_protRegion.Write(fileBuilder, methodBuilder, haveDebugInfo, writer);
        }
예제 #2
0
        public void Write(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, bool haveDebugInfo, BinaryWriter writer)
        {
            HighRegionBuilder regionBuilder = new HighRegionBuilder();
            regionBuilder.IndexCfgNode(m_entryNode.Value);

            MemoryStream regionNodesStream = new MemoryStream();
            BinaryWriter regionNodesWriter = new BinaryWriter(regionNodesStream);

            HighCfgNode cfgNode = regionBuilder.DequeueUnemittedNode();
            while (cfgNode != null)
            {
                cfgNode.Write(fileBuilder, methodBuilder, regionBuilder, haveDebugInfo, regionNodesWriter);

                cfgNode = regionBuilder.DequeueUnemittedNode();
            }

            regionNodesWriter.Flush();

            regionBuilder.WriteHeader(writer);
            writer.Flush();
            regionNodesStream.WriteTo(writer.BaseStream);
        }
예제 #3
0
 public override void WriteHeader(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, HighCfgNodeBuilder cfgNodeBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     writer.Write((byte)m_operation);
     writer.Write((byte)m_numberType);
     writer.Write(m_trueValue);
     writer.Write(m_falseValue);
 }
예제 #4
0
 protected override void WriteHandlers(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     writer.Write((uint)m_catchHandlers.Length);
     foreach (HighCatchHandler catchHandler in m_catchHandlers)
         catchHandler.Write(fileBuilder, methodBuilder, haveDebugInfo, writer);
 }
예제 #5
0
 public void Write(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     writer.Write(fileBuilder.IndexTypeSpecTag(m_catchType));
     m_region.Write(fileBuilder, methodBuilder, haveDebugInfo, writer);
 }
 public override void WriteHeader(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, HighCfgNodeBuilder cfgNodeBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     writer.Write(fileBuilder.IndexMethodSpecTag(m_methodSpec));
     writer.Write(fileBuilder.IndexTypeSpecTag(m_constraintType));
     writer.Write((uint)m_parameters.Length);
 }
예제 #7
0
 public override void WriteHeader(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, HighCfgNodeBuilder cfgNodeBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     writer.Write(fileBuilder.IndexString(m_field));
 }
예제 #8
0
 protected abstract void WriteHandlers(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, bool haveDebugInfo, BinaryWriter writer);
 public override void WriteHeader(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, HighCfgNodeBuilder cfgNodeBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     throw new NotImplementedException();
 }
예제 #10
0
 public override void WriteHeader(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, HighCfgNodeBuilder cfgNodeBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     writer.Write((uint)m_cases.Length);
 }
예제 #11
0
 public override void WriteHeader(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, HighCfgNodeBuilder cfgNodeBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     writer.Write((byte)m_conversionType);
     writer.Write(m_destPrecision);
     writer.Write(m_sourcePrecision);
 }
예제 #12
0
        public void Write(HighFileBuilder fileBuilder, BinaryWriter writer)
        {
            writer.Write(m_instanceLocal != null);
            writer.Write((uint)m_args.Length);
            writer.Write((uint)m_locals.Length);
            writer.Write(m_haveDebugInfo);

            List<HighLocal> allLocals = new List<HighLocal>();
            if (m_instanceLocal != null)
                allLocals.Add(m_instanceLocal);
            allLocals.AddRange(m_args);
            allLocals.AddRange(m_locals);

            foreach (HighLocal local in allLocals)
                local.Write(fileBuilder, writer);

            HighMethodBuilder methodBuilder = new HighMethodBuilder(allLocals.ToArray());

            m_region.Write(fileBuilder, methodBuilder, m_haveDebugInfo, writer);
        }
예제 #13
0
 public override void WriteHeader(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, HighCfgNodeBuilder cfgNodeBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     writer.Write(fileBuilder.IndexTypeSpecTag(m_type));
     writer.Write(fileBuilder.IndexString(m_fieldName));
     writer.Write(m_isStatic);
 }
예제 #14
0
 public override void WriteHeader(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, HighCfgNodeBuilder cfgNodeBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     writer.Write((byte)m_arithOp);
     writer.Write((byte)m_arithType);
     writer.Write(m_checkOverflow);
 }
예제 #15
0
        public void Write(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, bool haveDebugInfo, BinaryWriter writer)
        {
            HighCfgNodeBuilder cfgNodeBuilder = new HighCfgNodeBuilder();

            HashSet<HighSsaRegister> gatheredConstants = new HashSet<HighSsaRegister>();
            List<HighSsaRegister> constants = new List<HighSsaRegister>();

            HighInstruction.VisitSsaDelegate constVisitor = delegate (ref HighSsaRegister use)
            {
                if (use.IsConstant && !gatheredConstants.Contains(use))
                {
                    gatheredConstants.Add(use);
                    constants.Add(use);
                }
            };

            foreach (HighInstruction instr in m_instructions)
                instr.VisitSsaUses(constVisitor);

            writer.Write((uint)m_predecessors.Length);
            writer.Write((uint)m_phis.Length);
            writer.Write((uint)m_instructions.Length);
            writer.Write((uint)constants.Count);

            foreach (HighCfgNodeHandle pred in m_predecessors)
                writer.Write(regionBuilder.IndexCfgNode(pred.Value));

            foreach (HighPhi phi in m_phis)
            {
                cfgNodeBuilder.AddSsa(phi.Dest);
                phi.Write(fileBuilder, regionBuilder, m_predecessors, writer);
            }

            foreach (HighSsaRegister constant in constants)
            {
                cfgNodeBuilder.AddSsa(constant);
                constant.WriteConstant(fileBuilder, regionBuilder, writer);
            }

            foreach (HighInstruction instr in m_instructions)
                instr.Write(fileBuilder, methodBuilder, regionBuilder, cfgNodeBuilder, haveDebugInfo, writer);
        }
예제 #16
0
 protected override void WriteHandlers(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     m_finallyRegion.Write(fileBuilder, methodBuilder, haveDebugInfo, writer);
 }
 public override void WriteHeader(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, HighRegionBuilder regionBuilder, HighCfgNodeBuilder cfgNodeBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
 }
예제 #18
0
 public void Write(HighFileBuilder fileBuilder, HighMethodBuilder methodBuilder, bool haveDebugInfo, BinaryWriter writer)
 {
     writer.Write((byte)this.RegionType);
     m_tryRegion.Write(fileBuilder, methodBuilder, haveDebugInfo, writer);
     WriteHandlers(fileBuilder, methodBuilder, haveDebugInfo, writer);
 }