]> git.saurik.com Git - apple/javascriptcore.git/blame - llint/LLIntOfflineAsmConfig.h
JavaScriptCore-1218.34.tar.gz
[apple/javascriptcore.git] / llint / LLIntOfflineAsmConfig.h
CommitLineData
6fe7ccc8
A
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
26#ifndef LLIntOfflineAsmConfig_h
27#define LLIntOfflineAsmConfig_h
28
29#include "LLIntCommon.h"
30#include <wtf/Assertions.h>
31#include <wtf/InlineASM.h>
32#include <wtf/Platform.h>
33
93a37866
A
34
35#if ENABLE(LLINT_C_LOOP)
36#define OFFLINE_ASM_C_LOOP 1
37#define OFFLINE_ASM_X86 0
38#define OFFLINE_ASM_ARM 0
39#define OFFLINE_ASM_ARMv7 0
40#define OFFLINE_ASM_ARMv7_TRADITIONAL 0
41#define OFFLINE_ASM_X86_64 0
42#define OFFLINE_ASM_ARMv7s 0
43#define OFFLINE_ASM_MIPS 0
44#define OFFLINE_ASM_SH4 0
45
46#else // !ENABLE(LLINT_C_LOOP)
47
48#define OFFLINE_ASM_C_LOOP 0
49
6fe7ccc8
A
50#if CPU(X86)
51#define OFFLINE_ASM_X86 1
52#else
53#define OFFLINE_ASM_X86 0
54#endif
55
93a37866
A
56#ifdef __ARM_ARCH_7S__
57#define OFFLINE_ASM_ARMv7s 1
58#else
59#define OFFLINE_ASM_ARMv7s 0
60#endif
61
6fe7ccc8
A
62#if CPU(ARM_THUMB2)
63#define OFFLINE_ASM_ARMv7 1
64#else
65#define OFFLINE_ASM_ARMv7 0
66#endif
67
93a37866
A
68#if CPU(ARM_TRADITIONAL)
69#if WTF_ARM_ARCH_AT_LEAST(7)
70#define OFFLINE_ASM_ARMv7_TRADITIONAL 1
71#define OFFLINE_ASM_ARM 0
72#else
73#define OFFLINE_ASM_ARM 1
74#define OFFLINE_ASM_ARMv7_TRADITIONAL 0
75#endif
76#else
77#define OFFLINE_ASM_ARMv7_TRADITIONAL 0
78#define OFFLINE_ASM_ARM 0
79#endif
80
6fe7ccc8
A
81#if CPU(X86_64)
82#define OFFLINE_ASM_X86_64 1
83#else
84#define OFFLINE_ASM_X86_64 0
85#endif
86
93a37866
A
87#if CPU(MIPS)
88#define OFFLINE_ASM_MIPS 1
89#else
90#define OFFLINE_ASM_MIPS 0
91#endif
92
93#if CPU(SH4)
94#define OFFLINE_ASM_SH4 1
95#else
96#define OFFLINE_ASM_SH4 0
97#endif
98
99#endif // !ENABLE(LLINT_C_LOOP)
100
101#if CPU(ARM64)
102#define OFFLINE_ASM_ARM64 1
103#else
104#define OFFLINE_ASM_ARM64 0
105#endif
106
6fe7ccc8
A
107#if USE(JSVALUE64)
108#define OFFLINE_ASM_JSVALUE64 1
109#else
110#define OFFLINE_ASM_JSVALUE64 0
111#endif
112
113#if !ASSERT_DISABLED
114#define OFFLINE_ASM_ASSERT_ENABLED 1
115#else
116#define OFFLINE_ASM_ASSERT_ENABLED 0
117#endif
118
119#if CPU(BIG_ENDIAN)
120#define OFFLINE_ASM_BIG_ENDIAN 1
121#else
122#define OFFLINE_ASM_BIG_ENDIAN 0
123#endif
124
125#if LLINT_OSR_TO_JIT
126#define OFFLINE_ASM_JIT_ENABLED 1
127#else
128#define OFFLINE_ASM_JIT_ENABLED 0
129#endif
130
131#if LLINT_EXECUTION_TRACING
132#define OFFLINE_ASM_EXECUTION_TRACING 1
133#else
134#define OFFLINE_ASM_EXECUTION_TRACING 0
135#endif
136
137#if LLINT_ALWAYS_ALLOCATE_SLOW
138#define OFFLINE_ASM_ALWAYS_ALLOCATE_SLOW 1
139#else
140#define OFFLINE_ASM_ALWAYS_ALLOCATE_SLOW 0
141#endif
142
143#if ENABLE(VALUE_PROFILER)
144#define OFFLINE_ASM_VALUE_PROFILER 1
145#else
146#define OFFLINE_ASM_VALUE_PROFILER 0
147#endif
148
93a37866
A
149#if CPU(MIPS)
150#ifdef WTF_MIPS_PIC
151#define S(x) #x
152#define SX(x) S(x)
153#define OFFLINE_ASM_CPLOAD(reg) \
154 ".set noreorder\n" \
155 ".cpload " SX(reg) "\n" \
156 ".set reorder\n"
157#else
158#define OFFLINE_ASM_CPLOAD(reg)
159#endif
160#endif
161
6fe7ccc8
A
162#ifdef __ARM_ARCH_7S__
163#define OFFLINE_ASM_ARMv7s 1
164#else
165#define OFFLINE_ASM_ARMv7s 0
166#endif
167
93a37866
A
168// These are for building an interpreter from generated assembly code:
169#define OFFLINE_ASM_BEGIN asm (
170#define OFFLINE_ASM_END );
171
6fe7ccc8
A
172#if CPU(ARM_THUMB2)
173#define OFFLINE_ASM_GLOBAL_LABEL(label) \
174 ".globl " SYMBOL_STRING(label) "\n" \
93a37866 175 HIDE_SYMBOL(label) "\n" \
6fe7ccc8
A
176 ".thumb\n" \
177 ".thumb_func " THUMB_FUNC_PARAM(label) "\n" \
178 SYMBOL_STRING(label) ":\n"
179#else
180#define OFFLINE_ASM_GLOBAL_LABEL(label) \
181 ".globl " SYMBOL_STRING(label) "\n" \
93a37866 182 HIDE_SYMBOL(label) "\n" \
6fe7ccc8
A
183 SYMBOL_STRING(label) ":\n"
184#endif
185
93a37866
A
186#define OFFLINE_ASM_LOCAL_LABEL(label) LOCAL_LABEL_STRING(label) ":\n"
187
6fe7ccc8 188#endif // LLIntOfflineAsmConfig_h