| 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
|
| }
|
|
|