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

Last change on this file since 39337 was 39337, checked in by Nikolas Zimmermann, 16 years ago

Reviewed by Darin Adler.

Fixes: https://bugs.webkit.org/show_bug.cgi?id=22876

Unify random number generation in JavaScriptCore & WebCore, by introducing
wtf/RandomNumber.h and moving wtf_random/wtf_random_init out of MathExtras.h.

wtf_random_init() has been renamed to initializeRandomNumberGenerator() and
lives in it's own private header: wtf/RandomNumberSeed.h, only intended to
be used from within JavaScriptCore.

wtf_random() has been renamed to randomNumber() and lives in a public header
wtf/RandomNumber.h, usable from within JavaScriptCore & WebCore. It encapsulates
the code taking care of initializing the random number generator (only when
building without ENABLE(JSC_MULTIPLE_THREADS), otherwhise initializeThreading()
already took care of that).

Functional change on darwin: Use random() instead of rand(), as it got a larger
period (more randomness). HTMLFormElement already contains this implementation
and I just moved it in randomNumber(), as special case for PLATFORM(DARWIN).

File size: 6.6 KB
Line 
1# JavaScriptCore - Qt4 build info
2VPATH += $$PWD
3
4INCLUDEPATH += tmp
5INCLUDEPATH += $$PWD $$PWD/parser $$PWD/bytecompiler $$PWD/debugger $$PWD/runtime $$PWD/wtf $$PWD/wtf/unicode $$PWD/interpreter $$PWD/jit $$PWD/profiler $$PWD/wrec $$PWD/API $$PWD/.. \
6 $$PWD/ForwardingHeaders $$PWD/bytecode $$PWD/assembler
7DEFINES += BUILDING_QT__
8
9isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = tmp
10GENERATED_SOURCES_DIR_SLASH = $$GENERATED_SOURCES_DIR/
11win32-* {
12 GENERATED_SOURCES_DIR_SLASH ~= s|/|\|
13 LIBS += -lwinmm
14}
15
16# Disable the JIT due to numerous observed miscompilations :(
17#CONFIG(release):isEqual(QT_ARCH,i386) {
18# JIT_DEFINES = ENABLE_JIT ENABLE_WREC ENABLE_JIT_OPTIMIZE_CALL ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS ENABLE_JIT_OPTIMIZE_ARITHMETIC
19# # gcc <= 4.1 is known to miscompile, so require >= 4.2, written as major > 3 and minor > 1
20# linux-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,1) {
21# DEFINES += $$JIT_DEFINES
22# SOURCES += wtf/TCSystemAlloc.cpp
23# DEFINES -= USE_SYSTEM_MALLOC
24# }
25# win32-msvc* {
26# DEFINES += $$JIT_DEFINES
27# }
28#}
29
30include(pcre/pcre.pri)
31
32LUT_FILES += \
33 runtime/DatePrototype.cpp \
34 runtime/NumberConstructor.cpp \
35 runtime/StringPrototype.cpp \
36 runtime/ArrayPrototype.cpp \
37 runtime/MathObject.cpp \
38 runtime/RegExpConstructor.cpp \
39 runtime/RegExpObject.cpp
40
41KEYWORDLUT_FILES += \
42 parser/Keywords.table
43
44KJSBISON += \
45 parser/Grammar.y
46
47SOURCES += \
48 wtf/Assertions.cpp \
49 wtf/HashTable.cpp \
50 wtf/MainThread.cpp \
51 wtf/RandomNumber.cpp \
52 wtf/RefCountedLeakCounter.cpp \
53 wtf/unicode/CollatorDefault.cpp \
54 wtf/unicode/icu/CollatorICU.cpp \
55 wtf/unicode/UTF8.cpp \
56 API/JSBase.cpp \
57 API/JSCallbackConstructor.cpp \
58 API/JSCallbackFunction.cpp \
59 API/JSCallbackObject.cpp \
60 API/JSClassRef.cpp \
61 API/JSContextRef.cpp \
62 API/JSObjectRef.cpp \
63 API/JSStringRef.cpp \
64 API/JSValueRef.cpp \
65 API/OpaqueJSString.cpp \
66 runtime/InitializeThreading.cpp \
67 runtime/JSGlobalData.cpp \
68 runtime/JSGlobalObject.cpp \
69 runtime/JSStaticScopeObject.cpp \
70 runtime/JSVariableObject.cpp \
71 runtime/JSActivation.cpp \
72 runtime/JSNotAnObject.cpp \
73 bytecode/CodeBlock.cpp \
74 bytecode/StructureStubInfo.cpp \
75 bytecode/JumpTable.cpp \
76 jit/JIT.cpp \
77 jit/JITCall.cpp \
78 jit/JITArithmetic.cpp \
79 jit/JITPropertyAccess.cpp \
80 jit/ExecutableAllocator.cpp \
81 bytecompiler/BytecodeGenerator.cpp \
82 runtime/ExceptionHelpers.cpp \
83 runtime/JSPropertyNameIterator.cpp \
84 interpreter/Interpreter.cpp \
85 bytecode/Opcode.cpp \
86 bytecode/SamplingTool.cpp \
87 wrec/CharacterClass.cpp \
88 wrec/CharacterClassConstructor.cpp \
89 wrec/WREC.cpp \
90 wrec/WRECFunctors.cpp \
91 wrec/WRECGenerator.cpp \
92 wrec/WRECParser.cpp \
93 interpreter/RegisterFile.cpp
94
95win32-*: SOURCES += jit/ExecutableAllocatorWin.cpp
96else: SOURCES += jit/ExecutableAllocatorPosix.cpp
97
98# AllInOneFile.cpp helps gcc analize and optimize code
99# Other compilers may be able to do this at link time
100SOURCES += \
101 runtime/ArgList.cpp \
102 runtime/Arguments.cpp \
103 runtime/ArrayConstructor.cpp \
104 runtime/ArrayPrototype.cpp \
105 runtime/BooleanConstructor.cpp \
106 runtime/BooleanObject.cpp \
107 runtime/BooleanPrototype.cpp \
108 runtime/CallData.cpp \
109 runtime/Collector.cpp \
110 runtime/CommonIdentifiers.cpp \
111 runtime/ConstructData.cpp \
112 runtime/DateConstructor.cpp \
113 runtime/DateInstance.cpp \
114 runtime/DateMath.cpp \
115 runtime/DatePrototype.cpp \
116 debugger/Debugger.cpp \
117 debugger/DebuggerCallFrame.cpp \
118 wtf/dtoa.cpp \
119 runtime/Error.cpp \
120 runtime/ErrorConstructor.cpp \
121 runtime/ErrorInstance.cpp \
122 runtime/ErrorPrototype.cpp \
123 interpreter/CallFrame.cpp \
124 runtime/FunctionConstructor.cpp \
125 runtime/FunctionPrototype.cpp \
126 runtime/GetterSetter.cpp \
127 runtime/GlobalEvalFunction.cpp \
128 runtime/Identifier.cpp \
129 runtime/InternalFunction.cpp \
130 runtime/Completion.cpp \
131 runtime/JSArray.cpp \
132 runtime/JSCell.cpp \
133 runtime/JSFunction.cpp \
134 runtime/JSGlobalObjectFunctions.cpp \
135 runtime/JSImmediate.cpp \
136 runtime/JSLock.cpp \
137 runtime/JSNumberCell.cpp \
138 runtime/JSObject.cpp \
139 runtime/JSString.cpp \
140 runtime/JSValue.cpp \
141 runtime/JSWrapperObject.cpp \
142 parser/Lexer.cpp \
143 runtime/Lookup.cpp \
144 runtime/MathObject.cpp \
145 runtime/NativeErrorConstructor.cpp \
146 runtime/NativeErrorPrototype.cpp \
147 parser/Nodes.cpp \
148 runtime/NumberConstructor.cpp \
149 runtime/NumberObject.cpp \
150 runtime/NumberPrototype.cpp \
151 runtime/ObjectConstructor.cpp \
152 runtime/ObjectPrototype.cpp \
153 runtime/Operations.cpp \
154 parser/Parser.cpp \
155 runtime/PropertyNameArray.cpp \
156 runtime/PropertySlot.cpp \
157 runtime/PrototypeFunction.cpp \
158 runtime/RegExp.cpp \
159 runtime/RegExpConstructor.cpp \
160 runtime/RegExpObject.cpp \
161 runtime/RegExpPrototype.cpp \
162 runtime/ScopeChain.cpp \
163 runtime/SmallStrings.cpp \
164 runtime/StringConstructor.cpp \
165 runtime/StringObject.cpp \
166 runtime/StringPrototype.cpp \
167 runtime/Structure.cpp \
168 runtime/StructureChain.cpp \
169 runtime/UString.cpp \
170 profiler/HeavyProfile.cpp \
171 profiler/Profile.cpp \
172 profiler/ProfileGenerator.cpp \
173 profiler/ProfileNode.cpp \
174 profiler/Profiler.cpp \
175 profiler/TreeProfile.cpp \
176 wtf/FastMalloc.cpp \
177 wtf/ThreadingQt.cpp \
178 wtf/qt/MainThreadQt.cpp
179
180# GENERATOR 1-A: LUT creator
181lut.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.lut.h
182lut.commands = perl $$PWD/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
183lut.depend = ${QMAKE_FILE_NAME}
184lut.input = LUT_FILES
185lut.CONFIG += no_link
186addExtraCompiler(lut)
187
188# GENERATOR 1-B: particular LUT creator (for 1 file only)
189keywordlut.output = $$GENERATED_SOURCES_DIR/Lexer.lut.h
190keywordlut.commands = perl $$PWD/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
191keywordlut.depend = ${QMAKE_FILE_NAME}
192keywordlut.input = KEYWORDLUT_FILES
193keywordlut.CONFIG += no_link
194addExtraCompiler(keywordlut)
195
196# GENERATOR 2: bison grammar
197kjsbison.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.cpp
198kjsbison.commands = bison -d -p kjsyy ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_BASE}.tab.c && $(MOVE) ${QMAKE_FILE_BASE}.tab.c ${QMAKE_FILE_OUT} && $(MOVE) ${QMAKE_FILE_BASE}.tab.h $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.h
199kjsbison.depend = ${QMAKE_FILE_NAME}
200kjsbison.input = KJSBISON
201kjsbison.variable_out = GENERATED_SOURCES
202kjsbison.dependency_type = TYPE_C
203kjsbison.CONFIG = target_predeps
204addExtraCompilerWithHeader(kjsbison)
205
Note: See TracBrowser for help on using the repository browser.