| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 // default constructor, copy constructor and operator= functions. | 349 // default constructor, copy constructor and operator= functions. |
| 350 // | 350 // |
| 351 // This should be used in the private: declarations for a class | 351 // This should be used in the private: declarations for a class |
| 352 // that wants to prevent anyone from instantiating it. This is | 352 // that wants to prevent anyone from instantiating it. This is |
| 353 // especially useful for classes containing only static methods. | 353 // especially useful for classes containing only static methods. |
| 354 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ | 354 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ |
| 355 TypeName() V8_DELETE; \ | 355 TypeName() V8_DELETE; \ |
| 356 DISALLOW_COPY_AND_ASSIGN(TypeName) | 356 DISALLOW_COPY_AND_ASSIGN(TypeName) |
| 357 | 357 |
| 358 | 358 |
| 359 // Newly written code should use V8_INLINE() and V8_NOINLINE() directly. | 359 // Newly written code should use V8_INLINE and V8_NOINLINE directly. |
| 360 #define INLINE(declarator) V8_INLINE(declarator) | 360 #define INLINE(declarator) V8_INLINE declarator |
| 361 #define NO_INLINE(declarator) V8_NOINLINE(declarator) | 361 #define NO_INLINE(declarator) V8_NOINLINE declarator |
| 362 | 362 |
| 363 | 363 |
| 364 // Newly written code should use V8_WARN_UNUSED_RESULT. | 364 // Newly written code should use V8_WARN_UNUSED_RESULT. |
| 365 #define MUST_USE_RESULT V8_WARN_UNUSED_RESULT | 365 #define MUST_USE_RESULT V8_WARN_UNUSED_RESULT |
| 366 | 366 |
| 367 | 367 |
| 368 // Define DISABLE_ASAN macros. | 368 // Define DISABLE_ASAN macros. |
| 369 #if defined(__has_feature) | 369 #if defined(__has_feature) |
| 370 #if __has_feature(address_sanitizer) | 370 #if __has_feature(address_sanitizer) |
| 371 #define DISABLE_ASAN __attribute__((no_address_safety_analysis)) | 371 #define DISABLE_ASAN __attribute__((no_address_safety_analysis)) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 400 // neither in strict nor extended mode. However, the more distinguishing term | 400 // neither in strict nor extended mode. However, the more distinguishing term |
| 401 // 'classic mode' is used in V8 instead to avoid mix-ups. | 401 // 'classic mode' is used in V8 instead to avoid mix-ups. |
| 402 | 402 |
| 403 enum LanguageMode { | 403 enum LanguageMode { |
| 404 CLASSIC_MODE, | 404 CLASSIC_MODE, |
| 405 STRICT_MODE, | 405 STRICT_MODE, |
| 406 EXTENDED_MODE | 406 EXTENDED_MODE |
| 407 }; | 407 }; |
| 408 | 408 |
| 409 | 409 |
| 410 // A simple Maybe type, that can be passed by value. | |
| 411 template<class T> | |
| 412 struct Maybe { | |
| 413 Maybe() : has_value(false) {} | |
| 414 explicit Maybe(T t) : has_value(true), value(t) {} | |
| 415 Maybe(bool has, T t) : has_value(has), value(t) {} | |
| 416 | |
| 417 bool has_value; | |
| 418 T value; | |
| 419 }; | |
| 420 | |
| 421 | |
| 422 // The Strict Mode (ECMA-262 5th edition, 4.2.2). | 410 // The Strict Mode (ECMA-262 5th edition, 4.2.2). |
| 423 // | 411 // |
| 424 // This flag is used in the backend to represent the language mode. So far | 412 // This flag is used in the backend to represent the language mode. So far |
| 425 // there is no semantic difference between the strict and the extended mode in | 413 // there is no semantic difference between the strict and the extended mode in |
| 426 // the backend, so both modes are represented by the kStrictMode value. | 414 // the backend, so both modes are represented by the kStrictMode value. |
| 427 enum StrictModeFlag { | 415 enum StrictModeFlag { |
| 428 kNonStrictMode, | 416 kNonStrictMode, |
| 429 kStrictMode | 417 kStrictMode |
| 430 }; | 418 }; |
| 431 | 419 |
| 432 | 420 |
| 433 } } // namespace v8::internal | 421 } } // namespace v8::internal |
| 434 | 422 |
| 435 #endif // V8_GLOBALS_H_ | 423 #endif // V8_GLOBALS_H_ |
| OLD | NEW |