Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. | 
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without | 
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are | 
| 4 // met: | 4 // met: | 
| 5 // | 5 // | 
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright | 
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. | 
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above | 
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following | 
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided | 
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 // Signal a stack overflow by returning a null handle. The stack | 77 // Signal a stack overflow by returning a null handle. The stack | 
| 78 // overflow exception will be thrown by the caller. | 78 // overflow exception will be thrown by the caller. | 
| 79 return Handle<Code>::null(); | 79 return Handle<Code>::null(); | 
| 80 } | 80 } | 
| 81 | 81 | 
| 82 if (FLAG_use_flow_graph) { | 82 if (FLAG_use_flow_graph) { | 
| 83 FlowGraphBuilder builder; | 83 FlowGraphBuilder builder; | 
| 84 builder.Build(function); | 84 builder.Build(function); | 
| 85 | 85 | 
| 86 #ifdef DEBUG | 86 #ifdef DEBUG | 
| 87 if (FLAG_print_graph_text) { | 87 if (FLAG_print_graph_text && !builder.HasStackOverflow()) { | 
| 88 builder.graph()->PrintText(builder.postorder()); | 88 builder.graph()->PrintText(builder.postorder()); | 
| 89 } | 89 } | 
| 90 #endif | 90 #endif | 
| 91 } | 91 } | 
| 92 | 92 | 
| 93 // Generate code and return it. Code generator selection is governed by | 93 // Generate code and return it. Code generator selection is governed by | 
| 94 // which backends are enabled and whether the function is considered | 94 // which backends are enabled and whether the function is considered | 
| 95 // run-once code or not: | 95 // run-once code or not: | 
| 96 // | 96 // | 
| 97 // --full-compiler enables the dedicated backend for code we expect to be | 97 // --full-compiler enables the dedicated backend for code we expect to be | 
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 461 // the AST optimizer/analyzer. | 461 // the AST optimizer/analyzer. | 
| 462 if (!Rewriter::Optimize(literal)) { | 462 if (!Rewriter::Optimize(literal)) { | 
| 463 return Handle<JSFunction>::null(); | 463 return Handle<JSFunction>::null(); | 
| 464 } | 464 } | 
| 465 | 465 | 
| 466 if (FLAG_use_flow_graph) { | 466 if (FLAG_use_flow_graph) { | 
| 467 FlowGraphBuilder builder; | 467 FlowGraphBuilder builder; | 
| 468 builder.Build(literal); | 468 builder.Build(literal); | 
| 469 | 469 | 
| 470 #ifdef DEBUG | 470 #ifdef DEBUG | 
| 471 if (FLAG_print_graph_text) { | 471 if (FLAG_print_graph_text) { | 
| 
 
fschneider
2010/03/10 16:51:09
Also check for stack overflow here?
 
 | |
| 472 builder.graph()->PrintText(builder.postorder()); | 472 builder.graph()->PrintText(builder.postorder()); | 
| 473 } | 473 } | 
| 474 #endif | 474 #endif | 
| 475 } | 475 } | 
| 476 | 476 | 
| 477 // Generate code and return it. The way that the compilation mode | 477 // Generate code and return it. The way that the compilation mode | 
| 478 // is controlled by the command-line flags is described in | 478 // is controlled by the command-line flags is described in | 
| 479 // the static helper function MakeCode. | 479 // the static helper function MakeCode. | 
| 480 CompilationInfo info(literal, script, false); | 480 CompilationInfo info(literal, script, false); | 
| 481 | 481 | 
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 593 LOG(CodeCreateEvent(tag, *code, *func_name)); | 593 LOG(CodeCreateEvent(tag, *code, *func_name)); | 
| 594 OProfileAgent::CreateNativeCodeRegion(*func_name, | 594 OProfileAgent::CreateNativeCodeRegion(*func_name, | 
| 595 code->instruction_start(), | 595 code->instruction_start(), | 
| 596 code->instruction_size()); | 596 code->instruction_size()); | 
| 597 } | 597 } | 
| 598 } | 598 } | 
| 599 } | 599 } | 
| 600 #endif | 600 #endif | 
| 601 | 601 | 
| 602 } } // namespace v8::internal | 602 } } // namespace v8::internal | 
| OLD | NEW |