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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 10543094: Eliminate redundant smi checks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Final review feedback Created 8 years, 6 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 | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('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 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 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 stream->Add("."); 1705 stream->Add(".");
1706 stream->Add(*String::cast(*name())->ToCString()); 1706 stream->Add(*String::cast(*name())->ToCString());
1707 } 1707 }
1708 1708
1709 1709
1710 void HLoadKeyedFastElement::PrintDataTo(StringStream* stream) { 1710 void HLoadKeyedFastElement::PrintDataTo(StringStream* stream) {
1711 object()->PrintNameTo(stream); 1711 object()->PrintNameTo(stream);
1712 stream->Add("["); 1712 stream->Add("[");
1713 key()->PrintNameTo(stream); 1713 key()->PrintNameTo(stream);
1714 stream->Add("]"); 1714 stream->Add("]");
1715 if (hole_check_mode_ == PERFORM_HOLE_CHECK) { 1715 if (RequiresHoleCheck()) {
1716 stream->Add(" check_hole"); 1716 stream->Add(" check_hole");
1717 } 1717 }
1718 } 1718 }
1719 1719
1720 1720
1721 bool HLoadKeyedFastElement::RequiresHoleCheck() { 1721 bool HLoadKeyedFastElement::RequiresHoleCheck() {
1722 if (hole_check_mode_ == OMIT_HOLE_CHECK) { 1722 if (IsFastPackedElementsKind(elements_kind())) {
1723 return false; 1723 return false;
1724 } 1724 }
1725 1725
1726 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { 1726 for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
1727 HValue* use = it.value(); 1727 HValue* use = it.value();
1728 if (!use->IsChange()) return true; 1728 if (!use->IsChange()) return true;
1729 } 1729 }
1730 1730
1731 return false; 1731 return false;
1732 } 1732 }
(...skipping 25 matching lines...) Expand all
1758 HForInCacheArray* names_cache = 1758 HForInCacheArray* names_cache =
1759 HForInCacheArray::cast(key_load->object()); 1759 HForInCacheArray::cast(key_load->object());
1760 1760
1761 if (names_cache->enumerable() == object()) { 1761 if (names_cache->enumerable() == object()) {
1762 HForInCacheArray* index_cache = 1762 HForInCacheArray* index_cache =
1763 names_cache->index_cache(); 1763 names_cache->index_cache();
1764 HCheckMapValue* map_check = 1764 HCheckMapValue* map_check =
1765 new(block()->zone()) HCheckMapValue(object(), names_cache->map()); 1765 new(block()->zone()) HCheckMapValue(object(), names_cache->map());
1766 HInstruction* index = new(block()->zone()) HLoadKeyedFastElement( 1766 HInstruction* index = new(block()->zone()) HLoadKeyedFastElement(
1767 index_cache, 1767 index_cache,
1768 key_load->key(), 1768 key_load->key());
1769 OMIT_HOLE_CHECK);
1770 map_check->InsertBefore(this); 1769 map_check->InsertBefore(this);
1771 index->InsertBefore(this); 1770 index->InsertBefore(this);
1772 HLoadFieldByIndex* load = new(block()->zone()) HLoadFieldByIndex( 1771 HLoadFieldByIndex* load = new(block()->zone()) HLoadFieldByIndex(
1773 object(), index); 1772 object(), index);
1774 load->InsertBefore(this); 1773 load->InsertBefore(this);
1775 return load; 1774 return load;
1776 } 1775 }
1777 } 1776 }
1778 } 1777 }
1779 1778
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
2478 2477
2479 2478
2480 void HCheckPrototypeMaps::Verify() { 2479 void HCheckPrototypeMaps::Verify() {
2481 HInstruction::Verify(); 2480 HInstruction::Verify();
2482 ASSERT(HasNoUses()); 2481 ASSERT(HasNoUses());
2483 } 2482 }
2484 2483
2485 #endif 2484 #endif
2486 2485
2487 } } // namespace v8::internal 2486 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698