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

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

Issue 11362085: Removed useless Canonicalize implementations subsumed by dead code elimination. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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') | 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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 } 852 }
853 853
854 854
855 void HLoadFieldByIndex::PrintDataTo(StringStream* stream) { 855 void HLoadFieldByIndex::PrintDataTo(StringStream* stream) {
856 object()->PrintNameTo(stream); 856 object()->PrintNameTo(stream);
857 stream->Add(" "); 857 stream->Add(" ");
858 index()->PrintNameTo(stream); 858 index()->PrintNameTo(stream);
859 } 859 }
860 860
861 861
862 HValue* HConstant::Canonicalize() {
863 return HasNoUses() ? NULL : this;
864 }
865
866
867 HValue* HTypeof::Canonicalize() {
868 return HasNoUses() ? NULL : this;
869 }
870
871
872 HValue* HBitwise::Canonicalize() { 862 HValue* HBitwise::Canonicalize() {
873 if (!representation().IsInteger32()) return this; 863 if (!representation().IsInteger32()) return this;
874 // If x is an int32, then x & -1 == x, x | 0 == x and x ^ 0 == x. 864 // If x is an int32, then x & -1 == x, x | 0 == x and x ^ 0 == x.
875 int32_t nop_constant = (op() == Token::BIT_AND) ? -1 : 0; 865 int32_t nop_constant = (op() == Token::BIT_AND) ? -1 : 0;
876 if (left()->IsConstant() && 866 if (left()->IsConstant() &&
877 HConstant::cast(left())->HasInteger32Value() && 867 HConstant::cast(left())->HasInteger32Value() &&
878 HConstant::cast(left())->Integer32Value() == nop_constant && 868 HConstant::cast(left())->Integer32Value() == nop_constant &&
879 !right()->CheckFlag(kUint32)) { 869 !right()->CheckFlag(kUint32)) {
880 return right(); 870 return right();
881 } 871 }
(...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after
2535 2525
2536 2526
2537 void HCheckFunction::Verify() { 2527 void HCheckFunction::Verify() {
2538 HInstruction::Verify(); 2528 HInstruction::Verify();
2539 ASSERT(HasNoUses()); 2529 ASSERT(HasNoUses());
2540 } 2530 }
2541 2531
2542 #endif 2532 #endif
2543 2533
2544 } } // namespace v8::internal 2534 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698