|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75938 - trunk/tools/build/v2/engine
From: steven_at_[hidden]
Date: 2011-12-14 13:46:51
Author: steven_watanabe
Date: 2011-12-14 13:46:50 EST (Wed, 14 Dec 2011)
New Revision: 75938
URL: http://svn.boost.org/trac/boost/changeset/75938
Log:
Optimize out the extra PUSH_EMPTY/APPEND when evaluating a list. Reduces the number of instructions executed by about 25%. About a 3-5% improvement in overall runtime.
Text files modified:
trunk/tools/build/v2/engine/function.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
Modified: trunk/tools/build/v2/engine/function.c
==============================================================================
--- trunk/tools/build/v2/engine/function.c (original)
+++ trunk/tools/build/v2/engine/function.c 2011-12-14 13:46:50 EST (Wed, 14 Dec 2011)
@@ -2108,8 +2108,11 @@
compile_emit( c, INSTR_PUSH_APPEND, 0 );
parse = parse->left;
}
- compile_parse( parse->left, c, RESULT_STACK );
- compile_emit( c, INSTR_PUSH_APPEND, 0 );
+ if ( parse->left->type != PARSE_NULL )
+ {
+ compile_parse( parse->left, c, RESULT_STACK );
+ compile_emit( c, INSTR_PUSH_APPEND, 0 );
+ }
adjust_result( c, RESULT_STACK, result_location );
}
else if ( parse->type == PARSE_EVAL )
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk