OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2254 is_convertible_to_integer_(true) { | 2254 is_convertible_to_integer_(true) { |
2255 for (int i = 0; i < Representation::kNumRepresentations; i++) { | 2255 for (int i = 0; i < Representation::kNumRepresentations; i++) { |
2256 non_phi_uses_[i] = 0; | 2256 non_phi_uses_[i] = 0; |
2257 indirect_uses_[i] = 0; | 2257 indirect_uses_[i] = 0; |
2258 } | 2258 } |
2259 ASSERT(merged_index >= 0); | 2259 ASSERT(merged_index >= 0); |
2260 set_representation(Representation::Tagged()); | 2260 set_representation(Representation::Tagged()); |
2261 SetFlag(kFlexibleRepresentation); | 2261 SetFlag(kFlexibleRepresentation); |
2262 } | 2262 } |
2263 | 2263 |
2264 virtual Representation InferredRepresentation() { | 2264 virtual Representation InferredRepresentation(); |
2265 bool double_occurred = false; | |
2266 bool int32_occurred = false; | |
2267 for (int i = 0; i < OperandCount(); ++i) { | |
2268 HValue* value = OperandAt(i); | |
2269 if (value->representation().IsDouble()) double_occurred = true; | |
2270 if (value->representation().IsInteger32()) int32_occurred = true; | |
2271 if (value->representation().IsTagged()) return Representation::Tagged(); | |
2272 } | |
2273 | |
2274 if (double_occurred) return Representation::Double(); | |
2275 if (int32_occurred) return Representation::Integer32(); | |
2276 return Representation::None(); | |
2277 } | |
2278 | 2265 |
2279 virtual Range* InferRange(Zone* zone); | 2266 virtual Range* InferRange(Zone* zone); |
2280 virtual Representation RequiredInputRepresentation(int index) { | 2267 virtual Representation RequiredInputRepresentation(int index) { |
2281 return representation(); | 2268 return representation(); |
2282 } | 2269 } |
2283 virtual HType CalculateInferredType(); | 2270 virtual HType CalculateInferredType(); |
2284 virtual int OperandCount() { return inputs_.length(); } | 2271 virtual int OperandCount() { return inputs_.length(); } |
2285 virtual HValue* OperandAt(int index) { return inputs_[index]; } | 2272 virtual HValue* OperandAt(int index) { return inputs_[index]; } |
2286 HValue* GetRedundantReplacement(); | 2273 HValue* GetRedundantReplacement(); |
2287 void AddInput(HValue* value); | 2274 void AddInput(HValue* value); |
(...skipping 2532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4820 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); | 4807 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); |
4821 }; | 4808 }; |
4822 | 4809 |
4823 | 4810 |
4824 #undef DECLARE_INSTRUCTION | 4811 #undef DECLARE_INSTRUCTION |
4825 #undef DECLARE_CONCRETE_INSTRUCTION | 4812 #undef DECLARE_CONCRETE_INSTRUCTION |
4826 | 4813 |
4827 } } // namespace v8::internal | 4814 } } // namespace v8::internal |
4828 | 4815 |
4829 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4816 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |