Revision: 11397
Author: [email protected]
Date: Fri Apr 20 03:42:12 2012
Log: Replaced the --limit-inling flag by three separate flags and
bumped hard limits.
This change makes experiments with inlining limits much easier. Note that
the
default values for the limits keep their old values for now. Renamed things
a
bit for more consistency.
Review URL: https://chromiumcodereview.appspot.com/10162001
http://code.google.com/p/v8/source/detail?r=11397
Modified:
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/flag-definitions.h
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/hydrogen.h
/branches/bleeding_edge/test/mjsunit/compiler/alloc-object-huge.js
=======================================
--- /branches/bleeding_edge/src/api.cc Fri Apr 20 03:21:08 2012
+++ /branches/bleeding_edge/src/api.cc Fri Apr 20 03:42:12 2012
@@ -6321,7 +6321,11 @@
void Testing::PrepareStressRun(int run) {
static const char* kLazyOptimizations =
- "--prepare-always-opt --nolimit-inlining --noalways-opt";
+ "--prepare-always-opt "
+ "--max-inlined-source-size=999999 "
+ "--max-inlined-nodes=999999 "
+ "--max-inlined-nodes-cumulative=999999 "
+ "--noalways-opt";
static const char* kForcedOptimizations = "--always-opt";
// If deoptimization stressed turn on frequent deoptimization. If no
value
=======================================
--- /branches/bleeding_edge/src/flag-definitions.h Thu Apr 5 07:01:39 2012
+++ /branches/bleeding_edge/src/flag-definitions.h Fri Apr 20 03:42:12 2012
@@ -165,7 +165,12 @@
DEFINE_bool(use_gvn, true, "use hydrogen global value numbering")
DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction
canonicalizing")
DEFINE_bool(use_inlining, true, "use function inlining")
-DEFINE_bool(limit_inlining, true, "limit code size growth from inlining")
+DEFINE_int(max_inlined_source_size, 600,
+ "maximum source size in bytes considered for a single inlining")
+DEFINE_int(max_inlined_nodes, 196,
+ "maximum number of AST nodes considered for a single inlining")
+DEFINE_int(max_inlined_nodes_cumulative, 196,
+ "maximum cumulative number of AST nodes considered for
inlining")
DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion")
DEFINE_bool(collect_megamorphic_maps_from_stub_cache,
true,
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Wed Apr 18 02:38:45 2012
+++ /branches/bleeding_edge/src/hydrogen.cc Fri Apr 20 03:42:12 2012
@@ -5355,8 +5355,8 @@
// Do a quick check on source code length to avoid parsing large
// inlining candidates.
- if ((FLAG_limit_inlining && target_shared->SourceSize() > kMaxSourceSize)
- || target_shared->SourceSize() > kUnlimitedMaxSourceSize) {
+ if (target_shared->SourceSize() >
+ Min(FLAG_max_inlined_source_size, kUnlimitedMaxInlinedSourceSize)) {
TraceInline(target, caller, "target text too big");
return false;
}
@@ -5372,8 +5372,7 @@
}
int nodes_added = target_shared->ast_node_count();
- if ((FLAG_limit_inlining && nodes_added > kMaxInlinedSize) ||
- nodes_added > kUnlimitedMaxInlinedSize) {
+ if (nodes_added > Min(FLAG_max_inlined_nodes,
kUnlimitedMaxInlinedNodes)) {
TraceInline(target, caller, "target AST is too large [early]");
return false;
}
@@ -5415,8 +5414,8 @@
}
// We don't want to add more than a certain number of nodes from
inlining.
- if ((FLAG_limit_inlining && inlined_count_ > kMaxInlinedNodes) ||
- inlined_count_ > kUnlimitedMaxInlinedNodes) {
+ if (inlined_count_ > Min(FLAG_max_inlined_nodes_cumulative,
+ kUnlimitedMaxInlinedNodesCumulative)) {
TraceInline(target, caller, "cumulative AST node limit reached");
return false;
}
@@ -5443,8 +5442,7 @@
// The following conditions must be checked again after re-parsing,
because
// earlier the information might not have been complete due to lazy
parsing.
nodes_added = function->ast_node_count();
- if ((FLAG_limit_inlining && nodes_added > kMaxInlinedSize) ||
- nodes_added > kUnlimitedMaxInlinedSize) {
+ if (nodes_added > Min(FLAG_max_inlined_nodes,
kUnlimitedMaxInlinedNodes)) {
TraceInline(target, caller, "target AST is too large [late]");
return false;
}
=======================================
--- /branches/bleeding_edge/src/hydrogen.h Mon Apr 16 05:26:16 2012
+++ /branches/bleeding_edge/src/hydrogen.h Fri Apr 20 03:42:12 2012
@@ -868,15 +868,11 @@
static const int kMaxLoadPolymorphism = 4;
static const int kMaxStorePolymorphism = 4;
- static const int kMaxInlinedNodes = 196;
- static const int kMaxInlinedSize = 196;
- static const int kMaxSourceSize = 600;
-
// Even in the 'unlimited' case we have to have some limit in order not
to
// overflow the stack.
- static const int kUnlimitedMaxInlinedNodes = 1000;
- static const int kUnlimitedMaxInlinedSize = 1000;
- static const int kUnlimitedMaxSourceSize = 600;
+ static const int kUnlimitedMaxInlinedSourceSize = 100000;
+ static const int kUnlimitedMaxInlinedNodes = 10000;
+ static const int kUnlimitedMaxInlinedNodesCumulative = 10000;
// Simple accessors.
void set_function_state(FunctionState* state) { function_state_ = state;
}
=======================================
--- /branches/bleeding_edge/test/mjsunit/compiler/alloc-object-huge.js Thu
Mar 1 03:10:28 2012
+++ /branches/bleeding_edge/test/mjsunit/compiler/alloc-object-huge.js Fri
Apr 20 03:42:12 2012
@@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax --inline-construct --nolimit-inlining
+// Flags: --allow-natives-syntax --inline-construct
--max-inlined-source-size=999999 --max-inlined-nodes=999999
--max-inlined-nodes-cumulative=999999
// Test that huge constructors (more than 256 this assignments) are
// handled correctly.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev