Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfrijters <jfrijters>2015-06-30 13:18:05 +0300
committerjfrijters <jfrijters>2015-06-30 13:18:05 +0300
commitc22de7172c9ca821fa68163eca4f153cfb6a604c (patch)
tree1655567dbea797613eea1bd54b8f3b6f92d7dd51
parentdf9cc5fb8d711cf8eb3c7f7386f02f3e6672a87a (diff)
Improved IsSideEffectFreeStaticInitializerOrNoop() to handle needless zero/null initialization of static fields. Removed bogus handling of incorrect return statements.
-rw-r--r--runtime/DynamicTypeWrapper.cs14
1 files changed, 1 insertions, 13 deletions
diff --git a/runtime/DynamicTypeWrapper.cs b/runtime/DynamicTypeWrapper.cs
index 194d62f3..6b1f19c0 100644
--- a/runtime/DynamicTypeWrapper.cs
+++ b/runtime/DynamicTypeWrapper.cs
@@ -1176,10 +1176,6 @@ namespace IKVM.Internal
noop = false;
return false;
}
- if (!field.IsFinal || !field.IsStatic)
- {
- noop = false;
- }
}
else if (field.IsProperty && field.PropertyGetter != null)
{
@@ -1187,21 +1183,13 @@ namespace IKVM.Internal
return false;
}
}
- else if (bc == NormalizedByteCode.__areturn ||
- bc == NormalizedByteCode.__ireturn ||
- bc == NormalizedByteCode.__lreturn ||
- bc == NormalizedByteCode.__freturn ||
- bc == NormalizedByteCode.__dreturn)
- {
- noop = false;
- return false;
- }
else if (ByteCodeMetaData.CanThrowException(bc))
{
noop = false;
return false;
}
else if (bc == NormalizedByteCode.__aconst_null
+ || (bc == NormalizedByteCode.__iconst && m.Instructions[i].Arg1 == 0)
|| bc == NormalizedByteCode.__return
|| bc == NormalizedByteCode.__nop)
{