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/12 22:51:45 UTC

[lucy-commits] [07/11] git commit: refs/heads/master - 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/95d82276
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/95d82276
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/95d82276

Branch: refs/heads/master
Commit: 95d82276a309f132c88504b195f234aeb2181e48
Parents: 3263425
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Thu Aug 8 18:15:47 2013 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Mon Aug 12 13:40:47 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/95d82276/clownfish/runtime/core/Clownfish/ByteBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/ByteBuf.c b/clownfish/runtime/core/Clownfish/ByteBuf.c
index 6b4c0ad..8d9f79e 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/95d82276/clownfish/runtime/core/Clownfish/CharBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/CharBuf.c b/clownfish/runtime/core/Clownfish/CharBuf.c
index 4dee752..6890d8b 100644
--- a/clownfish/runtime/core/Clownfish/CharBuf.c
+++ b/clownfish/runtime/core/Clownfish/CharBuf.c
@@ -472,7 +472,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
@@ -501,7 +501,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
@@ -521,7 +521,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
@@ -540,7 +540,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/95d82276/clownfish/runtime/core/Clownfish/Err.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Err.c b/clownfish/runtime/core/Clownfish/Err.c
index e5d3ee1..6f853d4 100644
--- a/clownfish/runtime/core/Clownfish/Err.c
+++ b/clownfish/runtime/core/Clownfish/Err.c
@@ -165,7 +165,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/95d82276/clownfish/runtime/core/Clownfish/Hash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Hash.c b/clownfish/runtime/core/Clownfish/Hash.c
index 2a75db8..9d36d48 100644
--- a/clownfish/runtime/core/Clownfish/Hash.c
+++ b/clownfish/runtime/core/Clownfish/Hash.c
@@ -175,7 +175,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 CFISH_INLINE HashEntry*
@@ -227,7 +227,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
@@ -277,7 +277,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;
 }
@@ -288,7 +288,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/95d82276/clownfish/runtime/core/Clownfish/VArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VArray.c b/clownfish/runtime/core/Clownfish/VArray.c
index e86ca36..4ca7033 100644
--- a/clownfish/runtime/core/Clownfish/VArray.c
+++ b/clownfish/runtime/core/Clownfish/VArray.c
@@ -213,7 +213,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/95d82276/clownfish/runtime/core/Clownfish/VTable.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VTable.c b/clownfish/runtime/core/Clownfish/VTable.c
index 2274a75..5420412 100644
--- a/clownfish/runtime/core/Clownfish/VTable.c
+++ b/clownfish/runtime/core/Clownfish/VTable.c
@@ -112,14 +112,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;
@@ -133,7 +133,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.
@@ -284,7 +284,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);
             }