OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 t == kNonPrimitive); | 113 t == kNonPrimitive); |
114 return TypeInfo(t); | 114 return TypeInfo(t); |
115 } | 115 } |
116 | 116 |
117 // Return the weakest (least precise) common type. | 117 // Return the weakest (least precise) common type. |
118 static TypeInfo Combine(TypeInfo a, TypeInfo b) { | 118 static TypeInfo Combine(TypeInfo a, TypeInfo b) { |
119 return TypeInfo(static_cast<Type>(a.type_ & b.type_)); | 119 return TypeInfo(static_cast<Type>(a.type_ & b.type_)); |
120 } | 120 } |
121 | 121 |
122 | 122 |
123 // Integer32 is an integer that can be represented as either a signed | 123 // Integer32 is an integer that can be represented as a signed |
124 // 32-bit integer or as an unsigned 32-bit integer. It has to be | 124 // 32-bit integer. It has to be |
125 // in the range [-2^31, 2^32 - 1]. We also have to check for negative 0 | 125 // in the range [-2^31, 2^31 - 1]. We also have to check for negative 0 |
126 // as it is not an Integer32. | 126 // as it is not an Integer32. |
127 static inline bool IsInt32Double(double value) { | 127 static inline bool IsInt32Double(double value) { |
128 const DoubleRepresentation minus_zero(-0.0); | 128 const DoubleRepresentation minus_zero(-0.0); |
129 DoubleRepresentation rep(value); | 129 DoubleRepresentation rep(value); |
130 if (rep.bits == minus_zero.bits) return false; | 130 if (rep.bits == minus_zero.bits) return false; |
131 if (value >= kMinInt && value <= kMaxInt && | 131 if (value >= kMinInt && value <= kMaxInt && |
132 value == static_cast<int32_t>(value)) { | 132 value == static_cast<int32_t>(value)) { |
133 return true; | 133 return true; |
134 } | 134 } |
135 return false; | 135 return false; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 Handle<Context> global_context_; | 275 Handle<Context> global_context_; |
276 Handle<JSObject> map_; | 276 Handle<JSObject> map_; |
277 | 277 |
278 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); | 278 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); |
279 }; | 279 }; |
280 | 280 |
281 } } // namespace v8::internal | 281 } } // namespace v8::internal |
282 | 282 |
283 #endif // V8_TYPE_INFO_H_ | 283 #endif // V8_TYPE_INFO_H_ |
OLD | NEW |