From 1991b7b15fa73003742f35794718fa7a83bf7476 Mon Sep 17 00:00:00 2001 From: Paolo Molaro Date: Mon, 27 Jun 2011 15:49:48 +0200 Subject: Add an aot option to override the value of readonly static fields. If the static constructor of a type has been run, the JIT can perform some optimizations based on the actual value of static readonly fields. This isn't possible in AOT mode, since the code won't be ran before compile time: this option allows to set any number of static readonly fields to a constant value so that the compiler can perform the same kind of optimizations. --- man/mono.1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'man') diff --git a/man/mono.1 b/man/mono.1 index 857f3913577..37e96045e56 100644 --- a/man/mono.1 +++ b/man/mono.1 @@ -192,6 +192,19 @@ Same for the llvm tools 'opt' and 'llc'. .TP .I stats Print various stats collected during AOT compilation. +.TP +.I readonly-value=namespace.typename.fieldname=type/value +Override the value of a static readonly field. Usually, during JIT +compilation, the static constructor is ran eagerly, so the value of +a static readonly field is known at compilation time and the compiler +can do a number of optimizations based on it. During AOT, instead, the static +constructor can't be ran, so this option can be used to set the value of such +a field and enable the same set of optimizations. +Type can be any of i1, i2, i4 for integers of the respective sizes (in bytes). +Note that signed/unsigned numbers do not matter here, just the storage size. +This option can be specified multiple times and it doesn't prevent the static +constructor for the type defining the field to execute with the usual rules +at runtime (hence possibly computing a different value for the field). .PP For more information about AOT, see: http://www.mono-project.com/AOT -- cgit v1.2.3