Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: src/compiler.cc

Issue 1148007: Merge bleeding_edge from version 2.1.3 up to revision 4205... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compilation-cache.cc ('k') | src/contexts.h » ('j') | src/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
===================================================================
--- src/compiler.cc (revision 4205)
+++ src/compiler.cc (working copy)
@@ -79,13 +79,33 @@
return Handle<Code>::null();
}
+ if (function->scope()->num_parameters() > 0 ||
+ function->scope()->num_stack_slots()) {
+ AssignedVariablesAnalyzer ava(function);
+ ava.Analyze();
+ if (ava.HasStackOverflow()) {
+ return Handle<Code>::null();
+ }
+ }
+
if (FLAG_use_flow_graph) {
FlowGraphBuilder builder;
builder.Build(function);
+ if (!builder.HasStackOverflow()) {
+ int variable_count =
+ function->num_parameters() + function->scope()->num_stack_slots();
+ if (variable_count > 0 && builder.definitions()->length() > 0) {
+ ReachingDefinitions rd(builder.postorder(),
+ builder.definitions(),
+ variable_count);
+ rd.Compute();
+ }
+ }
+
#ifdef DEBUG
- if (FLAG_print_graph_text) {
- builder.graph()->PrintText(builder.postorder());
+ if (FLAG_print_graph_text && !builder.HasStackOverflow()) {
+ builder.graph()->PrintText(function, builder.postorder());
}
#endif
}
@@ -467,13 +487,33 @@
return Handle<JSFunction>::null();
}
+ if (literal->scope()->num_parameters() > 0 ||
+ literal->scope()->num_stack_slots()) {
+ AssignedVariablesAnalyzer ava(literal);
+ ava.Analyze();
+ if (ava.HasStackOverflow()) {
+ return Handle<JSFunction>::null();
+ }
+ }
+
if (FLAG_use_flow_graph) {
FlowGraphBuilder builder;
builder.Build(literal);
+ if (!builder.HasStackOverflow()) {
+ int variable_count =
+ literal->num_parameters() + literal->scope()->num_stack_slots();
+ if (variable_count > 0 && builder.definitions()->length() > 0) {
+ ReachingDefinitions rd(builder.postorder(),
+ builder.definitions(),
+ variable_count);
+ rd.Compute();
+ }
+ }
+
#ifdef DEBUG
- if (FLAG_print_graph_text) {
- builder.graph()->PrintText(builder.postorder());
+ if (FLAG_print_graph_text && !builder.HasStackOverflow()) {
+ builder.graph()->PrintText(literal, builder.postorder());
}
#endif
}
« no previous file with comments | « src/compilation-cache.cc ('k') | src/contexts.h » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698