[runtime] Fix test_op_il_seq_point in amd64.
authorMarcos Henrich <marcos.henrich@xamarin.com>
Thu, 20 Aug 2015 10:27:02 +0000 (11:27 +0100)
committerMarcos Henrich <marcos.henrich@xamarin.com>
Fri, 28 Aug 2015 10:48:51 +0000 (11:48 +0100)
In amd64 when possible 32bit instructions and registers are usedi
instead of 64bit ones.

Using MONO_DEBUG=single-imm-size avoids 32bit optimizations thus
maintaining the native code size between compilations.

mono/mini/test_op_il_seq_point.sh

index a5c7a3fb36c43dc41a577634648e153f33fefc89..5df176e4755c968607feee268744df3ab860bb28 100755 (executable)
@@ -19,6 +19,10 @@ clean_aot () {
        rm -rf *.exe..so *.exe.dylib *.exe.dylib.dSYM
 }
 
+# The test compares the generated native code size between a compilation with and without seq points.
+# In some architectures ie:amd64 when possible 32bit instructions and registers are used instead of 64bit ones.
+# Using MONO_DEBUG=single-imm-size avoids 32bit optimizations thus mantaining the native code size between compilations.
+
 get_methods () {
        if [ -z $4 ]; then
                MONO_PATH=$1 $2 -v --compile-all=1 $3 | grep '^Method .*code length' | sed 's/emitted[^()]*//' | sort
@@ -39,14 +43,14 @@ get_method () {
 
 diff_methods () {
        TMP_FILE=$(tmp_file)
-       echo "$(get_methods $1 $2 $3 $4)" >$TMP_FILE
-       diff <(cat $TMP_FILE) <(echo "$(MONO_DEBUG=gen-compact-seq-points get_methods $1 $2 $3 $4)")
+       echo "$(MONO_DEBUG=single-imm-size get_methods $1 $2 $3 $4)" >$TMP_FILE
+       diff <(cat $TMP_FILE) <(echo "$(MONO_DEBUG=gen-compact-seq-points,single-imm-size get_methods $1 $2 $3 $4)")
 }
 
 diff_method () {
        TMP_FILE=$(tmp_file)
-       echo "$(get_method $1 $2 $3 $4 $5)" >$TMP_FILE
-       sdiff -w 150 <(cat $TMP_FILE) <(echo "$(MONO_DEBUG=gen-compact-seq-points get_method $1 $2 $3 $4 $5 | grep -Ev il_seq_point)")
+       echo "$(MONO_DEBUG=single-imm-size get_method $1 $2 $3 $4 $5)" >$TMP_FILE
+       sdiff -w 150 <(cat $TMP_FILE) <(echo "$(MONO_DEBUG=gen-compact-seq-points,single-imm-size get_method $1 $2 $3 $4 $5 | grep -Ev il_seq_point)")
 }
 
 get_method_name () {