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

Side by Side Diff: vm/intermediate_language.cc

Issue 10826299: Fix crash bug when replacing a definition with a definition that has no uses. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | vm/intermediate_language_test.cc » ('j') | vm/intermediate_language_test.cc » ('J')
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_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 UseVal* head = use_list(); 305 UseVal* head = use_list();
306 if (head == NULL) return; 306 if (head == NULL) return;
307 307
308 UseVal* current = head; 308 UseVal* current = head;
309 while (current->next_use() != NULL) { 309 while (current->next_use() != NULL) {
310 current->definition_ = other; 310 current->definition_ = other;
311 current = current->next_use(); 311 current = current->next_use();
312 } 312 }
313 current->definition_ = other; 313 current->definition_ = other;
314 314
315 current->next_use_ = other->use_list(); 315 if (other->use_list() != NULL) {
316 other->use_list()->previous_use_ = current; 316 current->next_use_ = other->use_list();
317 other->use_list()->previous_use_ = current;
318 }
317 other->set_use_list(head); 319 other->set_use_list(head);
318 } 320 }
319 321
320 322
321 RawAbstractType* BindInstr::CompileType() const { 323 RawAbstractType* BindInstr::CompileType() const {
322 ASSERT(!HasPropagatedType()); 324 ASSERT(!HasPropagatedType());
323 // The compile type may be requested when building the flow graph, i.e. before 325 // The compile type may be requested when building the flow graph, i.e. before
324 // type propagation has occurred. 326 // type propagation has occurred.
325 return computation()->CompileType(); 327 return computation()->CompileType();
326 } 328 }
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 if (compiler->is_ssa()) { 1313 if (compiler->is_ssa()) {
1312 ASSERT(locs()->in(0).IsRegister()); 1314 ASSERT(locs()->in(0).IsRegister());
1313 __ PushRegister(locs()->in(0).reg()); 1315 __ PushRegister(locs()->in(0).reg());
1314 } 1316 }
1315 } 1317 }
1316 1318
1317 1319
1318 #undef __ 1320 #undef __
1319 1321
1320 } // namespace dart 1322 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | vm/intermediate_language_test.cc » ('j') | vm/intermediate_language_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698