Beispiel #1
0
        private static bool String_toCharArray(DynamicTypeWrapper.FinishContext context, CodeEmitter ilgen, MethodWrapper method, MethodAnalyzer ma, int opcodeIndex, MethodWrapper caller, ClassFile classFile, Instruction[] code, InstructionFlags[] flags)
        {
            string str = ilgen.PopLazyLdstr();

            if (str != null)
            {
                // arbitrary length for "big" strings
                if (str.Length > 128)
                {
                    EmitLoadCharArrayLiteral(ilgen, str, caller.DeclaringType);
                    return(true);
                }
                ilgen.Emit(OpCodes.Ldstr, str);
            }
            return(false);
        }