| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #undef DEFINE_ACCEPT | 74 #undef DEFINE_ACCEPT |
| 75 | 75 |
| 76 | 76 |
| 77 void ForwardInstructionIterator::RemoveCurrentFromGraph() { | 77 void ForwardInstructionIterator::RemoveCurrentFromGraph() { |
| 78 ASSERT(!current_->IsBlockEntry()); | 78 ASSERT(!current_->IsBlockEntry()); |
| 79 ASSERT(!current_->IsBranch()); | 79 ASSERT(!current_->IsBranch()); |
| 80 ASSERT(!current_->IsThrow()); | 80 ASSERT(!current_->IsThrow()); |
| 81 ASSERT(!current_->IsReturn()); | 81 ASSERT(!current_->IsReturn()); |
| 82 ASSERT(!current_->IsReThrow()); | 82 ASSERT(!current_->IsReThrow()); |
| 83 ASSERT(current_->previous() != NULL); | 83 ASSERT(current_->previous() != NULL); |
| 84 ASSERT(current_ != block_entry_->last_instruction()); |
| 84 Instruction* prev = current_->previous(); | 85 Instruction* prev = current_->previous(); |
| 85 Instruction* next = current_->next(); | 86 Instruction* next = current_->next(); |
| 87 ASSERT(next != NULL); |
| 88 ASSERT(!next->IsBlockEntry()); |
| 86 prev->set_next(next); | 89 prev->set_next(next); |
| 87 ASSERT(next != NULL); | 90 next->set_previous(prev); |
| 88 if (current_ != block_entry_->last_instruction()) { | |
| 89 ASSERT(!next->IsBlockEntry()); | |
| 90 next->set_previous(prev); | |
| 91 } else { | |
| 92 ASSERT(current_->IsBind()); | |
| 93 // Removing the last instruction of a block. | |
| 94 // Update last_instruction of the current basic block. | |
| 95 block_entry_->set_last_instruction(prev); | |
| 96 } | |
| 97 // Reset successor and previous instruction to indicate | 91 // Reset successor and previous instruction to indicate |
| 98 // that the instruction is removed from the graph. | 92 // that the instruction is removed from the graph. |
| 99 current_->set_previous(NULL); | 93 current_->set_previous(NULL); |
| 100 current_->set_next(NULL); | 94 current_->set_next(NULL); |
| 101 current_ = prev; | 95 current_ = prev; |
| 102 } | 96 } |
| 103 | 97 |
| 104 | 98 |
| 105 // True iff. the v2 is above v1 on stack, or one of them is constant. | 99 // True iff. the v2 is above v1 on stack, or one of them is constant. |
| 106 static bool VerifyValues(Value* v1, Value* v2) { | 100 static bool VerifyValues(Value* v1, Value* v2) { |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1306 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); | 1300 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); |
| 1307 compiler->GenerateCall(token_pos(), try_index(), &label, | 1301 compiler->GenerateCall(token_pos(), try_index(), &label, |
| 1308 PcDescriptors::kOther); | 1302 PcDescriptors::kOther); |
| 1309 __ Drop(2); // Discard type arguments and receiver. | 1303 __ Drop(2); // Discard type arguments and receiver. |
| 1310 } | 1304 } |
| 1311 | 1305 |
| 1312 | 1306 |
| 1313 #undef __ | 1307 #undef __ |
| 1314 | 1308 |
| 1315 } // namespace dart | 1309 } // namespace dart |
| OLD | NEW |