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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // default constructor, copy constructor and operator= functions. | 330 // default constructor, copy constructor and operator= functions. |
331 // | 331 // |
332 // This should be used in the private: declarations for a class | 332 // This should be used in the private: declarations for a class |
333 // that wants to prevent anyone from instantiating it. This is | 333 // that wants to prevent anyone from instantiating it. This is |
334 // especially useful for classes containing only static methods. | 334 // especially useful for classes containing only static methods. |
335 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ | 335 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ |
336 TypeName() V8_DELETE; \ | 336 TypeName() V8_DELETE; \ |
337 DISALLOW_COPY_AND_ASSIGN(TypeName) | 337 DISALLOW_COPY_AND_ASSIGN(TypeName) |
338 | 338 |
339 | 339 |
340 // Define used for helping GCC to make better inlining. Don't bother for debug | 340 // Newly written code should use V8_INLINE() and V8_NOINLINE() directly. |
341 // builds. On GCC 3.4.5 using __attribute__((always_inline)) causes compilation | 341 #define INLINE(declarator) V8_INLINE(declarator) |
342 // errors in debug build. | 342 #define NO_INLINE(declarator) V8_NOINLINE(declarator) |
343 #if defined(__GNUC__) && !defined(DEBUG) | |
344 #if (__GNUC__ >= 4) | |
345 #define INLINE(header) inline header __attribute__((always_inline)) | |
346 #define NO_INLINE(header) header __attribute__((noinline)) | |
347 #else | |
348 #define INLINE(header) inline __attribute__((always_inline)) header | |
349 #define NO_INLINE(header) __attribute__((noinline)) header | |
350 #endif | |
351 #elif defined(_MSC_VER) && !defined(DEBUG) | |
352 #define INLINE(header) __forceinline header | |
353 #define NO_INLINE(header) header | |
354 #else | |
355 #define INLINE(header) inline header | |
356 #define NO_INLINE(header) header | |
357 #endif | |
358 | 343 |
359 | 344 |
360 // Newly written code should use V8_WARN_UNUSED_RESULT. | 345 // Newly written code should use V8_WARN_UNUSED_RESULT. |
361 #define MUST_USE_RESULT V8_WARN_UNUSED_RESULT | 346 #define MUST_USE_RESULT V8_WARN_UNUSED_RESULT |
362 | 347 |
363 | 348 |
364 // Define DISABLE_ASAN macros. | 349 // Define DISABLE_ASAN macros. |
365 #if defined(__has_feature) | 350 #if defined(__has_feature) |
366 #if __has_feature(address_sanitizer) | 351 #if __has_feature(address_sanitizer) |
367 #define DISABLE_ASAN __attribute__((no_address_safety_analysis)) | 352 #define DISABLE_ASAN __attribute__((no_address_safety_analysis)) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 // the backend, so both modes are represented by the kStrictMode value. | 407 // the backend, so both modes are represented by the kStrictMode value. |
423 enum StrictModeFlag { | 408 enum StrictModeFlag { |
424 kNonStrictMode, | 409 kNonStrictMode, |
425 kStrictMode | 410 kStrictMode |
426 }; | 411 }; |
427 | 412 |
428 | 413 |
429 } } // namespace v8::internal | 414 } } // namespace v8::internal |
430 | 415 |
431 #endif // V8_GLOBALS_H_ | 416 #endif // V8_GLOBALS_H_ |
OLD | NEW |