projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85a8a98
)
Optimize away calls to empty DESTROY methods
author
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Tue, 20 Jan 2009 08:11:18 +0000
(09:11 +0100)
committer
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Tue, 20 Jan 2009 08:11:18 +0000
(09:11 +0100)
sv.c
patch
|
blob
|
history
diff --git
a/sv.c
b/sv.c
index
d944e2f
..
ae728b1
100644
(file)
--- a/
sv.c
+++ b/
sv.c
@@
-5655,7
+5655,11
@@
Perl_sv_clear(pTHX_ register SV *const sv)
CV* destructor;
stash = SvSTASH(sv);
destructor = StashHANDLER(stash,DESTROY);
- if (destructor) {
+ if (destructor
+ /* Don't bother calling an empty destructor */
+ && (CvISXSUB(destructor)
+ || CvSTART(destructor)->op_next->op_type != OP_LEAVESUB))
+ {
SV* const tmpref = newRV(sv);
SvREADONLY_on(tmpref); /* DESTROY() could be naughty */
ENTER;