public bool CanInline(CompilerMethodData method)
        {
            if (method.HasDoNotInlineAttribute)
                return false;

            if (method.IsPlugged)
                return false;

            if (method.HasProtectedRegions)
                return false;

            //if (method.HasLoops)
            //	return false;

            if (method.IsVirtual)
                return false;

            if (method.IROtherInstructionCount > 0)
                return false;

            if (method.IRInstructionCount > MethodCompiler.Compiler.CompilerOptions.InlinedIRMaximum)
                return false;

            var returnType = method.Method.Signature.ReturnType;

            if (TypeLayout.IsCompoundType(returnType) && !returnType.IsUI8 && !returnType.IsR8)
                return false;

            return true;
        }
        public bool CanInline(CompilerMethodData method)
        {
            if (method.HasDoNotInlineAttribute)
                return false;

            if (method.IsPlugged)
                return false;

            if (method.HasProtectedRegions)
                return false;

            //if (method.HasLoops)
            //	return false;

            if (method.IsVirtual)
                return false;

            // current implementation limitation - can't include methods with addressOf instruction
            if (method.HasAddressOfInstruction)
                return false;

            if (method.NonIRInstructionCount > 0)
                return false;

            if (method.IRInstructionCount > MethodCompiler.Compiler.CompilerOptions.InlinedIRMaximum)
                return false;

            var returnType = method.Method.Signature.ReturnType;

            if (StoreOnStack(returnType) && !returnType.IsUI8 && !returnType.IsR8)
                return false;

            return true;
        }
        public bool CanInline(CompilerMethodData method)
        {
            if (method.HasDoNotInlineAttribute)
            {
                return(false);
            }

            if (method.IsMethodImplementationReplaced)
            {
                return(false);
            }

            if (method.HasProtectedRegions)
            {
                return(false);
            }

            //if (method.HasLoops)
            //	return false;

            if (method.IsVirtual && !method.IsDevirtualized)
            {
                return(false);
            }

            // current implementation limitation - can't include methods with addressOf instruction
            if (method.HasAddressOfInstruction)
            {
                return(false);
            }

            if (method.NonIRInstructionCount > 0)
            {
                return(false);
            }

            // methods with aggressive inline attribute will double the IR instruction cout
            int max = !method.HasAggressiveInliningAttribute ? CompilerOptions.InlinedIRMaximum : (CompilerOptions.InlinedIRMaximum * 2);

            if ((method.IRInstructionCount - method.IRStackParameterInstructionCount) > max)
            {
                return(false);
            }

            var returnType = method.Method.Signature.ReturnType;

            // FIXME: Add rational
            if (MosaTypeLayout.IsStoredOnStack(returnType) && !returnType.IsUI8 && !returnType.IsR8)
            {
                return(false);
            }

            return(true);
        }
示例#4
0
        public bool CanInline(CompilerMethodData method)
        {
            if (method.HasDoNotInlineAttribute)
            {
                return(false);
            }

            if (method.IsPlugged)
            {
                return(false);
            }

            if (method.HasProtectedRegions)
            {
                return(false);
            }

            //if (method.HasLoops)
            //	return false;

            if (method.IsVirtual && !method.IsDevirtualized)
            {
                return(false);
            }

            // current implementation limitation - can't include methods with addressOf instruction
            if (method.HasAddressOfInstruction)
            {
                return(false);
            }

            if (method.NonIRInstructionCount > 0)
            {
                return(false);
            }

            if (method.IRInstructionCount > MethodCompiler.Compiler.CompilerOptions.InlinedIRMaximum)
            {
                return(false);
            }

            var returnType = method.Method.Signature.ReturnType;

            // FIXME: Add rational
            if (MosaTypeLayout.IsStoredOnStack(returnType) && !returnType.IsUI8 && !returnType.IsR8)
            {
                return(false);
            }

            return(true);
        }
示例#5
0
        public bool CanInline(CompilerMethodData method)
        {
            if (method.HasDoNotInlineAttribute)
            {
                return(false);
            }

            if (method.IsPlugged)
            {
                return(false);
            }

            if (method.HasProtectedRegions)
            {
                return(false);
            }

            //if (method.HasLoops)
            //	return false;

            if (method.IsVirtual)
            {
                return(false);
            }

            if (method.IROtherInstructionCount > 0)
            {
                return(false);
            }

            if (method.IRInstructionCount > IRMaximumForInline)
            {
                return(false);
            }

            var returnType = method.Method.Signature.ReturnType;

            if (TypeLayout.IsCompoundType(returnType) && !returnType.IsUI8 && !returnType.IsR8)
            {
                return(false);
            }

            return(true);
        }