OLD | NEW |
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 V(CompareMap) \ | 94 V(CompareMap) \ |
95 V(CompareSymbolEq) \ | 95 V(CompareSymbolEq) \ |
96 V(Constant) \ | 96 V(Constant) \ |
97 V(Context) \ | 97 V(Context) \ |
98 V(DeleteProperty) \ | 98 V(DeleteProperty) \ |
99 V(Deoptimize) \ | 99 V(Deoptimize) \ |
100 V(Div) \ | 100 V(Div) \ |
101 V(EnterInlined) \ | 101 V(EnterInlined) \ |
102 V(ExternalArrayLength) \ | 102 V(ExternalArrayLength) \ |
103 V(FixedArrayLength) \ | 103 V(FixedArrayLength) \ |
| 104 V(ToInt32) \ |
104 V(ForceRepresentation) \ | 105 V(ForceRepresentation) \ |
105 V(FunctionLiteral) \ | 106 V(FunctionLiteral) \ |
106 V(GetCachedArrayIndex) \ | 107 V(GetCachedArrayIndex) \ |
107 V(GlobalObject) \ | 108 V(GlobalObject) \ |
108 V(GlobalReceiver) \ | 109 V(GlobalReceiver) \ |
109 V(Goto) \ | 110 V(Goto) \ |
110 V(HasInstanceType) \ | 111 V(HasInstanceType) \ |
111 V(HasCachedArrayIndex) \ | 112 V(HasCachedArrayIndex) \ |
112 V(In) \ | 113 V(In) \ |
113 V(InstanceOf) \ | 114 V(InstanceOf) \ |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 DECLARE_CONCRETE_INSTRUCTION(AbnormalExit) | 985 DECLARE_CONCRETE_INSTRUCTION(AbnormalExit) |
985 }; | 986 }; |
986 | 987 |
987 | 988 |
988 class HUnaryOperation: public HTemplateInstruction<1> { | 989 class HUnaryOperation: public HTemplateInstruction<1> { |
989 public: | 990 public: |
990 explicit HUnaryOperation(HValue* value) { | 991 explicit HUnaryOperation(HValue* value) { |
991 SetOperandAt(0, value); | 992 SetOperandAt(0, value); |
992 } | 993 } |
993 | 994 |
| 995 static HUnaryOperation* cast(HValue* value) { |
| 996 return reinterpret_cast<HUnaryOperation*>(value); |
| 997 } |
| 998 |
| 999 virtual bool CanTruncateToInt32() const { |
| 1000 return CheckFlag(kTruncatingToInt32); |
| 1001 } |
| 1002 |
994 HValue* value() { return OperandAt(0); } | 1003 HValue* value() { return OperandAt(0); } |
995 virtual void PrintDataTo(StringStream* stream); | 1004 virtual void PrintDataTo(StringStream* stream); |
996 }; | 1005 }; |
997 | 1006 |
998 | 1007 |
999 class HThrow: public HUnaryOperation { | 1008 class HThrow: public HUnaryOperation { |
1000 public: | 1009 public: |
1001 explicit HThrow(HValue* value) : HUnaryOperation(value) { | 1010 explicit HThrow(HValue* value) : HUnaryOperation(value) { |
1002 SetAllSideEffects(); | 1011 SetAllSideEffects(); |
1003 } | 1012 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 } | 1057 } |
1049 | 1058 |
1050 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 1059 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
1051 | 1060 |
1052 Representation from() const { return from_; } | 1061 Representation from() const { return from_; } |
1053 Representation to() const { return representation(); } | 1062 Representation to() const { return representation(); } |
1054 virtual Representation RequiredInputRepresentation(int index) const { | 1063 virtual Representation RequiredInputRepresentation(int index) const { |
1055 return from_; | 1064 return from_; |
1056 } | 1065 } |
1057 | 1066 |
1058 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); } | |
1059 | |
1060 virtual void PrintDataTo(StringStream* stream); | 1067 virtual void PrintDataTo(StringStream* stream); |
1061 | 1068 |
1062 DECLARE_CONCRETE_INSTRUCTION(Change) | 1069 DECLARE_CONCRETE_INSTRUCTION(Change) |
1063 | 1070 |
1064 protected: | 1071 protected: |
1065 virtual bool DataEquals(HValue* other) { | 1072 virtual bool DataEquals(HValue* other) { |
1066 if (!other->IsChange()) return false; | 1073 if (!other->IsChange()) return false; |
1067 HChange* change = HChange::cast(other); | 1074 HChange* change = HChange::cast(other); |
1068 return value() == change->value() | 1075 return value() == change->value() |
1069 && to().Equals(change->to()); | 1076 && to().Equals(change->to()); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 DECLARE_CONCRETE_INSTRUCTION(ClampToUint8) | 1114 DECLARE_CONCRETE_INSTRUCTION(ClampToUint8) |
1108 | 1115 |
1109 protected: | 1116 protected: |
1110 virtual bool DataEquals(HValue* other) { return true; } | 1117 virtual bool DataEquals(HValue* other) { return true; } |
1111 | 1118 |
1112 private: | 1119 private: |
1113 Representation input_rep_; | 1120 Representation input_rep_; |
1114 }; | 1121 }; |
1115 | 1122 |
1116 | 1123 |
| 1124 class HToInt32: public HUnaryOperation { |
| 1125 public: |
| 1126 explicit HToInt32(HValue* value) |
| 1127 : HUnaryOperation(value) { |
| 1128 set_representation(Representation::Integer32()); |
| 1129 SetFlag(kUseGVN); |
| 1130 } |
| 1131 |
| 1132 virtual Representation RequiredInputRepresentation(int index) const { |
| 1133 return Representation::None(); |
| 1134 } |
| 1135 |
| 1136 virtual bool CanTruncateToInt32() const { |
| 1137 return true; |
| 1138 } |
| 1139 |
| 1140 virtual HValue* Canonicalize() { |
| 1141 if (value()->representation().IsInteger32()) { |
| 1142 return value(); |
| 1143 } else { |
| 1144 return this; |
| 1145 } |
| 1146 } |
| 1147 |
| 1148 DECLARE_CONCRETE_INSTRUCTION(ToInt32) |
| 1149 |
| 1150 protected: |
| 1151 virtual bool DataEquals(HValue* other) { return true; } |
| 1152 }; |
| 1153 |
| 1154 |
1117 class HSimulate: public HInstruction { | 1155 class HSimulate: public HInstruction { |
1118 public: | 1156 public: |
1119 HSimulate(int ast_id, int pop_count) | 1157 HSimulate(int ast_id, int pop_count) |
1120 : ast_id_(ast_id), | 1158 : ast_id_(ast_id), |
1121 pop_count_(pop_count), | 1159 pop_count_(pop_count), |
1122 values_(2), | 1160 values_(2), |
1123 assigned_indexes_(2) {} | 1161 assigned_indexes_(2) {} |
1124 virtual ~HSimulate() {} | 1162 virtual ~HSimulate() {} |
1125 | 1163 |
1126 virtual void PrintDataTo(StringStream* stream); | 1164 virtual void PrintDataTo(StringStream* stream); |
(...skipping 2835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3962 | 4000 |
3963 DECLARE_CONCRETE_INSTRUCTION(In) | 4001 DECLARE_CONCRETE_INSTRUCTION(In) |
3964 }; | 4002 }; |
3965 | 4003 |
3966 #undef DECLARE_INSTRUCTION | 4004 #undef DECLARE_INSTRUCTION |
3967 #undef DECLARE_CONCRETE_INSTRUCTION | 4005 #undef DECLARE_CONCRETE_INSTRUCTION |
3968 | 4006 |
3969 } } // namespace v8::internal | 4007 } } // namespace v8::internal |
3970 | 4008 |
3971 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4009 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |