| OLD | NEW |
| 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.h" | 5 #include "vm/flow_graph.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 new Environment(start_env, non_copied_parameter_count_)); | 282 new Environment(start_env, non_copied_parameter_count_)); |
| 283 | 283 |
| 284 BlockEntryInstr* normal_entry = graph_entry_->SuccessorAt(0); | 284 BlockEntryInstr* normal_entry = graph_entry_->SuccessorAt(0); |
| 285 ASSERT(normal_entry != NULL); // Must have entry. | 285 ASSERT(normal_entry != NULL); // Must have entry. |
| 286 GrowableArray<Definition*> env(variable_count()); | 286 GrowableArray<Definition*> env(variable_count()); |
| 287 env.AddArray(start_env); | 287 env.AddArray(start_env); |
| 288 RenameRecursive(normal_entry, &env, live_phis); | 288 RenameRecursive(normal_entry, &env, live_phis); |
| 289 } | 289 } |
| 290 | 290 |
| 291 | 291 |
| 292 // Helper to either use the constant value of a defintion or the defintion. | 292 // Helper to either use the constant value of a definition or the definition. |
| 293 static Value* UseDefinition(Definition* defn) { | 293 static Value* UseDefinition(Definition* defn) { |
| 294 if (defn->IsBind() && defn->AsBind()->computation()->IsConstant()) { | 294 if (defn->IsBind() && defn->AsBind()->computation()->IsConstant()) { |
| 295 return defn->AsBind()->computation()->AsConstant(); | 295 return defn->AsBind()->computation()->AsConstant(); |
| 296 } else { | 296 } else { |
| 297 return new UseVal(defn); | 297 return new UseVal(defn); |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 | 300 |
| 301 | 301 |
| 302 void FlowGraph::RenameRecursive(BlockEntryInstr* block_entry, | 302 void FlowGraph::RenameRecursive(BlockEntryInstr* block_entry, |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 463 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 464 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 464 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 465 OS::SNPrint(chars, len, kFormat, function_name, reason); | 465 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 466 const Error& error = Error::Handle( | 466 const Error& error = Error::Handle( |
| 467 LanguageError::New(String::Handle(String::New(chars)))); | 467 LanguageError::New(String::Handle(String::New(chars)))); |
| 468 Isolate::Current()->long_jump_base()->Jump(1, error); | 468 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 469 } | 469 } |
| 470 | 470 |
| 471 | 471 |
| 472 } // namespace dart | 472 } // namespace dart |
| OLD | NEW |