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_GLOBALS_H_ | 5 #ifndef V8_GLOBALS_H_ |
6 #define V8_GLOBALS_H_ | 6 #define V8_GLOBALS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 inline uint32_t ObjectHash(Address address) { | 1201 inline uint32_t ObjectHash(Address address) { |
1202 // All objects are at least pointer aligned, so we can remove the trailing | 1202 // All objects are at least pointer aligned, so we can remove the trailing |
1203 // zeros. | 1203 // zeros. |
1204 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> | 1204 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> |
1205 kPointerSizeLog2); | 1205 kPointerSizeLog2); |
1206 } | 1206 } |
1207 | 1207 |
1208 // Type feedback is encoded in such a way that, we can combine the feedback | 1208 // Type feedback is encoded in such a way that, we can combine the feedback |
1209 // at different points by performing an 'OR' operation. Type feedback moves | 1209 // at different points by performing an 'OR' operation. Type feedback moves |
1210 // to a more generic type when we combine feedback. | 1210 // to a more generic type when we combine feedback. |
1211 // kSignedSmall -> kNumber -> kNumberOrOddball -> kAny | 1211 // kSignedSmall -> kNumber -> kAny |
1212 // kString -> kAny | 1212 // kString -> kAny |
1213 // TODO(mythria): Remove kNumber type when crankshaft can handle Oddballs | |
1214 // similar to Numbers. We don't need kNumber feedback for Turbofan. Extra | |
1215 // information about Number might reduce few instructions but causes more | |
1216 // deopts. We collect Number only because crankshaft does not handle all | |
1217 // cases of oddballs. | |
1218 class BinaryOperationFeedback { | 1213 class BinaryOperationFeedback { |
1219 public: | 1214 public: |
1220 enum { | 1215 enum { |
1221 kNone = 0x0, | 1216 kNone = 0x0, |
1222 kSignedSmall = 0x1, | 1217 kSignedSmall = 0x1, |
1223 kNumber = 0x3, | 1218 kNumber = 0x3, |
1224 kNumberOrOddball = 0x7, | 1219 kString = 0x4, |
1225 kString = 0x8, | 1220 kAny = 0xF |
1226 kAny = 0x1F | |
1227 }; | 1221 }; |
1228 }; | 1222 }; |
1229 | 1223 |
1230 // TODO(epertoso): consider unifying this with BinaryOperationFeedback. | 1224 // TODO(epertoso): consider unifying this with BinaryOperationFeedback. |
1231 class CompareOperationFeedback { | 1225 class CompareOperationFeedback { |
1232 public: | 1226 public: |
1233 enum { kNone = 0x00, kSignedSmall = 0x01, kNumber = 0x3, kAny = 0x7 }; | 1227 enum { kNone = 0x00, kSignedSmall = 0x01, kNumber = 0x3, kAny = 0x7 }; |
1234 }; | 1228 }; |
1235 | 1229 |
1236 // Describes how exactly a frame has been dropped from stack. | 1230 // Describes how exactly a frame has been dropped from stack. |
(...skipping 30 matching lines...) Expand all Loading... |
1267 UNREACHABLE(); | 1261 UNREACHABLE(); |
1268 return os; | 1262 return os; |
1269 } | 1263 } |
1270 | 1264 |
1271 } // namespace internal | 1265 } // namespace internal |
1272 } // namespace v8 | 1266 } // namespace v8 |
1273 | 1267 |
1274 namespace i = v8::internal; | 1268 namespace i = v8::internal; |
1275 | 1269 |
1276 #endif // V8_GLOBALS_H_ | 1270 #endif // V8_GLOBALS_H_ |
OLD | NEW |