source: webkit/trunk/JavaScriptCore/JavaScriptCore.pri@ 44550

Last change on this file since 44550 was 44550, checked in by [email protected], 16 years ago

Bug 26249: Support JSON.stringify
<https://bugs.webkit.org/show_bug.cgi?id=26249>

Reviewed by Sam Weinig.

Implement JSON.stringify. This patch handles all the semantics of the ES5
JSON.stringify function, including replacer functions and arrays and both
string and numeric gap arguments.

Currently uses a clamped recursive algorithm basically identical to the spec
description but with a few minor tweaks for performance and corrected semantics
discussed in the es-discuss mailing list.

File size: 8.3 KB
Line 
1# JavaScriptCore - Qt4 build info
2VPATH += $$PWD
3
4CONFIG(debug, debug|release) {
5 isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = generated$${QMAKE_DIR_SEP}debug
6 OBJECTS_DIR = obj/debug
7} else { # Release
8 isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = generated$${QMAKE_DIR_SEP}release
9 OBJECTS_DIR = obj/release
10}
11
12INCLUDEPATH += $$GENERATED_SOURCES_DIR \
13 $$PWD \
14 $$PWD/parser \
15 $$PWD/bytecompiler \
16 $$PWD/debugger \
17 $$PWD/runtime \
18 $$PWD/wtf \
19 $$PWD/wtf/unicode \
20 $$PWD/interpreter \
21 $$PWD/jit \
22 $$PWD/profiler \
23 $$PWD/wrec \
24 $$PWD/yarr \
25 $$PWD/API \
26 $$PWD/.. \
27 $$PWD/ForwardingHeaders \
28 $$PWD/bytecode \
29 $$PWD/assembler \
30
31DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF
32
33GENERATED_SOURCES_DIR_SLASH = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}
34win32-* {
35 LIBS += -lwinmm
36}
37
38# Default rules to turn JIT on/off
39!contains(DEFINES, ENABLE_JIT=.) {
40 isEqual(QT_ARCH,i386)|isEqual(QT_ARCH,windows) {
41 # Require gcc >= 4.1
42 CONFIG(release):linux-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
43 DEFINES += ENABLE_JIT=1
44 }
45 win32-msvc* {
46 DEFINES += ENABLE_JIT=1
47 }
48 }
49}
50
51# Rules when JIT enabled
52contains(DEFINES, ENABLE_JIT=1) {
53 !contains(DEFINES, ENABLE_YARR=.): DEFINES += ENABLE_YARR=1
54 !contains(DEFINES, ENABLE_YARR_JIT=.): DEFINES += ENABLE_YARR_JIT=1
55 !contains(DEFINES, ENABLE_JIT_OPTIMIZE_CALL=.): DEFINES += ENABLE_JIT_OPTIMIZE_CALL=1
56 !contains(DEFINES, ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS=.): DEFINES += ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS=1
57 !contains(DEFINES, ENABLE_JIT_OPTIMIZE_ARITHMETIC=.): DEFINES += ENABLE_JIT_OPTIMIZE_ARITHMETIC=1
58 linux-g++* {
59 !contains(DEFINES, WTF_USE_JIT_STUB_ARGUMENT_VA_LIST=.): DEFINES += WTF_USE_JIT_STUB_ARGUMENT_VA_LIST=1
60 QMAKE_CXXFLAGS += -fno-stack-protector
61 QMAKE_CFLAGS += -fno-stack-protector
62 }
63 win32-msvc* {
64 !contains(DEFINES, WTF_USE_JIT_STUB_ARGUMENT_REGISTER=.): DEFINES += WTF_USE_JIT_STUB_ARGUMENT_REGISTER=1
65 }
66}
67
68include(pcre/pcre.pri)
69
70LUT_FILES += \
71 runtime/DatePrototype.cpp \
72 runtime/NumberConstructor.cpp \
73 runtime/StringPrototype.cpp \
74 runtime/ArrayPrototype.cpp \
75 runtime/MathObject.cpp \
76 runtime/RegExpConstructor.cpp \
77 runtime/RegExpObject.cpp
78
79KEYWORDLUT_FILES += \
80 parser/Keywords.table
81
82JSCBISON += \
83 parser/Grammar.y
84
85SOURCES += \
86 wtf/Assertions.cpp \
87 wtf/ByteArray.cpp \
88 wtf/HashTable.cpp \
89 wtf/MainThread.cpp \
90 wtf/RandomNumber.cpp \
91 wtf/RefCountedLeakCounter.cpp \
92 wtf/TypeTraits.cpp \
93 wtf/unicode/CollatorDefault.cpp \
94 wtf/unicode/icu/CollatorICU.cpp \
95 wtf/unicode/UTF8.cpp \
96 API/JSBase.cpp \
97 API/JSCallbackConstructor.cpp \
98 API/JSCallbackFunction.cpp \
99 API/JSCallbackObject.cpp \
100 API/JSClassRef.cpp \
101 API/JSContextRef.cpp \
102 API/JSObjectRef.cpp \
103 API/JSStringRef.cpp \
104 API/JSValueRef.cpp \
105 API/OpaqueJSString.cpp \
106 runtime/InitializeThreading.cpp \
107 runtime/JSGlobalData.cpp \
108 runtime/JSGlobalObject.cpp \
109 runtime/JSStaticScopeObject.cpp \
110 runtime/JSVariableObject.cpp \
111 runtime/JSActivation.cpp \
112 runtime/JSNotAnObject.cpp \
113 runtime/JSONObject.cpp \
114 runtime/LiteralParser.cpp \
115 runtime/TimeoutChecker.cpp \
116 bytecode/CodeBlock.cpp \
117 bytecode/StructureStubInfo.cpp \
118 bytecode/JumpTable.cpp \
119 jit/JIT.cpp \
120 jit/JITCall.cpp \
121 jit/JITArithmetic.cpp \
122 jit/JITOpcodes.cpp \
123 jit/JITPropertyAccess.cpp \
124 jit/ExecutableAllocator.cpp \
125 jit/JITStubs.cpp \
126 bytecompiler/BytecodeGenerator.cpp \
127 runtime/ExceptionHelpers.cpp \
128 runtime/JSPropertyNameIterator.cpp \
129 interpreter/Interpreter.cpp \
130 bytecode/Opcode.cpp \
131 bytecode/SamplingTool.cpp \
132 yarr/RegexCompiler.cpp \
133 yarr/RegexInterpreter.cpp \
134 yarr/RegexJIT.cpp \
135 interpreter/RegisterFile.cpp
136
137win32-*: SOURCES += jit/ExecutableAllocatorWin.cpp
138else: SOURCES += jit/ExecutableAllocatorPosix.cpp
139
140# AllInOneFile.cpp helps gcc analize and optimize code
141# Other compilers may be able to do this at link time
142SOURCES += \
143 runtime/ArgList.cpp \
144 runtime/Arguments.cpp \
145 runtime/ArrayConstructor.cpp \
146 runtime/ArrayPrototype.cpp \
147 runtime/BooleanConstructor.cpp \
148 runtime/BooleanObject.cpp \
149 runtime/BooleanPrototype.cpp \
150 runtime/CallData.cpp \
151 runtime/Collector.cpp \
152 runtime/CommonIdentifiers.cpp \
153 runtime/ConstructData.cpp \
154 wtf/CurrentTime.cpp \
155 runtime/DateConstructor.cpp \
156 runtime/DateConversion.cpp \
157 runtime/DateInstance.cpp \
158 runtime/DatePrototype.cpp \
159 debugger/Debugger.cpp \
160 debugger/DebuggerCallFrame.cpp \
161 debugger/DebuggerActivation.cpp \
162 wtf/dtoa.cpp \
163 runtime/Error.cpp \
164 runtime/ErrorConstructor.cpp \
165 runtime/ErrorInstance.cpp \
166 runtime/ErrorPrototype.cpp \
167 interpreter/CallFrame.cpp \
168 runtime/FunctionConstructor.cpp \
169 runtime/FunctionPrototype.cpp \
170 runtime/GetterSetter.cpp \
171 runtime/GlobalEvalFunction.cpp \
172 runtime/Identifier.cpp \
173 runtime/InternalFunction.cpp \
174 runtime/Completion.cpp \
175 runtime/JSArray.cpp \
176 runtime/JSByteArray.cpp \
177 runtime/JSCell.cpp \
178 runtime/JSFunction.cpp \
179 runtime/JSGlobalObjectFunctions.cpp \
180 runtime/JSImmediate.cpp \
181 runtime/JSLock.cpp \
182 runtime/JSNumberCell.cpp \
183 runtime/JSObject.cpp \
184 runtime/JSString.cpp \
185 runtime/JSValue.cpp \
186 runtime/JSWrapperObject.cpp \
187 parser/Lexer.cpp \
188 runtime/Lookup.cpp \
189 runtime/MathObject.cpp \
190 runtime/NativeErrorConstructor.cpp \
191 runtime/NativeErrorPrototype.cpp \
192 parser/Nodes.cpp \
193 runtime/NumberConstructor.cpp \
194 runtime/NumberObject.cpp \
195 runtime/NumberPrototype.cpp \
196 runtime/ObjectConstructor.cpp \
197 runtime/ObjectPrototype.cpp \
198 runtime/Operations.cpp \
199 parser/Parser.cpp \
200 parser/ParserArena.cpp \
201 runtime/PropertyNameArray.cpp \
202 runtime/PropertySlot.cpp \
203 runtime/PrototypeFunction.cpp \
204 runtime/RegExp.cpp \
205 runtime/RegExpConstructor.cpp \
206 runtime/RegExpObject.cpp \
207 runtime/RegExpPrototype.cpp \
208 runtime/ScopeChain.cpp \
209 runtime/SmallStrings.cpp \
210 runtime/StringConstructor.cpp \
211 runtime/StringObject.cpp \
212 runtime/StringPrototype.cpp \
213 runtime/Structure.cpp \
214 runtime/StructureChain.cpp \
215 runtime/UString.cpp \
216 profiler/HeavyProfile.cpp \
217 profiler/Profile.cpp \
218 profiler/ProfileGenerator.cpp \
219 profiler/ProfileNode.cpp \
220 profiler/Profiler.cpp \
221 profiler/TreeProfile.cpp \
222 wtf/DateMath.cpp \
223 wtf/FastMalloc.cpp \
224 wtf/Threading.cpp \
225 wtf/qt/MainThreadQt.cpp
226
227!contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
228 SOURCES += wtf/qt/ThreadingQt.cpp
229} else {
230 DEFINES += ENABLE_JSC_MULTIPLE_THREADS=0
231 SOURCES += wtf/ThreadingNone.cpp
232}
233
234# GENERATOR 1-A: LUT creator
235lut.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.lut.h
236lut.commands = perl $$PWD/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
237lut.depend = ${QMAKE_FILE_NAME}
238lut.input = LUT_FILES
239lut.CONFIG += no_link
240addExtraCompiler(lut)
241
242# GENERATOR 1-B: particular LUT creator (for 1 file only)
243keywordlut.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Lexer.lut.h
244keywordlut.commands = perl $$PWD/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
245keywordlut.depend = ${QMAKE_FILE_NAME}
246keywordlut.input = KEYWORDLUT_FILES
247keywordlut.CONFIG += no_link
248addExtraCompiler(keywordlut)
249
250# GENERATOR 2: bison grammar
251jscbison.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.cpp
252jscbison.commands = bison -d -p jscyy ${QMAKE_FILE_NAME} -o $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c && $(MOVE) $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c ${QMAKE_FILE_OUT} && $(MOVE) $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.h $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.h
253jscbison.depend = ${QMAKE_FILE_NAME}
254jscbison.input = JSCBISON
255jscbison.variable_out = GENERATED_SOURCES
256jscbison.dependency_type = TYPE_C
257jscbison.CONFIG = target_predeps
258addExtraCompilerWithHeader(jscbison)
259
Note: See TracBrowser for help on using the repository browser.