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

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

Issue 20323002: Add Smi support to Shl (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ARM / x64 Created 7 years, 5 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
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 4872 matching lines...) Expand 10 before | Expand all | Expand 10 after
4883 static HInstruction* New(Zone* zone, 4883 static HInstruction* New(Zone* zone,
4884 HValue* context, 4884 HValue* context,
4885 HValue* left, 4885 HValue* left,
4886 HValue* right); 4886 HValue* right);
4887 4887
4888 virtual Range* InferRange(Zone* zone); 4888 virtual Range* InferRange(Zone* zone);
4889 4889
4890 virtual void UpdateRepresentation(Representation new_rep, 4890 virtual void UpdateRepresentation(Representation new_rep,
4891 HInferRepresentationPhase* h_infer, 4891 HInferRepresentationPhase* h_infer,
4892 const char* reason) { 4892 const char* reason) {
4893 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); 4893 if (new_rep.IsSmi() &&
4894 !(right()->IsInteger32Constant() &&
4895 right()->GetInteger32Constant() >= 0)) {
4896 new_rep = Representation::Integer32();
4897 }
4894 HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); 4898 HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason);
4895 } 4899 }
4896 4900
4897 DECLARE_CONCRETE_INSTRUCTION(Shl) 4901 DECLARE_CONCRETE_INSTRUCTION(Shl)
4898 4902
4899 protected: 4903 protected:
4900 virtual bool DataEquals(HValue* other) { return true; } 4904 virtual bool DataEquals(HValue* other) { return true; }
4901 4905
4902 private: 4906 private:
4903 HShl(HValue* context, HValue* left, HValue* right) 4907 HShl(HValue* context, HValue* left, HValue* right)
(...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after
6947 virtual bool IsDeletable() const { return true; } 6951 virtual bool IsDeletable() const { return true; }
6948 }; 6952 };
6949 6953
6950 6954
6951 #undef DECLARE_INSTRUCTION 6955 #undef DECLARE_INSTRUCTION
6952 #undef DECLARE_CONCRETE_INSTRUCTION 6956 #undef DECLARE_CONCRETE_INSTRUCTION
6953 6957
6954 } } // namespace v8::internal 6958 } } // namespace v8::internal
6955 6959
6956 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6960 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698