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

Side by Side Diff: vm/intermediate_language.cc

Issue 10796108: Add a backward instruction iterator and use it in the liveness analysis. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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
« vm/intermediate_language.h ('K') | « vm/intermediate_language.h ('k') | no next file » | 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/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
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 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); 1307 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint());
1314 compiler->GenerateCall(token_pos(), try_index(), &label, 1308 compiler->GenerateCall(token_pos(), try_index(), &label,
1315 PcDescriptors::kOther); 1309 PcDescriptors::kOther);
1316 __ Drop(2); // Discard type arguments and receiver. 1310 __ Drop(2); // Discard type arguments and receiver.
1317 } 1311 }
1318 1312
1319 1313
1320 #undef __ 1314 #undef __
1321 1315
1322 } // namespace dart 1316 } // namespace dart
OLDNEW
« vm/intermediate_language.h ('K') | « vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698