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

Side by Side Diff: src/compiler.cc

Issue 885004: Only invoke reaching definitions if there are >0 variables and >0 definitions... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/data-flow.cc » ('j') | src/data-flow.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 } 89 }
90 90
91 if (FLAG_use_flow_graph) { 91 if (FLAG_use_flow_graph) {
92 FlowGraphBuilder builder; 92 FlowGraphBuilder builder;
93 builder.Build(function); 93 builder.Build(function);
94 94
95 if (!builder.HasStackOverflow()) { 95 if (!builder.HasStackOverflow()) {
96 int variable_count = 96 int variable_count =
97 function->num_parameters() + function->scope()->num_stack_slots(); 97 function->num_parameters() + function->scope()->num_stack_slots();
98 ReachingDefinitions rd(builder.postorder(), 98 if (variable_count > 0 && builder.definitions()->length() > 0) {
Kevin Millikin (Chromium) 2010/03/12 14:58:16 Hmm. I'd let the ReachingDefinitions class check
99 builder.definitions(), 99 ReachingDefinitions rd(builder.postorder(),
100 variable_count); 100 builder.definitions(),
101 rd.Compute(); 101 variable_count);
102 rd.Compute();
103 }
102 } 104 }
103 105
104 #ifdef DEBUG 106 #ifdef DEBUG
105 if (FLAG_print_graph_text && !builder.HasStackOverflow()) { 107 if (FLAG_print_graph_text && !builder.HasStackOverflow()) {
106 builder.graph()->PrintText(builder.postorder()); 108 builder.graph()->PrintText(builder.postorder());
107 } 109 }
108 #endif 110 #endif
109 } 111 }
110 112
111 // Generate code and return it. Code generator selection is governed by 113 // Generate code and return it. Code generator selection is governed by
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 } 492 }
491 } 493 }
492 494
493 if (FLAG_use_flow_graph) { 495 if (FLAG_use_flow_graph) {
494 FlowGraphBuilder builder; 496 FlowGraphBuilder builder;
495 builder.Build(literal); 497 builder.Build(literal);
496 498
497 if (!builder.HasStackOverflow()) { 499 if (!builder.HasStackOverflow()) {
498 int variable_count = 500 int variable_count =
499 literal->num_parameters() + literal->scope()->num_stack_slots(); 501 literal->num_parameters() + literal->scope()->num_stack_slots();
500 ReachingDefinitions rd(builder.postorder(), 502 if (variable_count > 0 && builder.definitions()->length() > 0) {
501 builder.definitions(), 503 ReachingDefinitions rd(builder.postorder(),
502 variable_count); 504 builder.definitions(),
503 rd.Compute(); 505 variable_count);
506 rd.Compute();
507 }
504 } 508 }
505 509
506 #ifdef DEBUG 510 #ifdef DEBUG
507 if (FLAG_print_graph_text && !builder.HasStackOverflow()) { 511 if (FLAG_print_graph_text && !builder.HasStackOverflow()) {
508 builder.graph()->PrintText(builder.postorder()); 512 builder.graph()->PrintText(builder.postorder());
509 } 513 }
510 #endif 514 #endif
511 } 515 }
512 516
513 // Generate code and return it. The way that the compilation mode 517 // Generate code and return it. The way that the compilation mode
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 LOG(CodeCreateEvent(tag, *code, *func_name)); 633 LOG(CodeCreateEvent(tag, *code, *func_name));
630 OProfileAgent::CreateNativeCodeRegion(*func_name, 634 OProfileAgent::CreateNativeCodeRegion(*func_name,
631 code->instruction_start(), 635 code->instruction_start(),
632 code->instruction_size()); 636 code->instruction_size());
633 } 637 }
634 } 638 }
635 } 639 }
636 #endif 640 #endif
637 641
638 } } // namespace v8::internal 642 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/data-flow.cc » ('j') | src/data-flow.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698