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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 12313033: Revert "Change the SSA construction pass to also construct def-use chains." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "vm/ast_printer.h" 7 #include "vm/ast_printer.h"
8 #include "vm/code_descriptors.h" 8 #include "vm/code_descriptors.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // Insert the callee graph into the caller graph. First sort the list of 129 // Insert the callee graph into the caller graph. First sort the list of
130 // exits by block id (recording block entries as a side effect). 130 // exits by block id (recording block entries as a side effect).
131 SortExits(); 131 SortExits();
132 intptr_t num_exits = exits_.length(); 132 intptr_t num_exits = exits_.length();
133 if (num_exits == 0) { 133 if (num_exits == 0) {
134 // TODO(zerny): Add support for non-local exits, such as throw. 134 // TODO(zerny): Add support for non-local exits, such as throw.
135 UNREACHABLE(); 135 UNREACHABLE();
136 } else if (num_exits == 1) { 136 } else if (num_exits == 1) {
137 // For just one exit, replace the uses and remove the call from the graph. 137 // For just one exit, replace the uses and remove the call from the graph.
138 call->ReplaceUsesWith(ValueAt(0)->definition()); 138 call->ReplaceUsesWith(ValueAt(0)->definition());
139 ValueAt(0)->RemoveFromUseList();
140 call->previous()->LinkTo(callee_entry->next()); 139 call->previous()->LinkTo(callee_entry->next());
141 LastInstructionAt(0)->LinkTo(call->next()); 140 LastInstructionAt(0)->LinkTo(call->next());
142 // In case of control flow, locally update the predecessors, phis and 141 // In case of control flow, locally update the predecessors, phis and
143 // dominator tree. 142 // dominator tree.
144 // TODO(zerny): should we leave the dominator tree since we recompute it 143 // TODO(zerny): should we leave the dominator tree since we recompute it
145 // after a full inlining pass? 144 // after a full inlining pass?
146 if (callee_graph->preorder().length() > 2) { 145 if (callee_graph->preorder().length() > 2) {
147 BlockEntryInstr* exit_block = ExitBlockAt(0); 146 BlockEntryInstr* exit_block = ExitBlockAt(0);
148 // Pictorially, the graph structure is: 147 // Pictorially, the graph structure is:
149 // 148 //
(...skipping 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after
3243 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 3242 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3244 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 3243 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3245 OS::SNPrint(chars, len, kFormat, function_name, reason); 3244 OS::SNPrint(chars, len, kFormat, function_name, reason);
3246 const Error& error = Error::Handle( 3245 const Error& error = Error::Handle(
3247 LanguageError::New(String::Handle(String::New(chars)))); 3246 LanguageError::New(String::Handle(String::New(chars))));
3248 Isolate::Current()->long_jump_base()->Jump(1, error); 3247 Isolate::Current()->long_jump_base()->Jump(1, error);
3249 } 3248 }
3250 3249
3251 3250
3252 } // namespace dart 3251 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698