Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index f9c7832732f77ddf962e52280d98d0848481a5cb..94f136143f0cafc6dbc772f587e3fa40d07cb742 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -92,6 +92,7 @@ class LChunkBuilder; |
V(CheckHeapObject) \ |
V(CheckInstanceType) \ |
V(CheckMaps) \ |
+ V(CheckSmi) \ |
V(CheckPrototypeMaps) \ |
V(ClampToUint8) \ |
V(ClassOfTestAndBranch) \ |
@@ -128,6 +129,7 @@ class LChunkBuilder; |
V(InvokeFunction) \ |
V(IsConstructCallAndBranch) \ |
V(IsObjectAndBranch) \ |
+ V(IsNumberAndBranch) \ |
V(IsStringAndBranch) \ |
V(IsSmiAndBranch) \ |
V(IsUndetectableAndBranch) \ |
@@ -2934,6 +2936,49 @@ class HCheckInstanceType: public HUnaryOperation { |
}; |
+class HCheckSmi: public HUnaryOperation { |
+ public: |
+ explicit HCheckSmi(HValue* value) : HUnaryOperation(value) { |
+ set_representation(Representation::Smi()); |
+ SetFlag(kUseGVN); |
+ } |
+ |
+ virtual Representation RequiredInputRepresentation(int index) { |
+ return Representation::Tagged(); |
+ } |
+ |
+ virtual HType CalculateInferredType(); |
+ |
+ virtual HValue* Canonicalize() { |
+ HType value_type = value()->type(); |
+ if (value_type.IsSmi()) { |
+ return NULL; |
+ } |
+ return this; |
+ } |
+ |
+ DECLARE_CONCRETE_INSTRUCTION(CheckSmi) |
+ |
+ protected: |
+ virtual bool DataEquals(HValue* other) { return true; } |
+}; |
+ |
+ |
+class HIsNumberAndBranch: public HUnaryControlInstruction { |
+ public: |
+ explicit HIsNumberAndBranch(HValue* value) |
+ : HUnaryControlInstruction(value, NULL, NULL) { |
+ SetFlag(kFlexibleRepresentation); |
+ } |
+ |
+ virtual Representation RequiredInputRepresentation(int index) { |
+ return Representation::None(); |
+ } |
+ |
+ DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch) |
+}; |
+ |
+ |
class HCheckHeapObject: public HUnaryOperation { |
public: |
explicit HCheckHeapObject(HValue* value) : HUnaryOperation(value) { |