Esempio n. 1
0
        private TranslatedSub TranslateLowCq(long position, ExecutionMode mode)
        {
            Block block = Decoder.DecodeBasicBlock(_memory, position, mode);

            ILEmitterCtx context = new ILEmitterCtx(_cache, _queue, TranslationTier.Tier0, block);

            string subName = GetSubroutineName(position);

            ILMethodBuilder ilMthdBuilder = new ILMethodBuilder(context.GetILBlocks(), subName);

            TranslatedSub subroutine = ilMthdBuilder.GetSubroutine(TranslationTier.Tier0);

            return(_cache.GetOrAdd(position, subroutine, block.OpCodes.Count));
        }
Esempio n. 2
0
        private TranslatedSub TranslateLowCq(long position, ExecutionMode mode)
        {
            Block[] blocks = Decoder.DecodeBasicBlock(_memory, (ulong)position, mode);

            ILEmitterCtx context = new ILEmitterCtx(_memory, _cache, _queue, TranslationTier.Tier0);

            BasicBlock[] bbs = EmitAndGetBlocks(context, blocks);

            TranslatedSubBuilder builder = new TranslatedSubBuilder(mode);

            string name = GetSubroutineName(position);

            TranslatedSub subroutine = builder.Build(bbs, name, TranslationTier.Tier0);

            return(_cache.GetOrAdd(position, subroutine, GetOpsCount(bbs)));
        }