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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 const int kBinary32ExponentBias = 127; | 246 const int kBinary32ExponentBias = 127; |
247 const int kBinary32MaxExponent = 0xFE; | 247 const int kBinary32MaxExponent = 0xFE; |
248 const int kBinary32MinExponent = 0x01; | 248 const int kBinary32MinExponent = 0x01; |
249 const int kBinary32MantissaBits = 23; | 249 const int kBinary32MantissaBits = 23; |
250 const int kBinary32ExponentShift = 23; | 250 const int kBinary32ExponentShift = 23; |
251 | 251 |
252 // Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no | 252 // Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no |
253 // other bits set. | 253 // other bits set. |
254 const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51; | 254 const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51; |
255 | 255 |
256 // ASCII/UTF-16 constants | 256 // Latin1/UTF-16 constants |
257 // Code-point values in Unicode 4.0 are 21 bits wide. | 257 // Code-point values in Unicode 4.0 are 21 bits wide. |
258 // Code units in UTF-16 are 16 bits wide. | 258 // Code units in UTF-16 are 16 bits wide. |
259 typedef uint16_t uc16; | 259 typedef uint16_t uc16; |
260 typedef int32_t uc32; | 260 typedef int32_t uc32; |
261 const int kASCIISize = kCharSize; | 261 const int kOneByteSize = kCharSize; |
262 const int kUC16Size = sizeof(uc16); // NOLINT | 262 const int kUC16Size = sizeof(uc16); // NOLINT |
263 const uc32 kMaxAsciiCharCode = 0x7f; | |
264 const uint32_t kMaxAsciiCharCodeU = 0x7fu; | |
265 | 263 |
266 | 264 |
267 // The expression OFFSET_OF(type, field) computes the byte-offset | 265 // The expression OFFSET_OF(type, field) computes the byte-offset |
268 // of the specified field relative to the containing type. This | 266 // of the specified field relative to the containing type. This |
269 // corresponds to 'offsetof' (in stddef.h), except that it doesn't | 267 // corresponds to 'offsetof' (in stddef.h), except that it doesn't |
270 // use 0 or NULL, which causes a problem with the compiler warnings | 268 // use 0 or NULL, which causes a problem with the compiler warnings |
271 // we have enabled (which is also why 'offsetof' doesn't seem to work). | 269 // we have enabled (which is also why 'offsetof' doesn't seem to work). |
272 // Here we simply use the non-zero value 4, which seems to work. | 270 // Here we simply use the non-zero value 4, which seems to work. |
273 #define OFFSET_OF(type, field) \ | 271 #define OFFSET_OF(type, field) \ |
274 (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(4)->field)) - 4) | 272 (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(4)->field)) - 4) |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 // the backend, so both modes are represented by the kStrictMode value. | 394 // the backend, so both modes are represented by the kStrictMode value. |
397 enum StrictModeFlag { | 395 enum StrictModeFlag { |
398 kNonStrictMode, | 396 kNonStrictMode, |
399 kStrictMode | 397 kStrictMode |
400 }; | 398 }; |
401 | 399 |
402 | 400 |
403 } } // namespace v8::internal | 401 } } // namespace v8::internal |
404 | 402 |
405 #endif // V8_GLOBALS_H_ | 403 #endif // V8_GLOBALS_H_ |
OLD | NEW |