Author: tewk
Date: Thu May 10 08:47:22 2007
New Revision: 18494
Modified:
trunk/src/objects.c
Log:
[CAGE] object.c cleanup
Modified: trunk/src/objects.c
==============================================================================
--- trunk/src/objects.c (original)
+++ trunk/src/objects.c Thu May 10 08:47:22 2007
@@ -1192,8 +1192,7 @@
/*
=item C<PMC *
-Parrot_find_method_with_cache(Interp *interp, PMC *_class,
- STRING *method_name)>
+Parrot_find_method_with_cache(Interp *interp, PMC *_class, STRING
*method_name)>
Find a method PMC for a named method, given the class PMC, current
interp, and name of the method.
@@ -1204,8 +1203,7 @@
the name in the global stash.
=item C<PMC *
-Parrot_find_method_direct(Interp *interp, PMC *_class,
- STRING *method_name)>
+Parrot_find_method_direct(Interp *interp, PMC *_class, STRING *method_name)>
Find a method PMC for a named method, given the class PMC, current
interpreter, and name of the method. Don't use a possible method cache.
@@ -1219,7 +1217,7 @@
*/
-static PMC* find_method_direct(Interp*, PMC *, STRING*);
+static PMC* find_method_direct_1(Interp*, PMC *, STRING*);
void
mark_object_cache(Interp *interp) {
@@ -1313,7 +1311,15 @@
PMC *
Parrot_find_method_direct(Interp *interp, PMC *_class, STRING *method_name)
{
- return find_method_direct(interp, _class, method_name);
+ PMC * const found = find_method_direct_1(interp, _class, method_name);
+ STRING * s1, *s2;
+ if (found)
+ return found;
+ s1 = CONST_STRING(interp, "__get_string");
+ s2 = CONST_STRING(interp, "__get_repr");
+ if (string_equal(interp, method_name, s1) == 0)
+ return find_method_direct_1(interp, _class, s2);
+ return NULL;
}
PMC *
@@ -1329,12 +1335,12 @@
assert(method_name != 0);
#if DISABLE_METH_CACHE
- return find_method_direct(interp, _class, method_name);
+ return Parrot_find_method_direct(interp, _class, method_name);
#endif
is_const = PObj_constant_TEST(method_name);
if (!is_const) {
- return find_method_direct(interp, _class, method_name);
+ return Parrot_find_method_direct(interp, _class, method_name);
}
mc = interp->caches;
type = _class->vtable->base_type;
@@ -1366,7 +1372,7 @@
e = e->next;
}
if (!e) {
- PMC * const found = find_method_direct(interp, _class, method_name);
+ PMC * const found = Parrot_find_method_direct(interp, _class,
method_name);
/* when here no or no correct entry was at [bits] */
e = mem_allocate_typed(Meth_cache_entry);
if (old)
@@ -1441,21 +1447,6 @@
return NULL;
}
-static PMC *
-find_method_direct(Interp *interp, PMC *_class,
- STRING *method_name)
-{
- PMC * const found = find_method_direct_1(interp, _class, method_name);
- STRING * s1, *s2;
- if (found)
- return found;
- s1 = CONST_STRING(interp, "__get_string");
- s2 = CONST_STRING(interp, "__get_repr");
- if (string_equal(interp, method_name, s1) == 0)
- return find_method_direct_1(interp, _class, s2);
- return NULL;
-}
-
/*
=item C<void
Parrot_note_method_offset(Interp *interp, UINTVAL offset, PMC *method)>