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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 return Equals(other); | 130 return Equals(other); |
131 } | 131 } |
132 | 132 |
133 bool is_more_general_than(const Representation& other) const { | 133 bool is_more_general_than(const Representation& other) const { |
134 if (kind_ == kExternal && other.kind_ == kNone) return true; | 134 if (kind_ == kExternal && other.kind_ == kNone) return true; |
135 if (kind_ == kExternal && other.kind_ == kExternal) return false; | 135 if (kind_ == kExternal && other.kind_ == kExternal) return false; |
136 if (kind_ == kNone && other.kind_ == kExternal) return false; | 136 if (kind_ == kNone && other.kind_ == kExternal) return false; |
137 | 137 |
138 ASSERT(kind_ != kExternal); | 138 ASSERT(kind_ != kExternal); |
139 ASSERT(other.kind_ != kExternal); | 139 ASSERT(other.kind_ != kExternal); |
140 if (IsHeapObject()) return other.IsDouble() || other.IsNone(); | 140 if (IsHeapObject()) return other.IsNone(); |
141 if (kind_ == kUInteger8 && other.kind_ == kInteger8) return false; | 141 if (kind_ == kUInteger8 && other.kind_ == kInteger8) return false; |
142 if (kind_ == kUInteger16 && other.kind_ == kInteger16) return false; | 142 if (kind_ == kUInteger16 && other.kind_ == kInteger16) return false; |
143 return kind_ > other.kind_; | 143 return kind_ > other.kind_; |
144 } | 144 } |
145 | 145 |
146 bool fits_into(const Representation& other) const { | 146 bool fits_into(const Representation& other) const { |
147 return other.is_more_general_than(*this) || other.Equals(*this); | 147 return other.is_more_general_than(*this) || other.Equals(*this); |
148 } | 148 } |
149 | 149 |
150 Representation generalize(Representation other) { | 150 Representation generalize(Representation other) { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 PropertyDetails(int value, PropertyAttributes attributes) { | 319 PropertyDetails(int value, PropertyAttributes attributes) { |
320 value_ = AttributesField::update(value, attributes); | 320 value_ = AttributesField::update(value, attributes); |
321 } | 321 } |
322 | 322 |
323 uint32_t value_; | 323 uint32_t value_; |
324 }; | 324 }; |
325 | 325 |
326 } } // namespace v8::internal | 326 } } // namespace v8::internal |
327 | 327 |
328 #endif // V8_PROPERTY_DETAILS_H_ | 328 #endif // V8_PROPERTY_DETAILS_H_ |
OLD | NEW |