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

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

Issue 14211009: Crankshaft: Recognize (i >>> 0) === i for integer32 inputs and replace (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 8 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.cc ('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 3892 matching lines...) Expand 10 before | Expand all | Expand 10 after
3903 virtual Representation RequiredInputRepresentation(int index) { 3903 virtual Representation RequiredInputRepresentation(int index) {
3904 return representation(); 3904 return representation();
3905 } 3905 }
3906 virtual Representation observed_input_representation(int index) { 3906 virtual Representation observed_input_representation(int index) {
3907 return observed_input_representation_[index]; 3907 return observed_input_representation_[index];
3908 } 3908 }
3909 virtual void PrintDataTo(StringStream* stream); 3909 virtual void PrintDataTo(StringStream* stream);
3910 3910
3911 virtual void AddInformativeDefinitions(); 3911 virtual void AddInformativeDefinitions();
3912 3912
3913 virtual HValue* Canonicalize();
3914
3913 DECLARE_CONCRETE_INSTRUCTION(CompareIDAndBranch) 3915 DECLARE_CONCRETE_INSTRUCTION(CompareIDAndBranch)
3914 3916
3915 private: 3917 private:
3916 Representation observed_input_representation_[2]; 3918 Representation observed_input_representation_[2];
3917 Token::Value token_; 3919 Token::Value token_;
3918 }; 3920 };
3919 3921
3920 3922
3921 class HCompareObjectEqAndBranch: public HTemplateControlInstruction<2, 2> { 3923 class HCompareObjectEqAndBranch: public HTemplateControlInstruction<2, 2> {
3922 public: 3924 public:
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
4606 public: 4608 public:
4607 static HInstruction* New(Zone* zone, 4609 static HInstruction* New(Zone* zone,
4608 HValue* context, 4610 HValue* context,
4609 HValue* left, 4611 HValue* left,
4610 HValue* right); 4612 HValue* right);
4611 4613
4612 virtual bool TryDecompose(DecompositionResult* decomposition) { 4614 virtual bool TryDecompose(DecompositionResult* decomposition) {
4613 if (right()->IsInteger32Constant()) { 4615 if (right()->IsInteger32Constant()) {
4614 if (decomposition->Apply(left(), 0, right()->GetInteger32Constant())) { 4616 if (decomposition->Apply(left(), 0, right()->GetInteger32Constant())) {
4615 // This is intended to look for HAdd and HSub, to handle compounds 4617 // This is intended to look for HAdd and HSub, to handle compounds
4616 // like ((base + offset) >> scale) with one single decomposition. 4618 // like ((base + offset) >>> scale) with one single decomposition.
4617 left()->TryDecompose(decomposition); 4619 left()->TryDecompose(decomposition);
4618 return true; 4620 return true;
4619 } 4621 }
4620 } 4622 }
4621 return false; 4623 return false;
4622 } 4624 }
4623 4625
4624 virtual Range* InferRange(Zone* zone); 4626 virtual Range* InferRange(Zone* zone);
4625 4627
4626 DECLARE_CONCRETE_INSTRUCTION(Shr) 4628 DECLARE_CONCRETE_INSTRUCTION(Shr)
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
6491 virtual bool IsDeletable() const { return true; } 6493 virtual bool IsDeletable() const { return true; }
6492 }; 6494 };
6493 6495
6494 6496
6495 #undef DECLARE_INSTRUCTION 6497 #undef DECLARE_INSTRUCTION
6496 #undef DECLARE_CONCRETE_INSTRUCTION 6498 #undef DECLARE_CONCRETE_INSTRUCTION
6497 6499
6498 } } // namespace v8::internal 6500 } } // namespace v8::internal
6499 6501
6500 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6502 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698