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

Side by Side Diff: src/hydrogen.cc

Issue 14914004: Don't double unlink in DCE. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5418 matching lines...) Expand 10 before | Expand all | Expand 10 after
5429 for (int i = 0; i < blocks()->length(); ++i) { 5429 for (int i = 0; i < blocks()->length(); ++i) {
5430 for (HInstruction* instr = blocks()->at(i)->first(); 5430 for (HInstruction* instr = blocks()->at(i)->first();
5431 instr != NULL; 5431 instr != NULL;
5432 instr = instr->next()) { 5432 instr = instr->next()) {
5433 if (instr->IsDead()) worklist.Add(instr, zone()); 5433 if (instr->IsDead()) worklist.Add(instr, zone());
5434 } 5434 }
5435 } 5435 }
5436 5436
5437 while (!worklist.is_empty()) { 5437 while (!worklist.is_empty()) {
5438 HInstruction* instr = worklist.RemoveLast(); 5438 HInstruction* instr = worklist.RemoveLast();
5439 // This happens when an instruction is used multiple times as operand. That
5440 // in turn could happen through GVN.
5441 if (!instr->IsLinked()) continue;
5439 if (FLAG_trace_dead_code_elimination) { 5442 if (FLAG_trace_dead_code_elimination) {
5440 HeapStringAllocator allocator; 5443 HeapStringAllocator allocator;
5441 StringStream stream(&allocator); 5444 StringStream stream(&allocator);
5442 instr->PrintNameTo(&stream); 5445 instr->PrintNameTo(&stream);
5443 stream.Add(" = "); 5446 stream.Add(" = ");
5444 instr->PrintTo(&stream); 5447 instr->PrintTo(&stream);
5445 PrintF("[removing dead instruction %s]\n", *stream.ToCString()); 5448 PrintF("[removing dead instruction %s]\n", *stream.ToCString());
5446 } 5449 }
5447 instr->DeleteAndReplaceWith(NULL); 5450 instr->DeleteAndReplaceWith(NULL);
5448 for (int i = 0; i < instr->OperandCount(); ++i) { 5451 for (int i = 0; i < instr->OperandCount(); ++i) {
(...skipping 6821 matching lines...) Expand 10 before | Expand all | Expand 10 after
12270 } 12273 }
12271 } 12274 }
12272 12275
12273 #ifdef DEBUG 12276 #ifdef DEBUG
12274 if (graph_ != NULL) graph_->Verify(false); // No full verify. 12277 if (graph_ != NULL) graph_->Verify(false); // No full verify.
12275 if (allocator_ != NULL) allocator_->Verify(); 12278 if (allocator_ != NULL) allocator_->Verify();
12276 #endif 12279 #endif
12277 } 12280 }
12278 12281
12279 } } // namespace v8::internal 12282 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698