OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PROPERTY_DETAILS_H_ | 5 #ifndef V8_PROPERTY_DETAILS_H_ |
6 #define V8_PROPERTY_DETAILS_H_ | 6 #define V8_PROPERTY_DETAILS_H_ |
7 | 7 |
8 #include "include/v8.h" | 8 #include "include/v8.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/utils.h" | 10 #include "src/utils.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 if (IsHeapObject()) return other.IsNone(); | 115 if (IsHeapObject()) return other.IsNone(); |
116 if (kind_ == kUInteger8 && other.kind_ == kInteger8) return false; | 116 if (kind_ == kUInteger8 && other.kind_ == kInteger8) return false; |
117 if (kind_ == kUInteger16 && other.kind_ == kInteger16) return false; | 117 if (kind_ == kUInteger16 && other.kind_ == kInteger16) return false; |
118 return kind_ > other.kind_; | 118 return kind_ > other.kind_; |
119 } | 119 } |
120 | 120 |
121 bool fits_into(const Representation& other) const { | 121 bool fits_into(const Representation& other) const { |
122 return other.is_more_general_than(*this) || other.Equals(*this); | 122 return other.is_more_general_than(*this) || other.Equals(*this); |
123 } | 123 } |
124 | 124 |
125 bool CanContainDouble(double value); | |
126 | |
127 Representation generalize(Representation other) { | 125 Representation generalize(Representation other) { |
128 if (other.fits_into(*this)) return *this; | 126 if (other.fits_into(*this)) return *this; |
129 if (other.is_more_general_than(*this)) return other; | 127 if (other.is_more_general_than(*this)) return other; |
130 return Representation::Tagged(); | 128 return Representation::Tagged(); |
131 } | 129 } |
132 | 130 |
133 int size() const { | 131 int size() const { |
134 DCHECK(!IsNone()); | 132 DCHECK(!IsNone()); |
135 if (IsInteger8() || IsUInteger8()) { | 133 if (IsInteger8() || IsUInteger8()) { |
136 return sizeof(uint8_t); | 134 return sizeof(uint8_t); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 PropertyDetails(int value, PropertyAttributes attributes) { | 294 PropertyDetails(int value, PropertyAttributes attributes) { |
297 value_ = AttributesField::update(value, attributes); | 295 value_ = AttributesField::update(value, attributes); |
298 } | 296 } |
299 | 297 |
300 uint32_t value_; | 298 uint32_t value_; |
301 }; | 299 }; |
302 | 300 |
303 } } // namespace v8::internal | 301 } } // namespace v8::internal |
304 | 302 |
305 #endif // V8_PROPERTY_DETAILS_H_ | 303 #endif // V8_PROPERTY_DETAILS_H_ |
OLD | NEW |