complier: `--direct-call-monomorph` works with constructors without initializers
authorJean Privat <jean@pryen.org>
Sun, 4 Jan 2015 03:25:26 +0000 (22:25 -0500)
committerJean Privat <jean@pryen.org>
Wed, 7 Jan 2015 02:01:16 +0000 (21:01 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/compiler/separate_compiler.nit

index 13f0bd7..e0500e2 100644 (file)
@@ -1063,8 +1063,8 @@ class SeparateCompilerVisitor
        do
                var rta = compiler.runtime_type_analysis
                var mmethod = callsite.mproperty
-               # TODO: Inlining of new-style constructors
-               if compiler.modelbuilder.toolcontext.opt_direct_call_monomorph.value and rta != null and not mmethod.is_root_init then
+               # TODO: Inlining of new-style constructors with initializers
+               if compiler.modelbuilder.toolcontext.opt_direct_call_monomorph.value and rta != null and callsite.mpropdef.initializers.is_empty then
                        var tgs = rta.live_targets(callsite)
                        if tgs.length == 1 then
                                # DIRECT CALL