From: Jürg Billeter Date: Mon, 27 Oct 2008 09:23:17 +0000 (+0000) Subject: Disable additional run-time checks by default to improve performance X-Git-Tag: VALA_0_5_1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=595cfead6e8f4f0f0931873c0f89101cbaf8d5c8;p=thirdparty%2Fvala.git Disable additional run-time checks by default to improve performance 2008-10-27 Jürg Billeter * vala/valacodecontext.vala: * gobject/valaccodegenerator.vala: * compiler/valacompiler.vala: Disable additional run-time checks by default to improve performance svn path=/trunk/; revision=1936 --- diff --git a/ChangeLog b/ChangeLog index 4433a61bf..8502a8e47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-10-27 Jürg Billeter + + * vala/valacodecontext.vala: + * gobject/valaccodegenerator.vala: + * compiler/valacompiler.vala: + + Disable additional run-time checks by default to improve + performance + 2008-10-27 Jürg Billeter * gobject/valaccodemethodmodule.vala: diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index 5b878e371..621ce3f07 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -42,7 +42,7 @@ class Vala.Compiler { static bool debug; static bool thread; static bool disable_assert; - static bool disable_checking; + static bool enable_checking; static bool disable_non_null; static bool non_null_experimental; static string cc_command; @@ -66,7 +66,7 @@ class Vala.Compiler { { "debug", 'g', 0, OptionArg.NONE, ref debug, "Produce debug information", null }, { "thread", 0, 0, OptionArg.NONE, ref thread, "Enable multithreading support", null }, { "disable-assert", 0, 0, OptionArg.NONE, ref disable_assert, "Disable assertions", null }, - { "disable-checking", 0, 0, OptionArg.NONE, ref disable_checking, "Disable run-time checks", null }, + { "enable-checking", 0, 0, OptionArg.NONE, ref enable_checking, "Enable additional run-time checks", null }, { "disable-non-null", 0, 0, OptionArg.NONE, ref disable_non_null, "Disable non-null types", null }, { "enable-non-null-experimental", 0, 0, OptionArg.NONE, ref non_null_experimental, "Enable experimental enhancements for non-null types", null }, { "cc", 0, 0, OptionArg.STRING, ref cc_command, "Use COMMAND as C compiler command", "COMMAND" }, @@ -147,7 +147,7 @@ class Vala.Compiler { context.library = library; context.assert = !disable_assert; - context.checking = !disable_checking; + context.checking = enable_checking; context.non_null = !disable_non_null || non_null_experimental; context.non_null_experimental = non_null_experimental; Report.set_verbose_errors (!quiet_mode); diff --git a/gobject/valaccodegenerator.vala b/gobject/valaccodegenerator.vala index 584799636..9a67237a4 100644 --- a/gobject/valaccodegenerator.vala +++ b/gobject/valaccodegenerator.vala @@ -4188,7 +4188,7 @@ public class Vala.CCodeGenerator : CodeGenerator { public CCodeStatement? create_type_check_statement (CodeNode method_node, DataType ret_type, TypeSymbol t, bool non_null, string var_name) { var ccheck = new CCodeFunctionCall (); - if ((t is Class && !((Class) t).is_compact) || t is Interface) { + if (context.checking && ((t is Class && !((Class) t).is_compact) || t is Interface)) { var ctype_check = new CCodeFunctionCall (new CCodeIdentifier (get_type_check_function (t))); ctype_check.add_argument (new CCodeIdentifier (var_name)); diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala index 236af647a..acfd460c6 100644 --- a/vala/valacodecontext.vala +++ b/vala/valacodecontext.vala @@ -46,7 +46,7 @@ public class Vala.CodeContext { public bool assert { get; set; } /** - * Enable additional run-time checks. + * Enable additional run-time checks such as type checks. */ public bool checking { get; set; }