Chicken: Minor optimization to the exported constructor functions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7157 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cee86ee739
commit
33fda759d4
1 changed files with 13 additions and 5 deletions
|
|
@ -69,6 +69,7 @@ static String *short_class_name = 0;
|
||||||
static int in_class = 0;
|
static int in_class = 0;
|
||||||
static int have_constructor = 0;
|
static int have_constructor = 0;
|
||||||
static bool exporting_destructor = false;
|
static bool exporting_destructor = false;
|
||||||
|
static bool exporting_constructor = false;
|
||||||
static String *constructor_name = 0;
|
static String *constructor_name = 0;
|
||||||
static String *member_name = 0;
|
static String *member_name = 0;
|
||||||
|
|
||||||
|
|
@ -558,12 +559,17 @@ CHICKEN::functionWrapper(Node *n)
|
||||||
|
|
||||||
/* check for chickenfastproxy flag */
|
/* check for chickenfastproxy flag */
|
||||||
if (Getattr(n, "tmap:out:chickenfastproxy")) {
|
if (Getattr(n, "tmap:out:chickenfastproxy")) {
|
||||||
/* can only do fast proxy if there are no argout paramaters... */
|
if (exporting_constructor && clos && hide_primitive) {
|
||||||
if (Wrapper_check_local(f, "gswig_list_p")) {
|
/* Don't return a proxy, the wrapped CLOS class is the proxy */
|
||||||
Replaceall(tm, "$proxy", "1");
|
|
||||||
} else {
|
|
||||||
Replaceall(tm, "$proxy", "0");
|
Replaceall(tm, "$proxy", "0");
|
||||||
return_proxy_fastcall = 1;
|
} else {
|
||||||
|
/* can only do fast proxy if there are no argout paramaters... */
|
||||||
|
if (Wrapper_check_local(f, "gswig_list_p")) {
|
||||||
|
Replaceall(tm, "$proxy", "1");
|
||||||
|
} else {
|
||||||
|
Replaceall(tm, "$proxy", "0");
|
||||||
|
return_proxy_fastcall = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Printf(f->code, "%s", tm);
|
Printf(f->code, "%s", tm);
|
||||||
|
|
@ -1263,7 +1269,9 @@ CHICKEN::constructorHandler(Node *n)
|
||||||
has_constructor_args = 0;
|
has_constructor_args = 0;
|
||||||
|
|
||||||
|
|
||||||
|
exporting_constructor = true;
|
||||||
Language::constructorHandler(n);
|
Language::constructorHandler(n);
|
||||||
|
exporting_constructor = false;
|
||||||
|
|
||||||
has_constructor_args = 1;
|
has_constructor_args = 1;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue