| 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 | 321 |
| 322 // FUNCTION_CAST<F>(addr) casts an address into a function | 322 // FUNCTION_CAST<F>(addr) casts an address into a function |
| 323 // of type F. Used to invoke generated code from within C. | 323 // of type F. Used to invoke generated code from within C. |
| 324 template <typename F> | 324 template <typename F> |
| 325 F FUNCTION_CAST(Address addr) { | 325 F FUNCTION_CAST(Address addr) { |
| 326 return reinterpret_cast<F>(reinterpret_cast<intptr_t>(addr)); | 326 return reinterpret_cast<F>(reinterpret_cast<intptr_t>(addr)); |
| 327 } | 327 } |
| 328 | 328 |
| 329 | 329 |
| 330 #if __cplusplus >= 201103L |
| 331 #define DISALLOW_BY_DELETE = delete |
| 332 #else |
| 333 #define DISALLOW_BY_DELETE |
| 334 #endif |
| 335 |
| 336 |
| 330 // A macro to disallow the evil copy constructor and operator= functions | 337 // A macro to disallow the evil copy constructor and operator= functions |
| 331 // This should be used in the private: declarations for a class | 338 // This should be used in the private: declarations for a class |
| 332 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ | 339 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ |
| 333 TypeName(const TypeName&); \ | 340 TypeName(const TypeName&) DISALLOW_BY_DELETE; \ |
| 334 void operator=(const TypeName&) | 341 void operator=(const TypeName&) DISALLOW_BY_DELETE |
| 335 | 342 |
| 336 | 343 |
| 337 // A macro to disallow all the implicit constructors, namely the | 344 // A macro to disallow all the implicit constructors, namely the |
| 338 // default constructor, copy constructor and operator= functions. | 345 // default constructor, copy constructor and operator= functions. |
| 339 // | 346 // |
| 340 // This should be used in the private: declarations for a class | 347 // This should be used in the private: declarations for a class |
| 341 // that wants to prevent anyone from instantiating it. This is | 348 // that wants to prevent anyone from instantiating it. This is |
| 342 // especially useful for classes containing only static methods. | 349 // especially useful for classes containing only static methods. |
| 343 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ | 350 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ |
| 344 TypeName(); \ | 351 TypeName() DISALLOW_BY_DELETE; \ |
| 345 DISALLOW_COPY_AND_ASSIGN(TypeName) | 352 DISALLOW_COPY_AND_ASSIGN(TypeName) |
| 346 | 353 |
| 347 | 354 |
| 348 // Define used for helping GCC to make better inlining. Don't bother for debug | 355 // Define used for helping GCC to make better inlining. Don't bother for debug |
| 349 // builds. On GCC 3.4.5 using __attribute__((always_inline)) causes compilation | 356 // builds. On GCC 3.4.5 using __attribute__((always_inline)) causes compilation |
| 350 // errors in debug build. | 357 // errors in debug build. |
| 351 #if defined(__GNUC__) && !defined(DEBUG) | 358 #if defined(__GNUC__) && !defined(DEBUG) |
| 352 #if (__GNUC__ >= 4) | 359 #if (__GNUC__ >= 4) |
| 353 #define INLINE(header) inline header __attribute__((always_inline)) | 360 #define INLINE(header) inline header __attribute__((always_inline)) |
| 354 #define NO_INLINE(header) header __attribute__((noinline)) | 361 #define NO_INLINE(header) header __attribute__((noinline)) |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 // the backend, so both modes are represented by the kStrictMode value. | 440 // the backend, so both modes are represented by the kStrictMode value. |
| 434 enum StrictModeFlag { | 441 enum StrictModeFlag { |
| 435 kNonStrictMode, | 442 kNonStrictMode, |
| 436 kStrictMode | 443 kStrictMode |
| 437 }; | 444 }; |
| 438 | 445 |
| 439 | 446 |
| 440 } } // namespace v8::internal | 447 } } // namespace v8::internal |
| 441 | 448 |
| 442 #endif // V8_GLOBALS_H_ | 449 #endif // V8_GLOBALS_H_ |
| OLD | NEW |