LLIntOfflineAsmConfig.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * Copyright (C) 2012 Apple Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
  14. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
  17. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  20. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  21. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef LLIntOfflineAsmConfig_h
  26. #define LLIntOfflineAsmConfig_h
  27. #include "LLIntCommon.h"
  28. #include <wtf/Assertions.h>
  29. #include <wtf/InlineASM.h>
  30. #include <wtf/Platform.h>
  31. #if ENABLE(LLINT_C_LOOP)
  32. #define OFFLINE_ASM_C_LOOP 1
  33. #define OFFLINE_ASM_X86 0
  34. #define OFFLINE_ASM_ARM 0
  35. #define OFFLINE_ASM_ARMv7 0
  36. #define OFFLINE_ASM_ARMv7_TRADITIONAL 0
  37. #define OFFLINE_ASM_X86_64 0
  38. #define OFFLINE_ASM_ARMv7s 0
  39. #define OFFLINE_ASM_MIPS 0
  40. #define OFFLINE_ASM_SH4 0
  41. #else // !ENABLE(LLINT_C_LOOP)
  42. #define OFFLINE_ASM_C_LOOP 0
  43. #if CPU(X86)
  44. #define OFFLINE_ASM_X86 1
  45. #else
  46. #define OFFLINE_ASM_X86 0
  47. #endif
  48. #ifdef __ARM_ARCH_7S__
  49. #define OFFLINE_ASM_ARMv7s 1
  50. #else
  51. #define OFFLINE_ASM_ARMv7s 0
  52. #endif
  53. #if CPU(ARM_THUMB2)
  54. #define OFFLINE_ASM_ARMv7 1
  55. #else
  56. #define OFFLINE_ASM_ARMv7 0
  57. #endif
  58. #if CPU(ARM_TRADITIONAL)
  59. #if WTF_ARM_ARCH_AT_LEAST(7)
  60. #define OFFLINE_ASM_ARMv7_TRADITIONAL 1
  61. #define OFFLINE_ASM_ARM 0
  62. #else
  63. #define OFFLINE_ASM_ARM 1
  64. #define OFFLINE_ASM_ARMv7_TRADITIONAL 0
  65. #endif
  66. #else
  67. #define OFFLINE_ASM_ARMv7_TRADITIONAL 0
  68. #define OFFLINE_ASM_ARM 0
  69. #endif
  70. #if CPU(X86_64)
  71. #define OFFLINE_ASM_X86_64 1
  72. #else
  73. #define OFFLINE_ASM_X86_64 0
  74. #endif
  75. #if CPU(MIPS)
  76. #define OFFLINE_ASM_MIPS 1
  77. #else
  78. #define OFFLINE_ASM_MIPS 0
  79. #endif
  80. #if CPU(SH4)
  81. #define OFFLINE_ASM_SH4 1
  82. #else
  83. #define OFFLINE_ASM_SH4 0
  84. #endif
  85. #endif // !ENABLE(LLINT_C_LOOP)
  86. #if USE(JSVALUE64)
  87. #define OFFLINE_ASM_JSVALUE64 1
  88. #else
  89. #define OFFLINE_ASM_JSVALUE64 0
  90. #endif
  91. #if !ASSERT_DISABLED
  92. #define OFFLINE_ASM_ASSERT_ENABLED 1
  93. #else
  94. #define OFFLINE_ASM_ASSERT_ENABLED 0
  95. #endif
  96. #if CPU(BIG_ENDIAN)
  97. #define OFFLINE_ASM_BIG_ENDIAN 1
  98. #else
  99. #define OFFLINE_ASM_BIG_ENDIAN 0
  100. #endif
  101. #if LLINT_OSR_TO_JIT
  102. #define OFFLINE_ASM_JIT_ENABLED 1
  103. #else
  104. #define OFFLINE_ASM_JIT_ENABLED 0
  105. #endif
  106. #if LLINT_EXECUTION_TRACING
  107. #define OFFLINE_ASM_EXECUTION_TRACING 1
  108. #else
  109. #define OFFLINE_ASM_EXECUTION_TRACING 0
  110. #endif
  111. #if LLINT_ALWAYS_ALLOCATE_SLOW
  112. #define OFFLINE_ASM_ALWAYS_ALLOCATE_SLOW 1
  113. #else
  114. #define OFFLINE_ASM_ALWAYS_ALLOCATE_SLOW 0
  115. #endif
  116. #if ENABLE(VALUE_PROFILER)
  117. #define OFFLINE_ASM_VALUE_PROFILER 1
  118. #else
  119. #define OFFLINE_ASM_VALUE_PROFILER 0
  120. #endif
  121. #if CPU(MIPS)
  122. #ifdef WTF_MIPS_PIC
  123. #define S(x) #x
  124. #define SX(x) S(x)
  125. #define OFFLINE_ASM_CPLOAD(reg) \
  126. ".set noreorder\n" \
  127. ".cpload " SX(reg) "\n" \
  128. ".set reorder\n"
  129. #else
  130. #define OFFLINE_ASM_CPLOAD(reg)
  131. #endif
  132. #endif
  133. #endif // LLIntOfflineAsmConfig_h