X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fssa.c;h=b4dc2bf65d4e55b4d5df07fb3649668f7b9cfc88;hb=HEAD;hp=a29108872a4adbb4dfb50430f70595a6eb3c9b17;hpb=3e40c70cf4510a02e8deb6ca3076a07df1a3aab2;p=mono.git diff --git a/mono/mini/ssa.c b/mono/mini/ssa.c index a29108872a4..b4dc2bf65d4 100644 --- a/mono/mini/ssa.c +++ b/mono/mini/ssa.c @@ -1,17 +1,20 @@ -/* - * ssa.c: Static single assign form support for the JIT compiler. +/** + * \file + * Static single assign form support for the JIT compiler. * * Author: * Dietmar Maurer (dietmar@ximian.com) * * (C) 2003 Ximian, Inc. * Copyright 2011 Xamarin, Inc (http://www.xamarin.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include #include #include #include #include +#include #ifndef DISABLE_JIT @@ -157,9 +160,8 @@ typedef struct { /** * mono_ssa_rename_vars: - * - * Implement renaming of SSA variables. Also compute def-use information in parallel. - * @stack_history points to an area of memory which can be used for storing changes + * Implement renaming of SSA variables. Also compute def-use information in parallel. + * \p stack_history points to an area of memory which can be used for storing changes * made to the stack, so they can be reverted later. */ static void @@ -236,8 +238,13 @@ mono_ssa_rename_vars (MonoCompile *cfg, int max_vars, MonoBasicBlock *bb, gboole if (var->opcode == OP_ARG) originals_used [idx] = TRUE; - /* FIXME: */ - g_assert (stack_history_len < stack_history_size); + if (stack_history_len + 128 > stack_history_size) { + stack_history_size += 1024; + RenameInfo *new_history = mono_mempool_alloc (cfg->mempool, sizeof (RenameInfo) * stack_history_size); + memcpy (new_history, stack_history, stack_history_len * sizeof (RenameInfo)); + stack_history = new_history; + } + stack_history [stack_history_len].var = stack [idx]; stack_history [stack_history_len].idx = idx; stack_history_len ++; @@ -1514,4 +1521,8 @@ mono_ssa_loop_invariant_code_motion (MonoCompile *cfg) } } -#endif /* DISABLE_JIT */ +#else /* !DISABLE_JIT */ + +MONO_EMPTY_SOURCE_FILE (ssa); + +#endif /* !DISABLE_JIT */