source: webkit/trunk/Source/JavaScriptCore/Target.pri@ 130520

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

JSC should have a way to gather and log Heap memory use and pause times
https://bugs.webkit.org/show_bug.cgi?id=98431

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

In order to improve our infrastructure for benchmark-driven development, we should
have a centralized method of gathering and logging various statistics about the state
of the JS heap. This would allow us to create and to use other tools to analyze the
output of the VM after running various workloads.

The first two statistics that might be interesting is memory use by JSC and GC pause
times. We can control whether this recording happens through the use of the Options
class, allowing us to either use environment variables or command line flags.

(JSC::Heap::collect): If we finish a collection and are still over our set GC heap size,
we end the program immediately and report an error. Also added recording of pause times.

  • heap/Heap.h:

(Heap):
(JSC::Heap::shouldCollect): When we set a specific GC heap size through Options, we
ignore all other heuristics on when we should collect and instead only ask if we're
greater than the amount specified in the Option value. This allows us to view time/memory
tradeoffs more clearly.

  • heap/HeapStatistics.cpp: Added.

(JSC):
(JSC::HeapStatistics::initialize):
(JSC::HeapStatistics::recordGCPauseTime):
(JSC::HeapStatistics::logStatistics):
(JSC::HeapStatistics::exitWithFailure):
(JSC::HeapStatistics::reportSuccess):
(JSC::HeapStatistics::parseMemoryAmount):
(StorageStatistics):
(JSC::StorageStatistics::StorageStatistics):
(JSC::StorageStatistics::operator()):
(JSC::StorageStatistics::objectWithOutOfLineStorageCount):
(JSC::StorageStatistics::objectCount):
(JSC::StorageStatistics::storageSize):
(JSC::StorageStatistics::storageCapacity):
(JSC::HeapStatistics::showObjectStatistics): Moved the old showHeapStatistics (renamed to showObjectStatistics)
to try to start collecting our various memory statistics gathering/reporting mechanisms scattered throughout the
codebase into one place.

  • heap/HeapStatistics.h: Added.

(JSC):
(HeapStatistics):

  • jsc.cpp:

(main):

  • runtime/InitializeThreading.cpp:

(JSC::initializeThreadingOnce): We need to initialize our data structures for recording
statistics if necessary.

  • runtime/Options.cpp: Add new Options for the various types of statistics we'll be gathering.

(JSC::parse):
(JSC):
(JSC::Options::initialize): Initialize the various new options using environment variables.
(JSC::Options::dumpOption):

  • runtime/Options.h:

(JSC):

Tools:

  • DumpRenderTree/mac/DumpRenderTree.mm:

(main): Added a check as to whether we should dump our JSC Heap statistics on exit.

File size: 8.5 KB
Line 
1# -------------------------------------------------------------------
2# Target file for the JavaScriptSource library
3#
4# See 'Tools/qmake/README' for an overview of the build system
5# -------------------------------------------------------------------
6
7TEMPLATE = lib
8TARGET = JavaScriptCore
9
10include(JavaScriptCore.pri)
11
12WEBKIT += wtf
13QT += core
14QT -= gui
15
16CONFIG += staticlib
17
18*-g++*:QMAKE_CXXFLAGS_RELEASE -= -O2
19*-g++*:QMAKE_CXXFLAGS_RELEASE += -O3
20
21# Rules when JIT enabled (not disabled)
22!contains(DEFINES, ENABLE_JIT=0) {
23 linux*-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
24 QMAKE_CXXFLAGS += -fno-stack-protector
25 QMAKE_CFLAGS += -fno-stack-protector
26 }
27}
28
29include(yarr/yarr.pri)
30
31INSTALLDEPS += all
32
33SOURCES += \
34 API/JSBase.cpp \
35 API/JSCallbackConstructor.cpp \
36 API/JSCallbackFunction.cpp \
37 API/JSCallbackObject.cpp \
38 API/JSClassRef.cpp \
39 API/JSContextRef.cpp \
40 API/JSObjectRef.cpp \
41 API/JSStringRef.cpp \
42 API/JSValueRef.cpp \
43 API/JSWeakObjectMapRefPrivate.cpp \
44 API/OpaqueJSString.cpp \
45 assembler/ARMAssembler.cpp \
46 assembler/ARMv7Assembler.cpp \
47 assembler/LinkBuffer.cpp \
48 assembler/MacroAssemblerARM.cpp \
49 assembler/MacroAssemblerSH4.cpp \
50 bytecode/ArrayProfile.cpp \
51 bytecode/CallLinkInfo.cpp \
52 bytecode/CallLinkStatus.cpp \
53 bytecode/CodeBlock.cpp \
54 bytecode/DFGExitProfile.cpp \
55 bytecode/ExecutionCounter.cpp \
56 bytecode/GetByIdStatus.cpp \
57 bytecode/JumpTable.cpp \
58 bytecode/LazyOperandValueProfile.cpp \
59 bytecode/MethodCallLinkInfo.cpp \
60 bytecode/MethodCallLinkStatus.cpp \
61 bytecode/MethodOfGettingAValueProfile.cpp \
62 bytecode/Opcode.cpp \
63 bytecode/PolymorphicPutByIdList.cpp \
64 bytecode/PutByIdStatus.cpp \
65 bytecode/ResolveGlobalStatus.cpp \
66 bytecode/SamplingTool.cpp \
67 bytecode/SpecialPointer.cpp \
68 bytecode/SpeculatedType.cpp \
69 bytecode/StructureStubClearingWatchpoint.cpp \
70 bytecode/StructureStubInfo.cpp \
71 bytecode/Watchpoint.cpp \
72 bytecompiler/BytecodeGenerator.cpp \
73 bytecompiler/NodesCodegen.cpp \
74 heap/CopiedSpace.cpp \
75 heap/ConservativeRoots.cpp \
76 heap/DFGCodeBlocks.cpp \
77 heap/WeakSet.cpp \
78 heap/WeakHandleOwner.cpp \
79 heap/WeakBlock.cpp \
80 heap/HandleSet.cpp \
81 heap/HandleStack.cpp \
82 heap/BlockAllocator.cpp \
83 heap/GCThreadSharedData.cpp \
84 heap/Heap.cpp \
85 heap/HeapStatistics.cpp \
86 heap/HeapTimer.cpp \
87 heap/IncrementalSweeper.cpp \
88 heap/JITStubRoutineSet.cpp \
89 heap/MachineStackMarker.cpp \
90 heap/MarkStack.cpp \
91 heap/MarkedAllocator.cpp \
92 heap/MarkedBlock.cpp \
93 heap/MarkedSpace.cpp \
94 heap/SlotVisitor.cpp \
95 heap/VTableSpectrum.cpp \
96 heap/WriteBarrierSupport.cpp \
97 debugger/DebuggerActivation.cpp \
98 debugger/DebuggerCallFrame.cpp \
99 debugger/Debugger.cpp \
100 dfg/DFGAbstractState.cpp \
101 dfg/DFGArgumentsSimplificationPhase.cpp \
102 dfg/DFGArrayMode.cpp \
103 dfg/DFGAssemblyHelpers.cpp \
104 dfg/DFGByteCodeParser.cpp \
105 dfg/DFGCapabilities.cpp \
106 dfg/DFGCFAPhase.cpp \
107 dfg/DFGCFGSimplificationPhase.cpp \
108 dfg/DFGConstantFoldingPhase.cpp \
109 dfg/DFGCorrectableJumpPoint.cpp \
110 dfg/DFGCSEPhase.cpp \
111 dfg/DFGDisassembler.cpp \
112 dfg/DFGDominators.cpp \
113 dfg/DFGDriver.cpp \
114 dfg/DFGFixupPhase.cpp \
115 dfg/DFGGraph.cpp \
116 dfg/DFGJITCompiler.cpp \
117 dfg/DFGMinifiedNode.cpp \
118 dfg/DFGNodeFlags.cpp \
119 dfg/DFGOperations.cpp \
120 dfg/DFGOSREntry.cpp \
121 dfg/DFGOSRExit.cpp \
122 dfg/DFGOSRExitCompiler.cpp \
123 dfg/DFGOSRExitCompiler64.cpp \
124 dfg/DFGOSRExitCompiler32_64.cpp \
125 dfg/DFGPhase.cpp \
126 dfg/DFGPredictionPropagationPhase.cpp \
127 dfg/DFGRepatch.cpp \
128 dfg/DFGSpeculativeJIT.cpp \
129 dfg/DFGSpeculativeJIT32_64.cpp \
130 dfg/DFGSpeculativeJIT64.cpp \
131 dfg/DFGStructureCheckHoistingPhase.cpp \
132 dfg/DFGThunks.cpp \
133 dfg/DFGValueSource.cpp \
134 dfg/DFGVariableEvent.cpp \
135 dfg/DFGVariableEventStream.cpp \
136 dfg/DFGValidate.cpp \
137 dfg/DFGVirtualRegisterAllocationPhase.cpp \
138 interpreter/AbstractPC.cpp \
139 interpreter/CallFrame.cpp \
140 interpreter/Interpreter.cpp \
141 interpreter/RegisterFile.cpp \
142 jit/ExecutableAllocatorFixedVMPool.cpp \
143 jit/ExecutableAllocator.cpp \
144 jit/HostCallReturnValue.cpp \
145 jit/GCAwareJITStubRoutine.cpp \
146 jit/JITArithmetic.cpp \
147 jit/JITArithmetic32_64.cpp \
148 jit/JITCall.cpp \
149 jit/JITCall32_64.cpp \
150 jit/JIT.cpp \
151 jit/JITExceptions.cpp \
152 jit/JITOpcodes.cpp \
153 jit/JITOpcodes32_64.cpp \
154 jit/JITPropertyAccess.cpp \
155 jit/JITPropertyAccess32_64.cpp \
156 jit/JITStubRoutine.cpp \
157 jit/JITStubs.cpp \
158 jit/JumpReplacementWatchpoint.cpp \
159 jit/ThunkGenerators.cpp \
160 llint/LLIntCLoop.cpp \
161 llint/LLIntData.cpp \
162 llint/LLIntEntrypoints.cpp \
163 llint/LLIntExceptions.cpp \
164 llint/LLIntSlowPaths.cpp \
165 llint/LLIntThunks.cpp \
166 llint/LowLevelInterpreter.cpp \
167 parser/Lexer.cpp \
168 parser/Nodes.cpp \
169 parser/ParserArena.cpp \
170 parser/Parser.cpp \
171 parser/SourceProviderCache.cpp \
172 profiler/Profile.cpp \
173 profiler/ProfileGenerator.cpp \
174 profiler/ProfileNode.cpp \
175 profiler/Profiler.cpp \
176 runtime/ArgList.cpp \
177 runtime/Arguments.cpp \
178 runtime/ArrayConstructor.cpp \
179 runtime/ArrayPrototype.cpp \
180 runtime/BooleanConstructor.cpp \
181 runtime/BooleanObject.cpp \
182 runtime/BooleanPrototype.cpp \
183 runtime/CallData.cpp \
184 runtime/CommonIdentifiers.cpp \
185 runtime/Completion.cpp \
186 runtime/ConstructData.cpp \
187 runtime/DateConstructor.cpp \
188 runtime/DateConversion.cpp \
189 runtime/DateInstance.cpp \
190 runtime/DatePrototype.cpp \
191 runtime/ErrorConstructor.cpp \
192 runtime/Error.cpp \
193 runtime/ErrorInstance.cpp \
194 runtime/ErrorPrototype.cpp \
195 runtime/ExceptionHelpers.cpp \
196 runtime/Executable.cpp \
197 runtime/FunctionConstructor.cpp \
198 runtime/FunctionPrototype.cpp \
199 runtime/GCActivityCallback.cpp \
200 runtime/GetterSetter.cpp \
201 runtime/Options.cpp \
202 runtime/Identifier.cpp \
203 runtime/InitializeThreading.cpp \
204 runtime/InternalFunction.cpp \
205 runtime/JSActivation.cpp \
206 runtime/JSAPIValueWrapper.cpp \
207 runtime/JSArray.cpp \
208 runtime/JSCell.cpp \
209 runtime/JSDateMath.cpp \
210 runtime/JSFunction.cpp \
211 runtime/JSBoundFunction.cpp \
212 runtime/JSGlobalData.cpp \
213 runtime/JSGlobalObject.cpp \
214 runtime/JSGlobalObjectFunctions.cpp \
215 runtime/JSProxy.cpp \
216 runtime/JSLock.cpp \
217 runtime/JSNotAnObject.cpp \
218 runtime/JSObject.cpp \
219 runtime/JSONObject.cpp \
220 runtime/JSPropertyNameIterator.cpp \
221 runtime/JSSegmentedVariableObject.cpp \
222 runtime/JSWithScope.cpp \
223 runtime/JSNameScope.cpp \
224 runtime/JSScope.cpp \
225 runtime/JSString.cpp \
226 runtime/JSStringJoiner.cpp \
227 runtime/JSSymbolTableObject.cpp \
228 runtime/JSValue.cpp \
229 runtime/JSVariableObject.cpp \
230 runtime/JSWrapperObject.cpp \
231 runtime/LiteralParser.cpp \
232 runtime/Lookup.cpp \
233 runtime/MathObject.cpp \
234 runtime/MemoryStatistics.cpp \
235 runtime/NameConstructor.cpp \
236 runtime/NameInstance.cpp \
237 runtime/NamePrototype.cpp \
238 runtime/NativeErrorConstructor.cpp \
239 runtime/NativeErrorPrototype.cpp \
240 runtime/NumberConstructor.cpp \
241 runtime/NumberObject.cpp \
242 runtime/NumberPrototype.cpp \
243 runtime/ObjectConstructor.cpp \
244 runtime/ObjectPrototype.cpp \
245 runtime/Operations.cpp \
246 runtime/PropertyDescriptor.cpp \
247 runtime/PropertyNameArray.cpp \
248 runtime/PropertySlot.cpp \
249 runtime/RegExpConstructor.cpp \
250 runtime/RegExpCachedResult.cpp \
251 runtime/RegExpMatchesArray.cpp \
252 runtime/RegExp.cpp \
253 runtime/RegExpObject.cpp \
254 runtime/RegExpPrototype.cpp \
255 runtime/RegExpCache.cpp \
256 runtime/SamplingCounter.cpp \
257 runtime/SmallStrings.cpp \
258 runtime/SparseArrayValueMap.cpp \
259 runtime/StrictEvalActivation.cpp \
260 runtime/StringConstructor.cpp \
261 runtime/StringObject.cpp \
262 runtime/StringPrototype.cpp \
263 runtime/StringRecursionChecker.cpp \
264 runtime/StructureChain.cpp \
265 runtime/Structure.cpp \
266 runtime/SymbolTable.cpp \
267 runtime/TimeoutChecker.cpp \
268 tools/CodeProfile.cpp \
269 tools/CodeProfiling.cpp \
270 yarr/YarrJIT.cpp \
271
272HEADERS += $$files(*.h, true)
273
274*sh4* {
275 QMAKE_CXXFLAGS += -mieee -w
276 QMAKE_CFLAGS += -mieee -w
277}
278
279lessThan(QT_GCC_MAJOR_VERSION, 5) {
280 # GCC 4.5 and before
281 lessThan(QT_GCC_MINOR_VERSION, 6) {
282 # Disable C++0x mode in JSC for those who enabled it in their Qt's mkspec.
283 *-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
284 }
285}
Note: See TracBrowser for help on using the repository browser.