Index: src/crankshaft/ia32/lithium-ia32.h |
diff --git a/src/crankshaft/ia32/lithium-ia32.h b/src/crankshaft/ia32/lithium-ia32.h |
index 6f029d51ebb64764cee4e28aa5aeadc86ba30cce..9e074bc9ff619a19942df2be1ef9c6a7c3e8aa5e 100644 |
--- a/src/crankshaft/ia32/lithium-ia32.h |
+++ b/src/crankshaft/ia32/lithium-ia32.h |
@@ -103,12 +103,14 @@ class LCodeGen; |
V(MathAbs) \ |
V(MathClz32) \ |
V(MathExp) \ |
- V(MathFloor) \ |
+ V(MathFloorD) \ |
+ V(MathFloorI) \ |
V(MathFround) \ |
V(MathLog) \ |
V(MathMinMax) \ |
V(MathPowHalf) \ |
- V(MathRound) \ |
+ V(MathRoundD) \ |
+ V(MathRoundI) \ |
V(MathSqrt) \ |
V(MaybeGrowElements) \ |
V(ModByConstI) \ |
@@ -153,7 +155,6 @@ class LCodeGen; |
V(UnknownOSRValue) \ |
V(WrapReceiver) |
- |
#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
Opcode opcode() const final { return LInstruction::k##type; } \ |
void CompileToNative(LCodeGen* generator) final; \ |
@@ -815,23 +816,43 @@ class LCompareNumericAndBranch final : public LControlInstruction<2, 0> { |
void PrintDataTo(StringStream* stream) override; |
}; |
+// Math.floor with a double result. |
+class LMathFloorD final : public LTemplateInstruction<1, 1, 0> { |
+ public: |
+ explicit LMathFloorD(LOperand* value) { inputs_[0] = value; } |
+ |
+ LOperand* value() { return inputs_[0]; } |
+ |
+ DECLARE_CONCRETE_INSTRUCTION(MathFloorD, "math-floor-d") |
+ DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
+}; |
-class LMathFloor final : public LTemplateInstruction<1, 1, 0> { |
+// Math.floor with an integer result. |
+class LMathFloorI final : public LTemplateInstruction<1, 1, 0> { |
public: |
- explicit LMathFloor(LOperand* value) { |
- inputs_[0] = value; |
- } |
+ explicit LMathFloorI(LOperand* value) { inputs_[0] = value; } |
LOperand* value() { return inputs_[0]; } |
- DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") |
+ DECLARE_CONCRETE_INSTRUCTION(MathFloorI, "math-floor-i") |
DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
}; |
+// Math.round with a double result. |
+class LMathRoundD final : public LTemplateInstruction<1, 1, 0> { |
+ public: |
+ explicit LMathRoundD(LOperand* value) { inputs_[0] = value; } |
+ |
+ LOperand* value() { return inputs_[0]; } |
+ |
+ DECLARE_CONCRETE_INSTRUCTION(MathRoundD, "math-round-d") |
+ DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
+}; |
-class LMathRound final : public LTemplateInstruction<1, 1, 1> { |
+// Math.round with an integer result. |
+class LMathRoundI final : public LTemplateInstruction<1, 1, 1> { |
public: |
- LMathRound(LOperand* value, LOperand* temp) { |
+ LMathRoundI(LOperand* value, LOperand* temp) { |
inputs_[0] = value; |
temps_[0] = temp; |
} |
@@ -839,7 +860,7 @@ class LMathRound final : public LTemplateInstruction<1, 1, 1> { |
LOperand* temp() { return temps_[0]; } |
LOperand* value() { return inputs_[0]; } |
- DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") |
+ DECLARE_CONCRETE_INSTRUCTION(MathRoundI, "math-round-i") |
DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
}; |