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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1032 } | 1032 } |
1033 | 1033 |
1034 GVNFlagSet ObservableChangesFlags() const { | 1034 GVNFlagSet ObservableChangesFlags() const { |
1035 GVNFlagSet result = gvn_flags_; | 1035 GVNFlagSet result = gvn_flags_; |
1036 result.Intersect(AllChangesFlagSet()); | 1036 result.Intersect(AllChangesFlagSet()); |
1037 result.Intersect(AllObservableSideEffectsFlagSet()); | 1037 result.Intersect(AllObservableSideEffectsFlagSet()); |
1038 return result; | 1038 return result; |
1039 } | 1039 } |
1040 | 1040 |
1041 Range* range() const { return range_; } | 1041 Range* range() const { return range_; } |
1042 // We should really use the null object pattern here... | |
Jakob Kummerow
2013/06/07 16:50:07
nit: I don't think this comment adds value.
Sven Panne
2013/06/10 11:05:39
I'll change this into a real TODO then, code like
| |
1042 bool HasRange() const { return range_ != NULL; } | 1043 bool HasRange() const { return range_ != NULL; } |
1044 bool CanBeNegative() const { return !HasRange() || range()->CanBeNegative(); } | |
1045 bool CanBeZero() const { return !HasRange() || range()->CanBeZero(); } | |
1046 bool RangeCanInclude(int value) const { | |
1047 return !HasRange() || range()->Includes(value); | |
1048 } | |
1043 void AddNewRange(Range* r, Zone* zone); | 1049 void AddNewRange(Range* r, Zone* zone); |
1044 void RemoveLastAddedRange(); | 1050 void RemoveLastAddedRange(); |
1045 void ComputeInitialRange(Zone* zone); | 1051 void ComputeInitialRange(Zone* zone); |
1046 | 1052 |
1047 // Representation helpers. | 1053 // Representation helpers. |
1048 virtual Representation observed_input_representation(int index) { | 1054 virtual Representation observed_input_representation(int index) { |
1049 return Representation::None(); | 1055 return Representation::None(); |
1050 } | 1056 } |
1051 virtual Representation RequiredInputRepresentation(int index) = 0; | 1057 virtual Representation RequiredInputRepresentation(int index) = 0; |
1052 virtual void InferRepresentation(HInferRepresentation* h_infer); | 1058 virtual void InferRepresentation(HInferRepresentation* h_infer); |
(...skipping 5509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6562 virtual bool IsDeletable() const { return true; } | 6568 virtual bool IsDeletable() const { return true; } |
6563 }; | 6569 }; |
6564 | 6570 |
6565 | 6571 |
6566 #undef DECLARE_INSTRUCTION | 6572 #undef DECLARE_INSTRUCTION |
6567 #undef DECLARE_CONCRETE_INSTRUCTION | 6573 #undef DECLARE_CONCRETE_INSTRUCTION |
6568 | 6574 |
6569 } } // namespace v8::internal | 6575 } } // namespace v8::internal |
6570 | 6576 |
6571 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6577 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |