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 5705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5716 | 5716 |
5717 if (IsFastObjectElementsKind(elements_kind)) { | 5717 if (IsFastObjectElementsKind(elements_kind)) { |
5718 SetFlag(kTrackSideEffectDominators); | 5718 SetFlag(kTrackSideEffectDominators); |
5719 SetGVNFlag(kDependsOnNewSpacePromotion); | 5719 SetGVNFlag(kDependsOnNewSpacePromotion); |
5720 } | 5720 } |
5721 if (is_external()) { | 5721 if (is_external()) { |
5722 SetGVNFlag(kChangesSpecializedArrayElements); | 5722 SetGVNFlag(kChangesSpecializedArrayElements); |
5723 } else if (IsFastDoubleElementsKind(elements_kind)) { | 5723 } else if (IsFastDoubleElementsKind(elements_kind)) { |
5724 SetGVNFlag(kChangesDoubleArrayElements); | 5724 SetGVNFlag(kChangesDoubleArrayElements); |
5725 SetFlag(kDeoptimizeOnUndefined); | 5725 SetFlag(kDeoptimizeOnUndefined); |
| 5726 } else if (IsFastSmiElementsKind(elements_kind)) { |
| 5727 SetGVNFlag(kChangesArrayElements); |
| 5728 SetFlag(kDeoptimizeOnUndefined); |
5726 } else { | 5729 } else { |
5727 SetGVNFlag(kChangesArrayElements); | 5730 SetGVNFlag(kChangesArrayElements); |
5728 } | 5731 } |
5729 | 5732 |
5730 // EXTERNAL_{UNSIGNED_,}{BYTE,SHORT,INT}_ELEMENTS are truncating. | 5733 // EXTERNAL_{UNSIGNED_,}{BYTE,SHORT,INT}_ELEMENTS are truncating. |
5731 if (elements_kind >= EXTERNAL_BYTE_ELEMENTS && | 5734 if (elements_kind >= EXTERNAL_BYTE_ELEMENTS && |
5732 elements_kind <= EXTERNAL_UNSIGNED_INT_ELEMENTS) { | 5735 elements_kind <= EXTERNAL_UNSIGNED_INT_ELEMENTS) { |
5733 SetFlag(kTruncatingToInt32); | 5736 SetFlag(kTruncatingToInt32); |
5734 } | 5737 } |
5735 } | 5738 } |
5736 | 5739 |
5737 virtual Representation RequiredInputRepresentation(int index) { | 5740 virtual Representation RequiredInputRepresentation(int index) { |
5738 // kind_fast: tagged[int32] = tagged | 5741 // kind_fast: tagged[int32] = tagged |
5739 // kind_double: tagged[int32] = double | 5742 // kind_double: tagged[int32] = double |
5740 // kind_external: external[int32] = (double | int32) | 5743 // kind_external: external[int32] = (double | int32) |
5741 if (index == 0) { | 5744 if (index == 0) { |
5742 return is_external() ? Representation::External() | 5745 return is_external() ? Representation::External() |
5743 : Representation::Tagged(); | 5746 : Representation::Tagged(); |
5744 } else if (index == 1) { | 5747 } else if (index == 1) { |
5745 return ArrayInstructionInterface::KeyedAccessIndexRequirement( | 5748 return ArrayInstructionInterface::KeyedAccessIndexRequirement( |
5746 OperandAt(1)->representation()); | 5749 OperandAt(1)->representation()); |
5747 } | 5750 } |
5748 | 5751 |
5749 ASSERT_EQ(index, 2); | 5752 ASSERT_EQ(index, 2); |
5750 if (IsDoubleOrFloatElementsKind(elements_kind())) { | 5753 if (IsDoubleOrFloatElementsKind(elements_kind())) { |
5751 return Representation::Double(); | 5754 return Representation::Double(); |
5752 } | 5755 } |
5753 | 5756 |
| 5757 if (IsFastSmiElementsKind(elements_kind())) { |
| 5758 return Representation::Smi(); |
| 5759 } |
| 5760 |
5754 return is_external() ? Representation::Integer32() | 5761 return is_external() ? Representation::Integer32() |
5755 : Representation::Tagged(); | 5762 : Representation::Tagged(); |
5756 } | 5763 } |
5757 | 5764 |
5758 bool is_external() const { | 5765 bool is_external() const { |
5759 return IsExternalArrayElementsKind(elements_kind()); | 5766 return IsExternalArrayElementsKind(elements_kind()); |
5760 } | 5767 } |
5761 | 5768 |
5762 virtual Representation observed_input_representation(int index) { | 5769 virtual Representation observed_input_representation(int index) { |
5763 if (index < 2) return RequiredInputRepresentation(index); | 5770 if (index < 2) return RequiredInputRepresentation(index); |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6472 virtual bool IsDeletable() const { return true; } | 6479 virtual bool IsDeletable() const { return true; } |
6473 }; | 6480 }; |
6474 | 6481 |
6475 | 6482 |
6476 #undef DECLARE_INSTRUCTION | 6483 #undef DECLARE_INSTRUCTION |
6477 #undef DECLARE_CONCRETE_INSTRUCTION | 6484 #undef DECLARE_CONCRETE_INSTRUCTION |
6478 | 6485 |
6479 } } // namespace v8::internal | 6486 } } // namespace v8::internal |
6480 | 6487 |
6481 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6488 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |