| 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_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/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/code_descriptors.h" | 9 #include "vm/code_descriptors.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2720 if (current->IsDo() && | 2720 if (current->IsDo() && |
| 2721 current->AsDo()->computation()->IsStoreLocal()) { | 2721 current->AsDo()->computation()->IsStoreLocal()) { |
| 2722 store = current->AsDo()->computation()->AsStoreLocal(); | 2722 store = current->AsDo()->computation()->AsStoreLocal(); |
| 2723 } else if (current->IsBind() && | 2723 } else if (current->IsBind() && |
| 2724 current->AsBind()->computation()->IsStoreLocal()) { | 2724 current->AsBind()->computation()->IsStoreLocal()) { |
| 2725 store = current->AsBind()->computation()->AsStoreLocal(); | 2725 store = current->AsBind()->computation()->AsStoreLocal(); |
| 2726 } | 2726 } |
| 2727 | 2727 |
| 2728 if (load != NULL) { | 2728 if (load != NULL) { |
| 2729 // Remove instruction. | 2729 // Remove instruction. |
| 2730 current->RemoveFromGraph(); | 2730 current = current->RemoveFromGraph(); |
| 2731 } else if (store != NULL) { | 2731 } else if (store != NULL) { |
| 2732 // Remove instruction and update renaming environment. | 2732 // Remove instruction and update renaming environment. |
| 2733 current->RemoveFromGraph(); | 2733 current = current->RemoveFromGraph(); |
| 2734 (*env)[store->local().BitIndexIn(var_count)] = store->value(); | 2734 (*env)[store->local().BitIndexIn(var_count)] = store->value(); |
| 2735 } else if (current->IsBind()) { | 2735 } else { |
| 2736 // Assign new SSA temporary. | 2736 if (current->IsBind()) { |
| 2737 current->AsDefinition()->set_ssa_temp_index(current_ssa_temp_index_++); | 2737 // Assign new SSA temporary. |
| 2738 current->AsDefinition()->set_ssa_temp_index(current_ssa_temp_index_++); |
| 2739 } |
| 2740 current = current->successor(); |
| 2738 } | 2741 } |
| 2739 current = current->successor(); | |
| 2740 } | 2742 } |
| 2741 | 2743 |
| 2742 // 3. Process dominated blocks. | 2744 // 3. Process dominated blocks. |
| 2743 for (intptr_t i = 0; i < block_entry->dominated_blocks().length(); ++i) { | 2745 for (intptr_t i = 0; i < block_entry->dominated_blocks().length(); ++i) { |
| 2744 BlockEntryInstr* block = block_entry->dominated_blocks()[i]; | 2746 BlockEntryInstr* block = block_entry->dominated_blocks()[i]; |
| 2745 ZoneGrowableArray<Value*>* new_env = | 2747 ZoneGrowableArray<Value*>* new_env = |
| 2746 new ZoneGrowableArray<Value*>(var_count); | 2748 new ZoneGrowableArray<Value*>(var_count); |
| 2747 new_env->AddArray(*env); | 2749 new_env->AddArray(*env); |
| 2748 RenameRecursive(block, new_env, var_count); | 2750 RenameRecursive(block, new_env, var_count); |
| 2749 } | 2751 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2778 char* chars = reinterpret_cast<char*>( | 2780 char* chars = reinterpret_cast<char*>( |
| 2779 Isolate::Current()->current_zone()->Allocate(len)); | 2781 Isolate::Current()->current_zone()->Allocate(len)); |
| 2780 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2782 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2781 const Error& error = Error::Handle( | 2783 const Error& error = Error::Handle( |
| 2782 LanguageError::New(String::Handle(String::New(chars)))); | 2784 LanguageError::New(String::Handle(String::New(chars)))); |
| 2783 Isolate::Current()->long_jump_base()->Jump(1, error); | 2785 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2784 } | 2786 } |
| 2785 | 2787 |
| 2786 | 2788 |
| 2787 } // namespace dart | 2789 } // namespace dart |
| OLD | NEW |