Reviewers: Vyacheslav Egorov,
Description:
Fix intermittent stack overflow in Hydrogen code generation in tests.
Please review this at https://chromiumcodereview.appspot.com/9290044/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/hydrogen.h
M src/hydrogen.cc
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc (revision 10510)
+++ src/hydrogen.cc (working copy)
@@ -4798,7 +4798,8 @@
// Do a quick check on source code length to avoid parsing large
// inlining candidates.
- if (FLAG_limit_inlining && target->shared()->SourceSize() >
kMaxSourceSize) {
+ if ((FLAG_limit_inlining && target->shared()->SourceSize() >
kSmallMaxSourceSize) ||
+ target->shared()->SourceSize() > kBigMaxSourceSize) {
TraceInline(target, caller, "target text too big");
return false;
}
@@ -4846,7 +4847,8 @@
}
// We don't want to add more than a certain number of nodes from
inlining.
- if (FLAG_limit_inlining && inlined_count_ > kMaxInlinedNodes) {
+ if ((FLAG_limit_inlining && inlined_count_ > kSmallMaxInlinedNodes) ||
+ inlined_count_ > kBigMaxInlinedNodes) {
TraceInline(target, caller, "cumulative AST node limit reached");
return false;
}
@@ -4874,7 +4876,8 @@
// Count the number of AST nodes added by inlining this call.
int nodes_added = AstNode::Count() - count_before;
- if (FLAG_limit_inlining && nodes_added > kMaxInlinedSize) {
+ if ((FLAG_limit_inlining && nodes_added > kSmallMaxInlinedSize) ||
+ nodes_added > kBigMaxInlinedSize) {
TraceInline(target, caller, "target AST is too large");
return false;
}
Index: src/hydrogen.h
===================================================================
--- src/hydrogen.h (revision 10510)
+++ src/hydrogen.h (working copy)
@@ -769,10 +769,14 @@
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;
+ static const int kSmallMaxInlinedNodes = 196;
+ static const int kSmallMaxInlinedSize = 196;
+ static const int kSmallMaxSourceSize = 600;
+ static const int kBigMaxInlinedNodes = 1000;
+ static const int kBigMaxInlinedSize = 1000;
+ static const int kBigMaxSourceSize = 600;
+
// Simple accessors.
void set_function_state(FunctionState* state) { function_state_ = state;
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev