Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 V8CONFIG_H_ | 5 #ifndef V8CONFIG_H_ |
| 6 #define V8CONFIG_H_ | 6 #define V8CONFIG_H_ |
| 7 | 7 |
| 8 // Platform headers for feature detection below. | 8 // Platform headers for feature detection below. |
| 9 #if defined(__ANDROID__) | 9 #if defined(__ANDROID__) |
| 10 # include <sys/cdefs.h> | 10 # include <sys/cdefs.h> |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 // V8_NOINLINE int GetMinusOne() { return -1; } | 306 // V8_NOINLINE int GetMinusOne() { return -1; } |
| 307 #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_NOINLINE | 307 #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_NOINLINE |
| 308 # define V8_NOINLINE __attribute__((noinline)) | 308 # define V8_NOINLINE __attribute__((noinline)) |
| 309 #elif !defined(DEBUG) && V8_HAS_DECLSPEC_NOINLINE | 309 #elif !defined(DEBUG) && V8_HAS_DECLSPEC_NOINLINE |
| 310 # define V8_NOINLINE __declspec(noinline) | 310 # define V8_NOINLINE __declspec(noinline) |
| 311 #else | 311 #else |
| 312 # define V8_NOINLINE /* NOT SUPPORTED */ | 312 # define V8_NOINLINE /* NOT SUPPORTED */ |
| 313 #endif | 313 #endif |
| 314 | 314 |
| 315 | 315 |
| 316 // A macro to mark classes or functions as deprecated. | 316 // A macro (V8_DEPRECASTED) to mark classes or functions as deprecated. |
|
vogelheim
2015/05/21 09:39:20
V8_DEPRECASTED => V8_DEPRECATED
| |
| 317 #if defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE | 317 #if defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE |
| 318 # define V8_DEPRECATED(message, declarator) \ | 318 #define V8_DEPRECATED(message, declarator) \ |
| 319 declarator __attribute__((deprecated(message))) | 319 declarator __attribute__((deprecated(message))) |
| 320 #elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED | 320 #elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED |
| 321 # define V8_DEPRECATED(message, declarator) \ | 321 #define V8_DEPRECATED(message, declarator) \ |
| 322 declarator __attribute__((deprecated)) | 322 declarator __attribute__((deprecated)) |
| 323 #elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_DECLSPEC_DEPRECATED | 323 #elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_DECLSPEC_DEPRECATED |
| 324 # define V8_DEPRECATED(message, declarator) __declspec(deprecated) declarator | 324 #define V8_DEPRECATED(message, declarator) __declspec(deprecated) declarator |
| 325 #else | 325 #else |
| 326 # define V8_DEPRECATED(message, declarator) declarator | 326 #define V8_DEPRECATED(message, declarator) declarator |
| 327 #endif | 327 #endif |
| 328 | 328 |
| 329 | 329 |
| 330 // a macro to make it easier to see what will be deprecated. | 330 // a macro (V8_DEPRECATE_SOON) to make it easier to see what will be deprecated. |
|
vogelheim
2015/05/21 09:39:20
Super nitpick: Capital A in "A macro ..."
| |
| 331 #if defined(V8_IMMINENT_DEPRECATION_WARNINGS) && \ | |
| 332 V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE | |
| 333 #define V8_DEPRECATE_SOON(message, declarator) \ | |
| 334 declarator __attribute__((deprecated(message))) | |
| 335 #elif defined(V8_IMMINENT_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED | |
| 336 #define V8_DEPRECATE_SOON(message, declarator) \ | |
| 337 declarator __attribute__((deprecated)) | |
| 338 #elif defined(V8_IMMINENT_DEPRECATION_WARNINGS) && V8_HAS_DECLSPEC_DEPRECATED | |
| 339 #define V8_DEPRECATE_SOON(message, declarator) __declspec(deprecated) declarator | |
| 340 #else | |
| 331 #define V8_DEPRECATE_SOON(message, declarator) declarator | 341 #define V8_DEPRECATE_SOON(message, declarator) declarator |
| 342 #endif | |
| 332 | 343 |
| 333 | 344 |
| 334 // A macro to provide the compiler with branch prediction information. | 345 // A macro to provide the compiler with branch prediction information. |
| 335 #if V8_HAS_BUILTIN_EXPECT | 346 #if V8_HAS_BUILTIN_EXPECT |
| 336 # define V8_UNLIKELY(condition) (__builtin_expect(!!(condition), 0)) | 347 # define V8_UNLIKELY(condition) (__builtin_expect(!!(condition), 0)) |
| 337 # define V8_LIKELY(condition) (__builtin_expect(!!(condition), 1)) | 348 # define V8_LIKELY(condition) (__builtin_expect(!!(condition), 1)) |
| 338 #else | 349 #else |
| 339 # define V8_UNLIKELY(condition) (condition) | 350 # define V8_UNLIKELY(condition) (condition) |
| 340 # define V8_LIKELY(condition) (condition) | 351 # define V8_LIKELY(condition) (condition) |
| 341 #endif | 352 #endif |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 // Annotate a function indicating the caller must examine the return value. | 407 // Annotate a function indicating the caller must examine the return value. |
| 397 // Use like: | 408 // Use like: |
| 398 // int foo() WARN_UNUSED_RESULT; | 409 // int foo() WARN_UNUSED_RESULT; |
| 399 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT | 410 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT |
| 400 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | 411 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
| 401 #else | 412 #else |
| 402 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ | 413 #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */ |
| 403 #endif | 414 #endif |
| 404 | 415 |
| 405 #endif // V8CONFIG_H_ | 416 #endif // V8CONFIG_H_ |
| OLD | NEW |