You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/07/06 19:21:21 UTC

[1/3] git commit: Mark Class#Make_Obj and Class#Init_Obj as incremented

Repository: lucy-clownfish
Updated Branches:
  refs/heads/master b85791907 -> 9150ca3ae


Mark Class#Make_Obj and Class#Init_Obj as incremented


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/2a4e6410
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/2a4e6410
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/2a4e6410

Branch: refs/heads/master
Commit: 2a4e641001a2e85976e5884560a3f6a55f074292
Parents: b857919
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Jul 6 17:52:59 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sun Jul 6 17:52:59 2014 +0200

----------------------------------------------------------------------
 runtime/core/Clownfish/Class.cfh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2a4e6410/runtime/core/Clownfish/Class.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Class.cfh b/runtime/core/Clownfish/Class.cfh
index 2d07add..3bab408 100644
--- a/runtime/core/Clownfish/Class.cfh
+++ b/runtime/core/Clownfish/Class.cfh
@@ -100,13 +100,13 @@ class Clownfish::Class inherits Clownfish::Obj {
      * assign its class and give it an initial refcount of 1.  The caller is
      * responsible for initialization.
      */
-    Obj*
+    incremented Obj*
     Make_Obj(Class *self);
 
     /** Take a raw memory allocation which is presumed to be of adequate size,
      * assign its class and give it an initial refcount of 1.
      */
-    Obj*
+    incremented Obj*
     Init_Obj(Class *self, void *allocation);
 
     /** Create a new object to go with the supplied host object.


[3/3] git commit: Move 'inherit_metadata' hack to CFC

Posted by nw...@apache.org.
Move 'inherit_metadata' hack to CFC


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/9150ca3a
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/9150ca3a
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/9150ca3a

Branch: refs/heads/master
Commit: 9150ca3ae90a86bc81cf7ef7cf26f1d306f308c9
Parents: f3c0981
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Jul 6 18:56:28 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sun Jul 6 18:56:28 2014 +0200

----------------------------------------------------------------------
 compiler/perl/lib/Clownfish/CFC.pm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/9150ca3a/compiler/perl/lib/Clownfish/CFC.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC.pm b/compiler/perl/lib/Clownfish/CFC.pm
index 5034e85..8b80ea5 100644
--- a/compiler/perl/lib/Clownfish/CFC.pm
+++ b/compiler/perl/lib/Clownfish/CFC.pm
@@ -255,6 +255,39 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
         verify_args( \%new_PARAMS, %args ) or confess $@;
         return _new( @args{qw( dest )} );
     }
+
+    # Recreate host language specific metadata of dependencies.
+    #
+    # TODO: This should be done automatically when building the hierarchy.
+    # But since the current approach relies on runtime introspection, the Perl
+    # modules for all dependencies must first be loaded.
+    sub inherit_metadata {
+        my $self = shift;
+
+        require Clownfish;
+
+        for my $class (@{ $self->ordered_classes }) {
+            next if !$class->included || $class->inert;
+
+            my $class_name = $class->get_class_name;
+            my $rt_class = Clownfish::Class->fetch_class($class_name)
+                or die("Class $class_name not found");
+
+            for my $rt_method (@{ $rt_class->get_methods }) {
+                if ($rt_method->is_excluded_from_host) {
+                    my $method = $class->method($rt_method->get_name);
+                    $method->exclude_from_host;
+                }
+                else {
+                    my $alias = $rt_method->get_host_alias;
+                    if (defined($alias)) {
+                        my $method = $class->method($rt_method->get_name);
+                        $method->set_host_alias($alias);
+                    }
+                }
+            }
+        }
+    }
 }
 
 {


[2/3] git commit: Autogenerate Class#Make_Obj binding

Posted by nw...@apache.org.
Autogenerate Class#Make_Obj binding

Now that Make_Obj is marked as incremented, the Perl binding can be
autogenerated.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/f3c09817
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/f3c09817
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/f3c09817

Branch: refs/heads/master
Commit: f3c09817240f4f797bdfa36316b57e867542c014
Parents: 2a4e641
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Jul 6 17:54:40 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sun Jul 6 17:57:06 2014 +0200

----------------------------------------------------------------------
 runtime/perl/buildlib/Clownfish/Build/Binding.pm | 11 -----------
 1 file changed, 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f3c09817/runtime/perl/buildlib/Clownfish/Build/Binding.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build/Binding.pm b/runtime/perl/buildlib/Clownfish/Build/Binding.pm
index 7593d32..3fc9bf1 100644
--- a/runtime/perl/buildlib/Clownfish/Build/Binding.pm
+++ b/runtime/perl/buildlib/Clownfish/Build/Binding.pm
@@ -554,8 +554,6 @@ END_XS_CODE
 }
 
 sub bind_class {
-    my @hand_rolled = qw( Make_Obj );
-
     my $xs_code = <<'END_XS_CODE';
 MODULE = Clownfish   PACKAGE = Clownfish::Class
 
@@ -606,21 +604,12 @@ CODE:
     RETVAL = (SV*)CFISH_Class_To_Host(singleton);
 }
 OUTPUT: RETVAL
-
-SV*
-make_obj(self)
-    cfish_Class *self;
-CODE:
-    cfish_Obj *blank = CFISH_Class_Make_Obj(self);
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(blank);
-OUTPUT: RETVAL
 END_XS_CODE
 
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel     => "Clownfish",
         class_name => "Clownfish::Class",
     );
-    $binding->exclude_method($_) for @hand_rolled;
     $binding->append_xs($xs_code);
 
     Clownfish::CFC::Binding::Perl::Class->register($binding);