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

Side by Side Diff: src/compiler.cc

Issue 1155006: Include initial definitions in reaching definitions analysis. (Closed)
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
« no previous file with comments | « no previous file | src/data-flow.h » ('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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 if (function->scope()->num_parameters() > 0 || 82 if (function->scope()->num_parameters() > 0 ||
83 function->scope()->num_stack_slots()) { 83 function->scope()->num_stack_slots()) {
84 AssignedVariablesAnalyzer ava(function); 84 AssignedVariablesAnalyzer ava(function);
85 ava.Analyze(); 85 ava.Analyze();
86 if (ava.HasStackOverflow()) { 86 if (ava.HasStackOverflow()) {
87 return Handle<Code>::null(); 87 return Handle<Code>::null();
88 } 88 }
89 } 89 }
90 90
91 if (FLAG_use_flow_graph) { 91 if (FLAG_use_flow_graph) {
92 FlowGraphBuilder builder; 92 int variable_count =
93 function->num_parameters() + function->scope()->num_stack_slots();
94 FlowGraphBuilder builder(variable_count);
93 builder.Build(function); 95 builder.Build(function);
94 96
95 if (!builder.HasStackOverflow()) { 97 if (!builder.HasStackOverflow()) {
96 int variable_count = 98 if (variable_count > 0) {
97 function->num_parameters() + function->scope()->num_stack_slots();
98 if (variable_count > 0 && builder.definitions()->length() > 0) {
99 ReachingDefinitions rd(builder.postorder(), 99 ReachingDefinitions rd(builder.postorder(),
100 builder.definitions(), 100 builder.body_definitions(),
101 variable_count); 101 variable_count);
102 rd.Compute(); 102 rd.Compute();
103 } 103 }
104 } 104 }
105 105
106 #ifdef DEBUG 106 #ifdef DEBUG
107 if (FLAG_print_graph_text && !builder.HasStackOverflow()) { 107 if (FLAG_print_graph_text && !builder.HasStackOverflow()) {
108 builder.graph()->PrintText(builder.postorder()); 108 builder.graph()->PrintText(builder.postorder());
109 } 109 }
110 #endif 110 #endif
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 if (literal->scope()->num_parameters() > 0 || 490 if (literal->scope()->num_parameters() > 0 ||
491 literal->scope()->num_stack_slots()) { 491 literal->scope()->num_stack_slots()) {
492 AssignedVariablesAnalyzer ava(literal); 492 AssignedVariablesAnalyzer ava(literal);
493 ava.Analyze(); 493 ava.Analyze();
494 if (ava.HasStackOverflow()) { 494 if (ava.HasStackOverflow()) {
495 return Handle<JSFunction>::null(); 495 return Handle<JSFunction>::null();
496 } 496 }
497 } 497 }
498 498
499 if (FLAG_use_flow_graph) { 499 if (FLAG_use_flow_graph) {
500 FlowGraphBuilder builder; 500 int variable_count =
501 literal->num_parameters() + literal->scope()->num_stack_slots();
502 FlowGraphBuilder builder(variable_count);
501 builder.Build(literal); 503 builder.Build(literal);
502 504
503 if (!builder.HasStackOverflow()) { 505 if (!builder.HasStackOverflow()) {
504 int variable_count = 506 if (variable_count > 0) {
505 literal->num_parameters() + literal->scope()->num_stack_slots();
506 if (variable_count > 0 && builder.definitions()->length() > 0) {
507 ReachingDefinitions rd(builder.postorder(), 507 ReachingDefinitions rd(builder.postorder(),
508 builder.definitions(), 508 builder.body_definitions(),
509 variable_count); 509 variable_count);
510 rd.Compute(); 510 rd.Compute();
511 } 511 }
512 } 512 }
513 513
514 #ifdef DEBUG 514 #ifdef DEBUG
515 if (FLAG_print_graph_text && !builder.HasStackOverflow()) { 515 if (FLAG_print_graph_text && !builder.HasStackOverflow()) {
516 builder.graph()->PrintText(builder.postorder()); 516 builder.graph()->PrintText(builder.postorder());
517 } 517 }
518 #endif 518 #endif
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 LOG(CodeCreateEvent(tag, *code, *func_name)); 637 LOG(CodeCreateEvent(tag, *code, *func_name));
638 OProfileAgent::CreateNativeCodeRegion(*func_name, 638 OProfileAgent::CreateNativeCodeRegion(*func_name,
639 code->instruction_start(), 639 code->instruction_start(),
640 code->instruction_size()); 640 code->instruction_size());
641 } 641 }
642 } 642 }
643 } 643 }
644 #endif 644 #endif
645 645
646 } } // namespace v8::internal 646 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/data-flow.h » ('j') | src/data-flow.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698