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

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

Issue 9110008: Inline Math.max and Math.min in crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 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/hydrogen-instructions.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 V(LoadFunctionPrototype) \ 130 V(LoadFunctionPrototype) \
131 V(LoadGlobalCell) \ 131 V(LoadGlobalCell) \
132 V(LoadGlobalGeneric) \ 132 V(LoadGlobalGeneric) \
133 V(LoadKeyedFastDoubleElement) \ 133 V(LoadKeyedFastDoubleElement) \
134 V(LoadKeyedFastElement) \ 134 V(LoadKeyedFastElement) \
135 V(LoadKeyedGeneric) \ 135 V(LoadKeyedGeneric) \
136 V(LoadKeyedSpecializedArrayElement) \ 136 V(LoadKeyedSpecializedArrayElement) \
137 V(LoadNamedField) \ 137 V(LoadNamedField) \
138 V(LoadNamedFieldPolymorphic) \ 138 V(LoadNamedFieldPolymorphic) \
139 V(LoadNamedGeneric) \ 139 V(LoadNamedGeneric) \
140 V(MathMinMax) \
140 V(Mod) \ 141 V(Mod) \
141 V(Mul) \ 142 V(Mul) \
142 V(ObjectLiteralFast) \ 143 V(ObjectLiteralFast) \
143 V(ObjectLiteralGeneric) \ 144 V(ObjectLiteralGeneric) \
144 V(OsrEntry) \ 145 V(OsrEntry) \
145 V(OuterContext) \ 146 V(OuterContext) \
146 V(Parameter) \ 147 V(Parameter) \
147 V(Power) \ 148 V(Power) \
148 V(PushArgument) \ 149 V(PushArgument) \
149 V(RegExpLiteral) \ 150 V(RegExpLiteral) \
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2978 : Representation::None(); 2979 : Representation::None();
2979 } 2980 }
2980 2981
2981 DECLARE_CONCRETE_INSTRUCTION(Power) 2982 DECLARE_CONCRETE_INSTRUCTION(Power)
2982 2983
2983 protected: 2984 protected:
2984 virtual bool DataEquals(HValue* other) { return true; } 2985 virtual bool DataEquals(HValue* other) { return true; }
2985 }; 2986 };
2986 2987
2987 2988
2989 class HMathMinMax: public HTemplateInstruction<2> {
2990 public:
2991 HMathMinMax(HValue* left,
2992 HValue* right,
2993 BuiltinFunctionId op) {
2994 op_ = op;
2995 SetOperandAt(0, left);
2996 SetOperandAt(1, right);
2997 ASSERT(right->representation().Equals(left->representation()));
2998 set_representation(left->representation());
2999 }
3000
3001 virtual Representation RequiredInputRepresentation(int index) {
3002 return representation();
3003 }
3004
3005 HValue* left() { return OperandAt(0); }
3006 HValue* right() { return OperandAt(1); }
3007 BuiltinFunctionId op() { return op_; }
3008
3009 DECLARE_CONCRETE_INSTRUCTION(MathMinMax)
3010
3011 protected:
3012 virtual bool DataEquals(HValue* other) { return true; }
3013
3014 virtual Range* InferRange();
3015
3016 private:
3017 BuiltinFunctionId op_;
3018 };
3019
3020
2988 class HAdd: public HArithmeticBinaryOperation { 3021 class HAdd: public HArithmeticBinaryOperation {
2989 public: 3022 public:
2990 HAdd(HValue* context, HValue* left, HValue* right) 3023 HAdd(HValue* context, HValue* left, HValue* right)
2991 : HArithmeticBinaryOperation(context, left, right) { 3024 : HArithmeticBinaryOperation(context, left, right) {
2992 SetFlag(kCanOverflow); 3025 SetFlag(kCanOverflow);
2993 } 3026 }
2994 3027
2995 // Add is only commutative if two integer values are added and not if two 3028 // Add is only commutative if two integer values are added and not if two
2996 // tagged values are added (because it might be a String concatenation). 3029 // tagged values are added (because it might be a String concatenation).
2997 virtual bool IsCommutative() const { 3030 virtual bool IsCommutative() const {
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
4486 4519
4487 DECLARE_CONCRETE_INSTRUCTION(In) 4520 DECLARE_CONCRETE_INSTRUCTION(In)
4488 }; 4521 };
4489 4522
4490 #undef DECLARE_INSTRUCTION 4523 #undef DECLARE_INSTRUCTION
4491 #undef DECLARE_CONCRETE_INSTRUCTION 4524 #undef DECLARE_CONCRETE_INSTRUCTION
4492 4525
4493 } } // namespace v8::internal 4526 } } // namespace v8::internal
4494 4527
4495 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4528 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698