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

Side by Side Diff: src/hydrogen-check-elimination.cc

Issue 172173003: Bugfix in check elimination with a regression test. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | test/mjsunit/regress/compare-map-elim1.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 // Narrow set of maps in the second check maps instruction. 331 // Narrow set of maps in the second check maps instruction.
332 HGraph* graph = instr->block()->graph(); 332 HGraph* graph = instr->block()->graph();
333 if (entry->check_ != NULL && 333 if (entry->check_ != NULL &&
334 entry->check_->block() == instr->block() && 334 entry->check_->block() == instr->block() &&
335 entry->check_->IsCheckMaps()) { 335 entry->check_->IsCheckMaps()) {
336 // There is a check in the same block so replace it with a more 336 // There is a check in the same block so replace it with a more
337 // strict check and eliminate the second check entirely. 337 // strict check and eliminate the second check entirely.
338 HCheckMaps* check = HCheckMaps::cast(entry->check_); 338 HCheckMaps* check = HCheckMaps::cast(entry->check_);
339 TRACE(("CheckMaps #%d at B%d narrowed\n", check->id(), 339 TRACE(("CheckMaps #%d at B%d narrowed\n", check->id(),
340 check->block()->block_id())); 340 check->block()->block_id()));
341 // Update map set and ensure that the check is alive.
341 check->set_map_set(intersection, graph->zone()); 342 check->set_map_set(intersection, graph->zone());
343 check->ClearFlag(HValue::kIsDead);
342 TRACE(("Replacing redundant CheckMaps #%d at B%d with #%d\n", 344 TRACE(("Replacing redundant CheckMaps #%d at B%d with #%d\n",
343 instr->id(), instr->block()->block_id(), entry->check_->id())); 345 instr->id(), instr->block()->block_id(), entry->check_->id()));
344 instr->DeleteAndReplaceWith(entry->check_); 346 instr->DeleteAndReplaceWith(entry->check_);
345 } else { 347 } else {
346 TRACE(("CheckMaps #%d at B%d narrowed\n", instr->id(), 348 TRACE(("CheckMaps #%d at B%d narrowed\n", instr->id(),
347 instr->block()->block_id())); 349 instr->block()->block_id()));
348 instr->set_map_set(intersection, graph->zone()); 350 instr->set_map_set(intersection, graph->zone());
349 entry->check_ = instr; 351 entry->check_ = instr;
350 } 352 }
351 353
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 PRINT_STAT(removed_cho); 728 PRINT_STAT(removed_cho);
727 PRINT_STAT(narrowed); 729 PRINT_STAT(narrowed);
728 PRINT_STAT(loads); 730 PRINT_STAT(loads);
729 PRINT_STAT(empty); 731 PRINT_STAT(empty);
730 PRINT_STAT(compares_true); 732 PRINT_STAT(compares_true);
731 PRINT_STAT(compares_false); 733 PRINT_STAT(compares_false);
732 PRINT_STAT(transitions); 734 PRINT_STAT(transitions);
733 } 735 }
734 736
735 } } // namespace v8::internal 737 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/compare-map-elim1.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698