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 2269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2280 | 2280 |
2281 virtual bool IsConvertibleToInteger() const { | 2281 virtual bool IsConvertibleToInteger() const { |
2282 if (handle_->IsSmi()) return true; | 2282 if (handle_->IsSmi()) return true; |
2283 if (handle_->IsHeapNumber() && | 2283 if (handle_->IsHeapNumber() && |
2284 (HeapNumber::cast(*handle_)->value() == | 2284 (HeapNumber::cast(*handle_)->value() == |
2285 static_cast<double>(NumberToInt32(*handle_)))) return true; | 2285 static_cast<double>(NumberToInt32(*handle_)))) return true; |
2286 return false; | 2286 return false; |
2287 } | 2287 } |
2288 | 2288 |
2289 virtual bool EmitAtUses() { return !representation().IsDouble(); } | 2289 virtual bool EmitAtUses() { return !representation().IsDouble(); } |
| 2290 virtual HValue* Canonicalize(); |
2290 virtual void PrintDataTo(StringStream* stream); | 2291 virtual void PrintDataTo(StringStream* stream); |
2291 virtual HType CalculateInferredType(); | 2292 virtual HType CalculateInferredType(); |
2292 bool IsInteger() const { return handle_->IsSmi(); } | 2293 bool IsInteger() const { return handle_->IsSmi(); } |
2293 HConstant* CopyToRepresentation(Representation r) const; | 2294 HConstant* CopyToRepresentation(Representation r) const; |
2294 HConstant* CopyToTruncatedInt32() const; | 2295 HConstant* CopyToTruncatedInt32() const; |
2295 bool HasInteger32Value() const { return has_int32_value_; } | 2296 bool HasInteger32Value() const { return has_int32_value_; } |
2296 int32_t Integer32Value() const { | 2297 int32_t Integer32Value() const { |
2297 ASSERT(HasInteger32Value()); | 2298 ASSERT(HasInteger32Value()); |
2298 return int32_value_; | 2299 return int32_value_; |
2299 } | 2300 } |
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4152 public: | 4153 public: |
4153 explicit HTypeof(HValue* context, HValue* value) { | 4154 explicit HTypeof(HValue* context, HValue* value) { |
4154 SetOperandAt(0, context); | 4155 SetOperandAt(0, context); |
4155 SetOperandAt(1, value); | 4156 SetOperandAt(1, value); |
4156 set_representation(Representation::Tagged()); | 4157 set_representation(Representation::Tagged()); |
4157 } | 4158 } |
4158 | 4159 |
4159 HValue* context() { return OperandAt(0); } | 4160 HValue* context() { return OperandAt(0); } |
4160 HValue* value() { return OperandAt(1); } | 4161 HValue* value() { return OperandAt(1); } |
4161 | 4162 |
| 4163 virtual HValue* Canonicalize(); |
4162 virtual void PrintDataTo(StringStream* stream); | 4164 virtual void PrintDataTo(StringStream* stream); |
4163 | 4165 |
4164 virtual Representation RequiredInputRepresentation(int index) { | 4166 virtual Representation RequiredInputRepresentation(int index) { |
4165 return Representation::Tagged(); | 4167 return Representation::Tagged(); |
4166 } | 4168 } |
4167 | 4169 |
4168 DECLARE_CONCRETE_INSTRUCTION(Typeof) | 4170 DECLARE_CONCRETE_INSTRUCTION(Typeof) |
4169 }; | 4171 }; |
4170 | 4172 |
4171 | 4173 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4248 | 4250 |
4249 DECLARE_CONCRETE_INSTRUCTION(In) | 4251 DECLARE_CONCRETE_INSTRUCTION(In) |
4250 }; | 4252 }; |
4251 | 4253 |
4252 #undef DECLARE_INSTRUCTION | 4254 #undef DECLARE_INSTRUCTION |
4253 #undef DECLARE_CONCRETE_INSTRUCTION | 4255 #undef DECLARE_CONCRETE_INSTRUCTION |
4254 | 4256 |
4255 } } // namespace v8::internal | 4257 } } // namespace v8::internal |
4256 | 4258 |
4257 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4259 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |