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

Unified 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, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 1856c80929676e0d363d0f6ebe44a37faa3f44a4..0891a22de4f0345aa0312234fdb0222105581f66 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -137,6 +137,7 @@ class LChunkBuilder;
V(LoadNamedField) \
V(LoadNamedFieldPolymorphic) \
V(LoadNamedGeneric) \
+ V(MathMinMax) \
V(Mod) \
V(Mul) \
V(ObjectLiteralFast) \
@@ -2985,6 +2986,38 @@ class HPower: public HTemplateInstruction<2> {
};
+class HMathMinMax: public HTemplateInstruction<2> {
+ public:
+ HMathMinMax(HValue* left,
+ HValue* right,
+ BuiltinFunctionId op) {
+ op_ = op;
+ SetOperandAt(0, left);
+ SetOperandAt(1, right);
+ ASSERT(right->representation().Equals(left->representation()));
+ set_representation(left->representation());
+ }
+
+ virtual Representation RequiredInputRepresentation(int index) {
+ return representation();
+ }
+
+ HValue* left() { return OperandAt(0); }
+ HValue* right() { return OperandAt(1); }
+ BuiltinFunctionId op() { return op_; }
+
+ DECLARE_CONCRETE_INSTRUCTION(MathMinMax)
+
+ protected:
+ virtual bool DataEquals(HValue* other) { return true; }
+
+ virtual Range* InferRange();
+
+ private:
+ BuiltinFunctionId op_;
+};
+
+
class HAdd: public HArithmeticBinaryOperation {
public:
HAdd(HValue* context, HValue* left, HValue* right)
« 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