]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Disable additional run-time checks by default to improve performance
authorJürg Billeter <j@bitron.ch>
Mon, 27 Oct 2008 09:23:17 +0000 (09:23 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Mon, 27 Oct 2008 09:23:17 +0000 (09:23 +0000)
2008-10-27  Jürg Billeter  <j@bitron.ch>

* vala/valacodecontext.vala:
* gobject/valaccodegenerator.vala:
* compiler/valacompiler.vala:

Disable additional run-time checks by default to improve
performance

svn path=/trunk/; revision=1936

ChangeLog
compiler/valacompiler.vala
gobject/valaccodegenerator.vala
vala/valacodecontext.vala

index 4433a61bf4eb95b360b6dd200fe43ef8aea7271a..8502a8e47a98293f12e769cb37f8a0ff2d45b698 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-10-27  Jürg Billeter  <j@bitron.ch>
+
+       * 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  <j@bitron.ch>
 
        * gobject/valaccodemethodmodule.vala:
index 5b878e371e436a7d2ba9c824f435d80896438421..621ce3f0784b1b83ba62163fc4ff094071e2e3aa 100644 (file)
@@ -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);
index 5847996367ab33fa7f1d73a6fca68e9e7826d312..9a67237a4089e6d5bdb1f7506701e6505c665cb7 100644 (file)
@@ -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));
                        
index 236af647af49c4a108768eed0908251063546283..acfd460c6dd065b9d1b95b22e3a5400b5c0d92c8 100644 (file)
@@ -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; }