interpreter: the annotation light_ffi identifies a method as light FFI only
authorAlexis Laferrière <alexis.laf@xymus.net>
Mon, 18 Apr 2016 17:23:01 +0000 (13:23 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 18 Apr 2016 18:12:05 +0000 (14:12 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/frontend/check_annotation.nit
src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit

index 5adcabd..680fa67 100644 (file)
@@ -100,6 +100,7 @@ auto_inspect
 pkgconfig
 cflags
 ldflags
+light_ffi
 
 platform
 """
index e826f05..5593f87 100644 (file)
@@ -37,8 +37,13 @@ redef class AMethPropdef
        # * Must use the nested foreign code block of the FFI.
        # * Must not have callbacks.
        # * Must be implemented in C.
+       # * Must not have a parameter or return typed with a Nit standard class.
        fun supported_by_dynamic_ffi: Bool
        do
+               # If the user specfied `is light_ffi`, it must be supported
+               var nats = get_annotations("light_ffi")
+               if nats.not_empty then return true
+
                var n_extern_code_block = n_extern_code_block
                if not (n_extern_calls == null and n_extern_code_block != null and
                        n_extern_code_block.is_c) then return false