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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 307 |
308 inline std::ostream& operator<<(std::ostream& os, const LanguageMode& mode) { | 308 inline std::ostream& operator<<(std::ostream& os, const LanguageMode& mode) { |
309 switch (mode) { | 309 switch (mode) { |
310 case SLOPPY: return os << "sloppy"; | 310 case SLOPPY: return os << "sloppy"; |
311 case STRICT: return os << "strict"; | 311 case STRICT: return os << "strict"; |
312 default: UNREACHABLE(); | 312 default: UNREACHABLE(); |
313 } | 313 } |
314 return os; | 314 return os; |
315 } | 315 } |
316 | 316 |
317 | |
318 inline bool is_sloppy(LanguageMode language_mode) { | 317 inline bool is_sloppy(LanguageMode language_mode) { |
319 return language_mode == SLOPPY; | 318 return language_mode == SLOPPY; |
320 } | 319 } |
321 | 320 |
322 | |
323 inline bool is_strict(LanguageMode language_mode) { | 321 inline bool is_strict(LanguageMode language_mode) { |
324 return language_mode != SLOPPY; | 322 return language_mode != SLOPPY; |
325 } | 323 } |
326 | 324 |
327 | |
328 inline bool is_valid_language_mode(int language_mode) { | 325 inline bool is_valid_language_mode(int language_mode) { |
329 return language_mode == SLOPPY || language_mode == STRICT; | 326 return language_mode == SLOPPY || language_mode == STRICT; |
330 } | 327 } |
331 | 328 |
332 | |
333 inline LanguageMode construct_language_mode(bool strict_bit) { | 329 inline LanguageMode construct_language_mode(bool strict_bit) { |
334 return static_cast<LanguageMode>(strict_bit); | 330 return static_cast<LanguageMode>(strict_bit); |
335 } | 331 } |
336 | 332 |
| 333 enum TypeofMode : int { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; |
| 334 |
337 // This constant is used as an undefined value when passing source positions. | 335 // This constant is used as an undefined value when passing source positions. |
338 const int kNoSourcePosition = -1; | 336 const int kNoSourcePosition = -1; |
339 | 337 |
340 // This constant is used to indicate missing deoptimization information. | 338 // This constant is used to indicate missing deoptimization information. |
341 const int kNoDeoptimizationId = -1; | 339 const int kNoDeoptimizationId = -1; |
342 | 340 |
343 // Mask for the sign bit in a smi. | 341 // Mask for the sign bit in a smi. |
344 const intptr_t kSmiSignMask = kIntptrSignBit; | 342 const intptr_t kSmiSignMask = kIntptrSignBit; |
345 | 343 |
346 const int kObjectAlignmentBits = kPointerSizeLog2; | 344 const int kObjectAlignmentBits = kPointerSizeLog2; |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 } // namespace internal | 1295 } // namespace internal |
1298 } // namespace v8 | 1296 } // namespace v8 |
1299 | 1297 |
1300 // Used by js-builtin-reducer to identify whether ReduceArrayIterator() is | 1298 // Used by js-builtin-reducer to identify whether ReduceArrayIterator() is |
1301 // reducing a JSArray method, or a JSTypedArray method. | 1299 // reducing a JSArray method, or a JSTypedArray method. |
1302 enum class ArrayIteratorKind { kArray, kTypedArray }; | 1300 enum class ArrayIteratorKind { kArray, kTypedArray }; |
1303 | 1301 |
1304 namespace i = v8::internal; | 1302 namespace i = v8::internal; |
1305 | 1303 |
1306 #endif // V8_GLOBALS_H_ | 1304 #endif // V8_GLOBALS_H_ |
OLD | NEW |