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 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2743 HValue *typecheck = NULL) { | 2743 HValue *typecheck = NULL) { |
2744 HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck); | 2744 HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck); |
2745 for (int i = 0; i < maps->length(); i++) { | 2745 for (int i = 0; i < maps->length(); i++) { |
2746 check_map->map_set_.Add(maps->at(i), zone); | 2746 check_map->map_set_.Add(maps->at(i), zone); |
2747 } | 2747 } |
2748 check_map->map_set_.Sort(); | 2748 check_map->map_set_.Sort(); |
2749 return check_map; | 2749 return check_map; |
2750 } | 2750 } |
2751 | 2751 |
2752 static HCheckMaps* NewWithTransitions(HValue* value, Handle<Map> map, | 2752 static HCheckMaps* NewWithTransitions(HValue* value, Handle<Map> map, |
2753 Zone* zone) { | 2753 Zone* zone, CompilationInfo* info); |
2754 HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, value); | |
2755 check_map->map_set_.Add(map, zone); | |
2756 | |
2757 // Since transitioned elements maps of the initial map don't fail the map | |
2758 // check, the CheckMaps instruction doesn't need to depend on ElementsKinds. | |
2759 check_map->ClearGVNFlag(kDependsOnElementsKind); | |
2760 | |
2761 ElementsKind kind = map->elements_kind(); | |
2762 bool packed = IsFastPackedElementsKind(kind); | |
2763 while (CanTransitionToMoreGeneralFastElementsKind(kind, packed)) { | |
2764 kind = GetNextMoreGeneralFastElementsKind(kind, packed); | |
2765 Map* transitioned_map = | |
2766 map->LookupElementsTransitionMap(kind); | |
2767 if (transitioned_map) { | |
2768 check_map->map_set_.Add(Handle<Map>(transitioned_map), zone); | |
2769 } | |
2770 }; | |
2771 check_map->map_set_.Sort(); | |
2772 return check_map; | |
2773 } | |
2774 | 2754 |
2775 bool CanOmitMapChecks() { return omit_; } | 2755 bool CanOmitMapChecks() { return omit_; } |
2776 | 2756 |
2777 virtual bool HasEscapingOperandAt(int index) { return false; } | 2757 virtual bool HasEscapingOperandAt(int index) { return false; } |
2778 virtual Representation RequiredInputRepresentation(int index) { | 2758 virtual Representation RequiredInputRepresentation(int index) { |
2779 return Representation::Tagged(); | 2759 return Representation::Tagged(); |
2780 } | 2760 } |
2781 virtual void HandleSideEffectDominator(GVNFlag side_effect, | 2761 virtual void HandleSideEffectDominator(GVNFlag side_effect, |
2782 HValue* dominator); | 2762 HValue* dominator); |
2783 virtual void PrintDataTo(StringStream* stream); | 2763 virtual void PrintDataTo(StringStream* stream); |
(...skipping 3929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6713 virtual bool IsDeletable() const { return true; } | 6693 virtual bool IsDeletable() const { return true; } |
6714 }; | 6694 }; |
6715 | 6695 |
6716 | 6696 |
6717 #undef DECLARE_INSTRUCTION | 6697 #undef DECLARE_INSTRUCTION |
6718 #undef DECLARE_CONCRETE_INSTRUCTION | 6698 #undef DECLARE_CONCRETE_INSTRUCTION |
6719 | 6699 |
6720 } } // namespace v8::internal | 6700 } } // namespace v8::internal |
6721 | 6701 |
6722 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6702 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |