| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 static Representation Integer32() { return Representation(kInteger32); } | 96 static Representation Integer32() { return Representation(kInteger32); } |
| 97 static Representation Double() { return Representation(kDouble); } | 97 static Representation Double() { return Representation(kDouble); } |
| 98 static Representation External() { return Representation(kExternal); } | 98 static Representation External() { return Representation(kExternal); } |
| 99 | 99 |
| 100 static Representation FromKind(Kind kind) { return Representation(kind); } | 100 static Representation FromKind(Kind kind) { return Representation(kind); } |
| 101 | 101 |
| 102 bool Equals(const Representation& other) const { | 102 bool Equals(const Representation& other) const { |
| 103 return kind_ == other.kind_; | 103 return kind_ == other.kind_; |
| 104 } | 104 } |
| 105 | 105 |
| 106 bool IsCompatibleForStore(const Representation& other) const { |
| 107 return Equals(other); |
| 108 } |
| 109 |
| 106 bool is_more_general_than(const Representation& other) const { | 110 bool is_more_general_than(const Representation& other) const { |
| 107 ASSERT(kind_ != kExternal); | 111 ASSERT(kind_ != kExternal); |
| 108 ASSERT(other.kind_ != kExternal); | 112 ASSERT(other.kind_ != kExternal); |
| 109 return kind_ > other.kind_; | 113 return kind_ > other.kind_; |
| 110 } | 114 } |
| 111 | 115 |
| 112 bool fits_into(const Representation& other) const { | 116 bool fits_into(const Representation& other) const { |
| 113 return other.is_more_general_than(*this) || other.Equals(*this); | 117 return other.is_more_general_than(*this) || other.Equals(*this); |
| 114 } | 118 } |
| 115 | 119 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 value_ = RepresentationField::update( | 245 value_ = RepresentationField::update( |
| 242 value, EncodeRepresentation(representation)); | 246 value, EncodeRepresentation(representation)); |
| 243 } | 247 } |
| 244 | 248 |
| 245 uint32_t value_; | 249 uint32_t value_; |
| 246 }; | 250 }; |
| 247 | 251 |
| 248 } } // namespace v8::internal | 252 } } // namespace v8::internal |
| 249 | 253 |
| 250 #endif // V8_PROPERTY_DETAILS_H_ | 254 #endif // V8_PROPERTY_DETAILS_H_ |
| OLD | NEW |