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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 function->num_parameters() + function->scope()->num_stack_slots(); | 93 function->num_parameters() + function->scope()->num_stack_slots(); |
94 FlowGraphBuilder builder(variable_count); | 94 FlowGraphBuilder builder(variable_count); |
95 builder.Build(function); | 95 builder.Build(function); |
96 | 96 |
97 if (!builder.HasStackOverflow()) { | 97 if (!builder.HasStackOverflow()) { |
98 if (variable_count > 0) { | 98 if (variable_count > 0) { |
99 ReachingDefinitions rd(builder.postorder(), | 99 ReachingDefinitions rd(builder.postorder(), |
100 builder.body_definitions(), | 100 builder.body_definitions(), |
101 variable_count); | 101 variable_count); |
102 rd.Compute(); | 102 rd.Compute(); |
| 103 |
| 104 TypeAnalyzer ta(builder.postorder(), |
| 105 builder.body_definitions(), |
| 106 variable_count, |
| 107 function->num_parameters()); |
| 108 ta.Compute(); |
103 } | 109 } |
104 } | 110 } |
105 | 111 |
106 #ifdef DEBUG | 112 #ifdef DEBUG |
107 if (FLAG_print_graph_text && !builder.HasStackOverflow()) { | 113 if (FLAG_print_graph_text && !builder.HasStackOverflow()) { |
108 builder.graph()->PrintText(function, builder.postorder()); | 114 builder.graph()->PrintText(function, builder.postorder()); |
109 } | 115 } |
110 #endif | 116 #endif |
111 } | 117 } |
112 | 118 |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 return Handle<JSFunction>::null(); | 501 return Handle<JSFunction>::null(); |
496 } | 502 } |
497 } | 503 } |
498 | 504 |
499 if (FLAG_use_flow_graph) { | 505 if (FLAG_use_flow_graph) { |
500 int variable_count = | 506 int variable_count = |
501 literal->num_parameters() + literal->scope()->num_stack_slots(); | 507 literal->num_parameters() + literal->scope()->num_stack_slots(); |
502 FlowGraphBuilder builder(variable_count); | 508 FlowGraphBuilder builder(variable_count); |
503 builder.Build(literal); | 509 builder.Build(literal); |
504 | 510 |
505 if (!builder.HasStackOverflow()) { | 511 if (!builder.HasStackOverflow()) { |
506 if (variable_count > 0) { | 512 if (variable_count > 0) { |
507 ReachingDefinitions rd(builder.postorder(), | 513 ReachingDefinitions rd(builder.postorder(), |
508 builder.body_definitions(), | 514 builder.body_definitions(), |
509 variable_count); | 515 variable_count); |
510 rd.Compute(); | 516 rd.Compute(); |
| 517 |
| 518 TypeAnalyzer ta(builder.postorder(), |
| 519 builder.body_definitions(), |
| 520 variable_count, |
| 521 literal->num_parameters()); |
| 522 ta.Compute(); |
| 523 } |
511 } | 524 } |
512 } | |
513 | 525 |
514 #ifdef DEBUG | 526 #ifdef DEBUG |
515 if (FLAG_print_graph_text && !builder.HasStackOverflow()) { | 527 if (FLAG_print_graph_text && !builder.HasStackOverflow()) { |
516 builder.graph()->PrintText(literal, builder.postorder()); | 528 builder.graph()->PrintText(literal, builder.postorder()); |
517 } | 529 } |
518 #endif | 530 #endif |
519 } | 531 } |
520 | 532 |
521 // Generate code and return it. The way that the compilation mode | 533 // Generate code and return it. The way that the compilation mode |
522 // is controlled by the command-line flags is described in | 534 // is controlled by the command-line flags is described in |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 LOG(CodeCreateEvent(tag, *code, *func_name)); | 649 LOG(CodeCreateEvent(tag, *code, *func_name)); |
638 OProfileAgent::CreateNativeCodeRegion(*func_name, | 650 OProfileAgent::CreateNativeCodeRegion(*func_name, |
639 code->instruction_start(), | 651 code->instruction_start(), |
640 code->instruction_size()); | 652 code->instruction_size()); |
641 } | 653 } |
642 } | 654 } |
643 } | 655 } |
644 #endif | 656 #endif |
645 | 657 |
646 } } // namespace v8::internal | 658 } } // namespace v8::internal |
OLD | NEW |