You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2013/08/09 04:15:11 UTC

[lucy-commits] [7/7] git commit: refs/heads/method-imp-names - Address direct invocation of method imp funcs.

Address direct invocation of method imp funcs.

Where the implementing functions for methods are invoked directly
within the Clownfish runtime, either change the spelling to the
new-style with _IMP suffix, or change the call to use dynamic
method invocation.


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

Branch: refs/heads/method-imp-names
Commit: a0263b38edc7f09ce3dce4fd1752f68cd66c3076
Parents: 195cc04
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Thu Aug 8 18:15:47 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Thu Aug 8 19:13:34 2013 -0700

----------------------------------------------------------------------
 clownfish/runtime/core/Clownfish/ByteBuf.c | 3 ++-
 clownfish/runtime/core/Clownfish/CharBuf.c | 8 ++++----
 clownfish/runtime/core/Clownfish/Err.c     | 2 +-
 clownfish/runtime/core/Clownfish/Hash.c    | 8 ++++----
 clownfish/runtime/core/Clownfish/VArray.c  | 2 +-
 clownfish/runtime/core/Clownfish/VTable.c  | 8 ++++----
 6 files changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/ByteBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/ByteBuf.c b/clownfish/runtime/core/Clownfish/ByteBuf.c
index 29a1412..4ffbd84 100644
--- a/clownfish/runtime/core/Clownfish/ByteBuf.c
+++ b/clownfish/runtime/core/Clownfish/ByteBuf.c
@@ -235,7 +235,8 @@ ViewBB_init(ViewByteBuf *self, char *buf, size_t size) {
 
 void
 ViewBB_Destroy_IMP(ViewByteBuf *self) {
-    Obj_destroy((Obj*)self);
+    Obj_Destroy_t super_duper_destroy = METHOD_PTR(OBJ, Cfish_Obj_Destroy);
+    super_duper_destroy((Obj*)self);
 }
 
 void

http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/CharBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/CharBuf.c b/clownfish/runtime/core/Clownfish/CharBuf.c
index 78f4c7b..0233681 100644
--- a/clownfish/runtime/core/Clownfish/CharBuf.c
+++ b/clownfish/runtime/core/Clownfish/CharBuf.c
@@ -470,7 +470,7 @@ CB_Cat_Str_IMP(CharBuf *self, const char* ptr, size_t size) {
     if (!StrHelp_utf8_valid(ptr, size)) {
         DIE_INVALID_UTF8(ptr, size);
     }
-    CB_cat_trusted_str(self, ptr, size);
+    CB_Cat_Trusted_Str_IMP(self, ptr, size);
 }
 
 void
@@ -499,7 +499,7 @@ CB_Cat_IMP(CharBuf *self, const CharBuf *other) {
 
 bool
 CB_Starts_With_IMP(CharBuf *self, const CharBuf *prefix) {
-    return CB_starts_with_str(self, prefix->ptr, prefix->size);
+    return CB_Starts_With_Str_IMP(self, prefix->ptr, prefix->size);
 }
 
 bool
@@ -519,7 +519,7 @@ CB_Equals_IMP(CharBuf *self, Obj *other) {
     CharBuf *const twin = (CharBuf*)other;
     if (twin == self)              { return true; }
     if (!Obj_Is_A(other, CHARBUF)) { return false; }
-    return CB_equals_str(self, twin->ptr, twin->size);
+    return CB_Equals_Str_IMP(self, twin->ptr, twin->size);
 }
 
 int32_t
@@ -538,7 +538,7 @@ CB_Equals_Str_IMP(CharBuf *self, const char *ptr, size_t size) {
 
 bool
 CB_Ends_With_IMP(CharBuf *self, const CharBuf *postfix) {
-    return CB_ends_with_str(self, postfix->ptr, postfix->size);
+    return CB_Ends_With_Str_IMP(self, postfix->ptr, postfix->size);
 }
 
 bool

http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/Err.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Err.c b/clownfish/runtime/core/Clownfish/Err.c
index 30757b8..5dab78b 100644
--- a/clownfish/runtime/core/Clownfish/Err.c
+++ b/clownfish/runtime/core/Clownfish/Err.c
@@ -163,7 +163,7 @@ Err_Add_Frame_IMP(Err *self, const char *file, int line, const char *func) {
 
 void
 Err_rethrow(Err *self, const char *file, int line, const char *func) {
-    Err_add_frame(self, file, line, func);
+    Err_Add_Frame_IMP(self, file, line, func);
     Err_do_throw(self);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/Hash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Hash.c b/clownfish/runtime/core/Clownfish/Hash.c
index 3af71ed..b4c61cb 100644
--- a/clownfish/runtime/core/Clownfish/Hash.c
+++ b/clownfish/runtime/core/Clownfish/Hash.c
@@ -173,7 +173,7 @@ Hash_Make_Key_IMP(Hash *self, Obj *key, int32_t hash_sum) {
 Obj*
 Hash_Fetch_Str_IMP(Hash *self, const char *key, size_t key_len) {
     ZombieCharBuf *key_buf = ZCB_WRAP_STR(key, key_len);
-    return Hash_fetch(self, (Obj*)key_buf);
+    return Hash_Fetch_IMP(self, (Obj*)key_buf);
 }
 
 static INLINE HashEntry*
@@ -225,7 +225,7 @@ Hash_Delete_IMP(Hash *self, const Obj *key) {
 Obj*
 Hash_Delete_Str_IMP(Hash *self, const char *key, size_t key_len) {
     ZombieCharBuf *key_buf = ZCB_WRAP_STR(key, key_len);
-    return Hash_delete(self, (Obj*)key_buf);
+    return Hash_Delete_IMP(self, (Obj*)key_buf);
 }
 
 uint32_t
@@ -275,7 +275,7 @@ Hash_Keys_IMP(Hash *self) {
     VArray *keys = VA_new(self->size);
     Hash_Iterate(self);
     while (Hash_Next(self, &key, &val)) {
-        VA_push(keys, INCREF(key));
+        VA_Push(keys, INCREF(key));
     }
     return keys;
 }
@@ -286,7 +286,7 @@ Hash_Values_IMP(Hash *self) {
     Obj *val;
     VArray *values = VA_new(self->size);
     Hash_Iterate(self);
-    while (Hash_Next(self, &key, &val)) { VA_push(values, INCREF(val)); }
+    while (Hash_Next(self, &key, &val)) { VA_Push(values, INCREF(val)); }
     return values;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/VArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VArray.c b/clownfish/runtime/core/Clownfish/VArray.c
index 953161c..2d16a0a 100644
--- a/clownfish/runtime/core/Clownfish/VArray.c
+++ b/clownfish/runtime/core/Clownfish/VArray.c
@@ -211,7 +211,7 @@ VA_Excise_IMP(VArray *self, uint32_t offset, uint32_t length) {
 
 void
 VA_Clear_IMP(VArray *self) {
-    VA_excise(self, 0, self->size);
+    VA_Excise_IMP(self, 0, self->size);
 }
 
 void

http://git-wip-us.apache.org/repos/asf/lucy/blob/a0263b38/clownfish/runtime/core/Clownfish/VTable.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VTable.c b/clownfish/runtime/core/Clownfish/VTable.c
index 6388234..ae06828 100644
--- a/clownfish/runtime/core/Clownfish/VTable.c
+++ b/clownfish/runtime/core/Clownfish/VTable.c
@@ -110,14 +110,14 @@ VTable_bootstrap(const VTableSpec *specs, size_t num_specs)
         for (size_t i = 0; i < spec->num_overridden_meths; ++i) {
             const OverriddenMethSpec *mspec = &spec->overridden_meth_specs[i];
             *mspec->offset = *mspec->parent_offset;
-            VTable_override(vtable, mspec->func, *mspec->offset);
+            VTable_Override_IMP(vtable, mspec->func, *mspec->offset);
         }
 
         for (size_t i = 0; i < spec->num_novel_meths; ++i) {
             const NovelMethSpec *mspec = &spec->novel_meth_specs[i];
             *mspec->offset = novel_offset;
             novel_offset += sizeof(cfish_method_t);
-            VTable_override(vtable, mspec->func, *mspec->offset);
+            VTable_Override_IMP(vtable, mspec->func, *mspec->offset);
         }
 
         *spec->vtable = vtable;
@@ -131,7 +131,7 @@ VTable_bootstrap(const VTableSpec *specs, size_t num_specs)
         const VTableSpec *spec = &specs[i];
         VTable *vtable = *spec->vtable;
 
-        VTable_init_obj(VTABLE, vtable);
+        VTable_Init_Obj_IMP(VTABLE, vtable);
     }
 
     /* Now it's safe to call methods.
@@ -282,7 +282,7 @@ VTable_singleton(const CharBuf *class_name, VTable *parent) {
             Hash *meths = Hash_new(num_fresh);
             CharBuf *scrunched = CB_new(0);
             for (uint32_t i = 0; i < num_fresh; i++) {
-                CharBuf *meth = (CharBuf*)VA_fetch(fresh_host_methods, i);
+                CharBuf *meth = (CharBuf*)VA_Fetch(fresh_host_methods, i);
                 S_scrunch_charbuf(meth, scrunched);
                 Hash_Store(meths, (Obj*)scrunched, (Obj*)CFISH_TRUE);
             }