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

Unified Diff: src/a64/lithium-a64.h

Issue 148263012: A64: Rejig truncating and non double to i/smi (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/a64/lithium-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/lithium-a64.h
diff --git a/src/a64/lithium-a64.h b/src/a64/lithium-a64.h
index a643394c79750c67b13e49bc9a20fb49aa8cd18b..d734317edeaceb3a08484d7a89882091075d4381 100644
--- a/src/a64/lithium-a64.h
+++ b/src/a64/lithium-a64.h
@@ -93,8 +93,7 @@ class LCodeGen;
V(DeclareGlobals) \
V(Deoptimize) \
V(DivI) \
- V(DoubleToI) \
- V(DoubleToSmi) \
+ V(DoubleToIntOrSmi) \
V(Drop) \
V(DummyUse) \
V(ElementsKind) \
@@ -189,6 +188,7 @@ class LCodeGen;
V(ToFastProperties) \
V(TransitionElementsKind) \
V(TrapAllocationMemento) \
+ V(TruncateDoubleToIntOrSmi) \
V(Typeof) \
V(TypeofIsAndBranch) \
V(Uint32ToDouble) \
@@ -1207,41 +1207,18 @@ class LDivI: public LTemplateInstruction<1, 2, 1> {
};
-class LDoubleToI: public LTemplateInstruction<1, 1, 2> {
+class LDoubleToIntOrSmi: public LTemplateInstruction<1, 1, 0> {
public:
- LDoubleToI(LOperand* value, LOperand* temp1, LOperand* temp2) {
+ explicit LDoubleToIntOrSmi(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp1;
- temps_[1] = temp2;
- }
-
- LOperand* value() { return inputs_[0]; }
- LOperand* temp1() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
- DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
-
- bool truncating() { return hydrogen()->CanTruncateToInt32(); }
-};
-
-
-class LDoubleToSmi: public LTemplateInstruction<1, 1, 2> {
- public:
- LDoubleToSmi(LOperand* value, LOperand* temp1, LOperand* temp2) {
- inputs_[0] = value;
- temps_[0] = temp1;
- temps_[1] = temp2;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp1() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-smi")
+ DECLARE_CONCRETE_INSTRUCTION(DoubleToIntOrSmi, "double-to-int-or-smi")
DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
- bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+ bool tag_result() { return hydrogen()->representation().IsSmi(); }
};
@@ -2589,6 +2566,26 @@ class LTrapAllocationMemento : public LTemplateInstruction<0, 1, 2> {
};
+class LTruncateDoubleToIntOrSmi: public LTemplateInstruction<1, 1, 2> {
+ public:
+ LTruncateDoubleToIntOrSmi(LOperand* value, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
+ }
+
+ LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(TruncateDoubleToIntOrSmi,
+ "truncate-double-to-int-or-smi")
+ DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
+
+ bool tag_result() { return hydrogen()->representation().IsSmi(); }
+};
+
+
class LTypeof: public LTemplateInstruction<1, 1, 0> {
public:
explicit LTypeof(LOperand* value) {
« no previous file with comments | « no previous file | src/a64/lithium-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698