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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 entry_ = do_instr; | 89 entry_ = do_instr; |
90 } else { | 90 } else { |
91 exit()->set_next(do_instr); | 91 exit()->set_next(do_instr); |
92 } | 92 } |
93 exit_ = do_instr; | 93 exit_ = do_instr; |
94 } | 94 } |
95 | 95 |
96 | 96 |
97 void EffectGraphVisitor::AddInstruction(Instruction* instruction) { | 97 void EffectGraphVisitor::AddInstruction(Instruction* instruction) { |
98 ASSERT(is_open()); | 98 ASSERT(is_open()); |
99 ASSERT(!instruction->IsDefinition()); | 99 ASSERT(!instruction->IsBind()); |
100 ASSERT(!instruction->IsBlockEntry()); | 100 ASSERT(!instruction->IsBlockEntry()); |
101 DeallocateTempIndex(instruction->InputCount()); | 101 DeallocateTempIndex(instruction->InputCount()); |
102 if (is_empty()) { | 102 if (is_empty()) { |
103 entry_ = exit_ = instruction; | 103 entry_ = exit_ = instruction; |
104 } else { | 104 } else { |
105 exit()->set_next(instruction); | 105 exit()->set_next(instruction); |
106 exit_ = instruction; | 106 exit_ = instruction; |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
(...skipping 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2744 // Assign fresh SSA temporary and update expression stack. | 2744 // Assign fresh SSA temporary and update expression stack. |
2745 bind->set_ssa_temp_index(alloc_ssa_temp_index()); | 2745 bind->set_ssa_temp_index(alloc_ssa_temp_index()); |
2746 env->Add(new UseVal(bind)); | 2746 env->Add(new UseVal(bind)); |
2747 } | 2747 } |
2748 } | 2748 } |
2749 } | 2749 } |
2750 | 2750 |
2751 // 2c. Handle pushed argument. | 2751 // 2c. Handle pushed argument. |
2752 PushArgumentInstr* push = current->AsPushArgument(); | 2752 PushArgumentInstr* push = current->AsPushArgument(); |
2753 if (push != NULL) { | 2753 if (push != NULL) { |
2754 env->Add(push->value()); | 2754 env->Add(new UseVal(push)); |
2755 } | 2755 } |
2756 } | 2756 } |
2757 | 2757 |
2758 // 3. Process dominated blocks. | 2758 // 3. Process dominated blocks. |
2759 for (intptr_t i = 0; i < block_entry->dominated_blocks().length(); ++i) { | 2759 for (intptr_t i = 0; i < block_entry->dominated_blocks().length(); ++i) { |
2760 BlockEntryInstr* block = block_entry->dominated_blocks()[i]; | 2760 BlockEntryInstr* block = block_entry->dominated_blocks()[i]; |
2761 GrowableArray<Value*> new_env(env->length()); | 2761 GrowableArray<Value*> new_env(env->length()); |
2762 new_env.AddArray(*env); | 2762 new_env.AddArray(*env); |
2763 RenameRecursive(block, &new_env, live_phis); | 2763 RenameRecursive(block, &new_env, live_phis); |
2764 } | 2764 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2809 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2809 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
2810 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2810 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
2811 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2811 OS::SNPrint(chars, len, kFormat, function_name, reason); |
2812 const Error& error = Error::Handle( | 2812 const Error& error = Error::Handle( |
2813 LanguageError::New(String::Handle(String::New(chars)))); | 2813 LanguageError::New(String::Handle(String::New(chars)))); |
2814 Isolate::Current()->long_jump_base()->Jump(1, error); | 2814 Isolate::Current()->long_jump_base()->Jump(1, error); |
2815 } | 2815 } |
2816 | 2816 |
2817 | 2817 |
2818 } // namespace dart | 2818 } // namespace dart |
OLD | NEW |