Ejemplo n.º 1
0
 protected Allocator(Assembler assembler, Compiler compiler, CodeContext codeContext, Translator translator, VariableContext variableContext)
 {
     Assembler       = assembler;
     Compiler        = compiler;
     CodeContext     = codeContext;
     Translator      = translator;
     VariableContext = variableContext;
     VaList          = new VariableAttributes[4][];
 }
Ejemplo n.º 2
0
        internal Fetcher(Compiler compiler, FunctionNode func)
        {
            _compiler     = compiler;
            _functionNode = func;
            _stopNode     = func.End.Next;

            _variableContext = new VariableContext();

            _functionNode.FunctionFlags &= ~(FunctionNodeFlags.IsNaked | FunctionNodeFlags.X86Emms | FunctionNodeFlags.X86SFence | FunctionNodeFlags.X86LFence);

            if (_functionNode.HasHint(FuncionNodeHints.Naked))
            {
                _functionNode.FunctionFlags |= FunctionNodeFlags.IsNaked;
            }
            if (_functionNode.HasHint(FuncionNodeHints.Compact))
            {
                _functionNode.FunctionFlags |= FunctionNodeFlags.X86Leave;
            }
            if (_functionNode.HasHint(FuncionNodeHints.X86Emms))
            {
                _functionNode.FunctionFlags |= FunctionNodeFlags.X86Emms;
            }
            if (_functionNode.HasHint(FuncionNodeHints.X86SFence))
            {
                _functionNode.FunctionFlags |= FunctionNodeFlags.X86SFence;
            }
            if (_functionNode.HasHint(FuncionNodeHints.X86LFence))
            {
                _functionNode.FunctionFlags |= FunctionNodeFlags.X86LFence;
            }

            if (!_functionNode.FunctionFlags.IsSet(FunctionNodeFlags.IsNaked))
            {
                _variableContext.GaRegs[RegisterClass.Gp] &= ~Utils.Mask(RegisterIndex.Bp);
            }

            _functionDeclaration = _functionNode.FunctionDeclaration;
            _unreachableList     = new List <CodeNode>();
            _sArgDatas           = new SArgData[80].InitializeWith(() => new SArgData());

            _jLinkIndex = -1;
        }
Ejemplo n.º 3
0
 public CallAllocator(Assembler assembler, Compiler compiler, CodeContext codeContext, Translator translator, VariableContext ctx)
     : base(assembler, compiler, codeContext, translator, ctx)
 {
 }
Ejemplo n.º 4
0
 public LivenessAnalyzer(FunctionNode func, VariableContext ctx)
 {
     _functionNode    = func;
     _variableContext = ctx;
 }