| 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 3182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3193 }; | 3193 }; |
| 3194 | 3194 |
| 3195 | 3195 |
| 3196 class HLoadKeyedSpecializedArrayElement: public HBinaryOperation { | 3196 class HLoadKeyedSpecializedArrayElement: public HBinaryOperation { |
| 3197 public: | 3197 public: |
| 3198 HLoadKeyedSpecializedArrayElement(HValue* external_elements, | 3198 HLoadKeyedSpecializedArrayElement(HValue* external_elements, |
| 3199 HValue* key, | 3199 HValue* key, |
| 3200 ExternalArrayType array_type) | 3200 ExternalArrayType array_type) |
| 3201 : HBinaryOperation(external_elements, key), | 3201 : HBinaryOperation(external_elements, key), |
| 3202 array_type_(array_type) { | 3202 array_type_(array_type) { |
| 3203 if (array_type == kExternalFloatArray) { | 3203 if (array_type == kExternalFloatArray || |
| 3204 array_type == kExternalDoubleArray) { |
| 3204 set_representation(Representation::Double()); | 3205 set_representation(Representation::Double()); |
| 3205 } else { | 3206 } else { |
| 3206 set_representation(Representation::Integer32()); | 3207 set_representation(Representation::Integer32()); |
| 3207 } | 3208 } |
| 3208 SetFlag(kDependsOnSpecializedArrayElements); | 3209 SetFlag(kDependsOnSpecializedArrayElements); |
| 3209 // Native code could change the specialized array. | 3210 // Native code could change the specialized array. |
| 3210 SetFlag(kDependsOnCalls); | 3211 SetFlag(kDependsOnCalls); |
| 3211 SetFlag(kUseGVN); | 3212 SetFlag(kUseGVN); |
| 3212 } | 3213 } |
| 3213 | 3214 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3387 SetOperandAt(1, key); | 3388 SetOperandAt(1, key); |
| 3388 SetOperandAt(2, val); | 3389 SetOperandAt(2, val); |
| 3389 } | 3390 } |
| 3390 | 3391 |
| 3391 virtual void PrintDataTo(StringStream* stream); | 3392 virtual void PrintDataTo(StringStream* stream); |
| 3392 | 3393 |
| 3393 virtual Representation RequiredInputRepresentation(int index) const { | 3394 virtual Representation RequiredInputRepresentation(int index) const { |
| 3394 if (index == 0) { | 3395 if (index == 0) { |
| 3395 return Representation::External(); | 3396 return Representation::External(); |
| 3396 } else { | 3397 } else { |
| 3397 if (index == 2 && array_type() == kExternalFloatArray) { | 3398 if (index == 2 && (array_type() == kExternalFloatArray || |
| 3399 array_type() == kExternalDoubleArray)) { |
| 3398 return Representation::Double(); | 3400 return Representation::Double(); |
| 3399 } else { | 3401 } else { |
| 3400 return Representation::Integer32(); | 3402 return Representation::Integer32(); |
| 3401 } | 3403 } |
| 3402 } | 3404 } |
| 3403 } | 3405 } |
| 3404 | 3406 |
| 3405 HValue* external_pointer() { return OperandAt(0); } | 3407 HValue* external_pointer() { return OperandAt(0); } |
| 3406 HValue* key() { return OperandAt(1); } | 3408 HValue* key() { return OperandAt(1); } |
| 3407 HValue* value() { return OperandAt(2); } | 3409 HValue* value() { return OperandAt(2); } |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3733 HValue* object() { return left(); } | 3735 HValue* object() { return left(); } |
| 3734 HValue* key() { return right(); } | 3736 HValue* key() { return right(); } |
| 3735 }; | 3737 }; |
| 3736 | 3738 |
| 3737 #undef DECLARE_INSTRUCTION | 3739 #undef DECLARE_INSTRUCTION |
| 3738 #undef DECLARE_CONCRETE_INSTRUCTION | 3740 #undef DECLARE_CONCRETE_INSTRUCTION |
| 3739 | 3741 |
| 3740 } } // namespace v8::internal | 3742 } } // namespace v8::internal |
| 3741 | 3743 |
| 3742 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3744 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |