source: webkit/trunk/JavaScriptCore/VM/SamplingTool.cpp@ 38425

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

2008-11-15 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.


Renamed all forms of "byte code" "opcode" "op code" "code" "bitcode"
etc. to "bytecode".

  • VM/CTI.cpp: (JSC::CTI::printBytecodeOperandTypes): (JSC::CTI::emitAllocateNumber): (JSC::CTI::emitNakedCall): (JSC::CTI::emitNakedFastCall): (JSC::CTI::emitCTICall): (JSC::CTI::emitJumpSlowCaseIfNotJSCell): (JSC::CTI::emitJumpSlowCaseIfNotImmNum): (JSC::CTI::emitJumpSlowCaseIfNotImmNums): (JSC::CTI::emitFastArithIntToImmOrSlowCase): (JSC::CTI::compileOpCall): (JSC::CTI::emitSlowScriptCheck): (JSC::CTI::compileBinaryArithOp): (JSC::CTI::compileBinaryArithOpSlowCase): (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases): (JSC::CTI::privateCompile):
  • VM/CTI.h: (JSC::CallRecord::CallRecord): (JSC::SwitchRecord::SwitchRecord):
  • VM/CodeBlock.cpp: (JSC::CodeBlock::printStructureIDs): (JSC::CodeBlock::dump): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::derefStructureIDs): (JSC::CodeBlock::refStructureIDs):
  • VM/CodeBlock.h: (JSC::StructureStubInfo::StructureStubInfo):
  • VM/ExceptionHelpers.cpp: (JSC::createNotAnObjectError):
  • VM/Instruction.h: (JSC::Instruction::Instruction): (JSC::Instruction::):
  • VM/Machine.cpp: (JSC::BytecodeInterpreter::isBytecode): (JSC::BytecodeInterpreter::throwException): (JSC::BytecodeInterpreter::execute): (JSC::BytecodeInterpreter::tryCachePutByID): (JSC::BytecodeInterpreter::uncachePutByID): (JSC::BytecodeInterpreter::tryCacheGetByID): (JSC::BytecodeInterpreter::uncacheGetByID): (JSC::BytecodeInterpreter::privateExecute): (JSC::BytecodeInterpreter::tryCTICachePutByID): (JSC::BytecodeInterpreter::tryCTICacheGetByID): (JSC::BytecodeInterpreter::cti_op_call_JSFunction): (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall): (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall):
  • VM/Machine.h: (JSC::BytecodeInterpreter::getBytecode): (JSC::BytecodeInterpreter::getBytecodeID): (JSC::BytecodeInterpreter::isCallBytecode):
  • VM/Opcode.cpp: (JSC::): (JSC::BytecodeStats::BytecodeStats): (JSC::compareBytecodeIndices): (JSC::compareBytecodePairIndices): (JSC::BytecodeStats::~BytecodeStats): (JSC::BytecodeStats::recordInstruction): (JSC::BytecodeStats::resetLastInstruction):
  • VM/Opcode.h: (JSC::): (JSC::padBytecodeName):
  • VM/SamplingTool.cpp: (JSC::ScopeSampleRecord::sample): (JSC::SamplingTool::run): (JSC::compareBytecodeIndicesSampling): (JSC::SamplingTool::dump):
  • VM/SamplingTool.h: (JSC::ScopeSampleRecord::ScopeSampleRecord): (JSC::SamplingTool::SamplingTool):
  • bytecompiler/CodeGenerator.cpp: (JSC::CodeGenerator::generate): (JSC::CodeGenerator::CodeGenerator): (JSC::CodeGenerator::emitLabel): (JSC::CodeGenerator::emitBytecode): (JSC::CodeGenerator::emitJump): (JSC::CodeGenerator::emitJumpIfTrue): (JSC::CodeGenerator::emitJumpIfFalse): (JSC::CodeGenerator::emitMove): (JSC::CodeGenerator::emitUnaryOp): (JSC::CodeGenerator::emitPreInc): (JSC::CodeGenerator::emitPreDec): (JSC::CodeGenerator::emitPostInc): (JSC::CodeGenerator::emitPostDec): (JSC::CodeGenerator::emitBinaryOp): (JSC::CodeGenerator::emitEqualityOp): (JSC::CodeGenerator::emitUnexpectedLoad): (JSC::CodeGenerator::emitInstanceOf): (JSC::CodeGenerator::emitResolve): (JSC::CodeGenerator::emitGetScopedVar): (JSC::CodeGenerator::emitPutScopedVar): (JSC::CodeGenerator::emitResolveBase): (JSC::CodeGenerator::emitResolveWithBase): (JSC::CodeGenerator::emitResolveFunction): (JSC::CodeGenerator::emitGetById): (JSC::CodeGenerator::emitPutById): (JSC::CodeGenerator::emitPutGetter): (JSC::CodeGenerator::emitPutSetter): (JSC::CodeGenerator::emitDeleteById): (JSC::CodeGenerator::emitGetByVal): (JSC::CodeGenerator::emitPutByVal): (JSC::CodeGenerator::emitDeleteByVal): (JSC::CodeGenerator::emitPutByIndex): (JSC::CodeGenerator::emitNewObject): (JSC::CodeGenerator::emitNewArray): (JSC::CodeGenerator::emitNewFunction): (JSC::CodeGenerator::emitNewRegExp): (JSC::CodeGenerator::emitNewFunctionExpression): (JSC::CodeGenerator::emitCall): (JSC::CodeGenerator::emitReturn): (JSC::CodeGenerator::emitUnaryNoDstOp): (JSC::CodeGenerator::emitConstruct): (JSC::CodeGenerator::emitPopScope): (JSC::CodeGenerator::emitDebugHook): (JSC::CodeGenerator::emitComplexJumpScopes): (JSC::CodeGenerator::emitJumpScopes): (JSC::CodeGenerator::emitNextPropertyName): (JSC::CodeGenerator::emitCatch): (JSC::CodeGenerator::emitNewError): (JSC::CodeGenerator::emitJumpSubroutine): (JSC::CodeGenerator::emitSubroutineReturn): (JSC::CodeGenerator::emitPushNewScope): (JSC::CodeGenerator::beginSwitch): (JSC::CodeGenerator::endSwitch):
  • bytecompiler/CodeGenerator.h: (JSC::CodeGenerator::emitNode):
  • jsc.cpp: (runWithScripts):
  • masm/X86Assembler.h: (JSC::X86Assembler::): (JSC::X86Assembler::emitModRm_opr): (JSC::X86Assembler::emitModRm_opr_Unchecked): (JSC::X86Assembler::emitModRm_opm): (JSC::X86Assembler::emitModRm_opm_Unchecked): (JSC::X86Assembler::emitModRm_opmsib):
  • parser/Nodes.cpp: (JSC::NullNode::emitBytecode): (JSC::BooleanNode::emitBytecode): (JSC::NumberNode::emitBytecode): (JSC::StringNode::emitBytecode): (JSC::RegExpNode::emitBytecode): (JSC::ThisNode::emitBytecode): (JSC::ResolveNode::emitBytecode): (JSC::ArrayNode::emitBytecode): (JSC::ObjectLiteralNode::emitBytecode): (JSC::PropertyListNode::emitBytecode): (JSC::BracketAccessorNode::emitBytecode): (JSC::DotAccessorNode::emitBytecode): (JSC::ArgumentListNode::emitBytecode): (JSC::NewExprNode::emitBytecode): (JSC::EvalFunctionCallNode::emitBytecode): (JSC::FunctionCallValueNode::emitBytecode): (JSC::FunctionCallResolveNode::emitBytecode): (JSC::FunctionCallBracketNode::emitBytecode): (JSC::FunctionCallDotNode::emitBytecode): (JSC::PostfixResolveNode::emitBytecode): (JSC::PostfixBracketNode::emitBytecode): (JSC::PostfixDotNode::emitBytecode): (JSC::PostfixErrorNode::emitBytecode): (JSC::DeleteResolveNode::emitBytecode): (JSC::DeleteBracketNode::emitBytecode): (JSC::DeleteDotNode::emitBytecode): (JSC::DeleteValueNode::emitBytecode): (JSC::VoidNode::emitBytecode): (JSC::TypeOfResolveNode::emitBytecode): (JSC::TypeOfValueNode::emitBytecode): (JSC::PrefixResolveNode::emitBytecode): (JSC::PrefixBracketNode::emitBytecode): (JSC::PrefixDotNode::emitBytecode): (JSC::PrefixErrorNode::emitBytecode): (JSC::UnaryOpNode::emitBytecode): (JSC::BinaryOpNode::emitBytecode): (JSC::EqualNode::emitBytecode): (JSC::StrictEqualNode::emitBytecode): (JSC::ReverseBinaryOpNode::emitBytecode): (JSC::ThrowableBinaryOpNode::emitBytecode): (JSC::InstanceOfNode::emitBytecode): (JSC::LogicalOpNode::emitBytecode): (JSC::ConditionalNode::emitBytecode): (JSC::emitReadModifyAssignment): (JSC::ReadModifyResolveNode::emitBytecode): (JSC::AssignResolveNode::emitBytecode): (JSC::AssignDotNode::emitBytecode): (JSC::ReadModifyDotNode::emitBytecode): (JSC::AssignErrorNode::emitBytecode): (JSC::AssignBracketNode::emitBytecode): (JSC::ReadModifyBracketNode::emitBytecode): (JSC::CommaNode::emitBytecode): (JSC::ConstDeclNode::emitBytecode): (JSC::ConstStatementNode::emitBytecode): (JSC::BlockNode::emitBytecode): (JSC::EmptyStatementNode::emitBytecode): (JSC::DebuggerStatementNode::emitBytecode): (JSC::ExprStatementNode::emitBytecode): (JSC::VarStatementNode::emitBytecode): (JSC::IfNode::emitBytecode): (JSC::IfElseNode::emitBytecode): (JSC::DoWhileNode::emitBytecode): (JSC::WhileNode::emitBytecode): (JSC::ForNode::emitBytecode): (JSC::ForInNode::emitBytecode): (JSC::ContinueNode::emitBytecode): (JSC::BreakNode::emitBytecode): (JSC::ReturnNode::emitBytecode): (JSC::WithNode::emitBytecode): (JSC::SwitchNode::emitBytecode): (JSC::LabelNode::emitBytecode): (JSC::ThrowNode::emitBytecode): (JSC::TryNode::emitBytecode): (JSC::ScopeNode::ScopeNode): (JSC::EvalNode::emitBytecode): (JSC::FunctionBodyNode::emitBytecode): (JSC::ProgramNode::emitBytecode): (JSC::FuncDeclNode::emitBytecode): (JSC::FuncExprNode::emitBytecode):
  • parser/Nodes.h: (JSC::UnaryPlusNode::): (JSC::NegateNode::): (JSC::BitwiseNotNode::): (JSC::LogicalNotNode::): (JSC::MultNode::): (JSC::DivNode::): (JSC::ModNode::): (JSC::AddNode::): (JSC::SubNode::): (JSC::LeftShiftNode::): (JSC::RightShiftNode::): (JSC::UnsignedRightShiftNode::): (JSC::LessNode::): (JSC::GreaterNode::): (JSC::LessEqNode::): (JSC::GreaterEqNode::): (JSC::InstanceOfNode::): (JSC::InNode::): (JSC::EqualNode::): (JSC::NotEqualNode::): (JSC::StrictEqualNode::): (JSC::NotStrictEqualNode::): (JSC::BitAndNode::): (JSC::BitOrNode::): (JSC::BitXOrNode::): (JSC::ProgramNode::): (JSC::EvalNode::): (JSC::FunctionBodyNode::):
  • runtime/JSNotAnObject.h:
  • runtime/StructureID.cpp: (JSC::StructureID::fromDictionaryTransition):
  • wtf/Platform.h:
File size: 11.2 KB
Line 
1/*
2 * Copyright (C) 2008 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 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14 * its contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include "config.h"
30#include "SamplingTool.h"
31
32#include "CodeBlock.h"
33#include "Machine.h"
34#include "Opcode.h"
35
36#if !PLATFORM(WIN_OS)
37#include <unistd.h>
38#endif
39
40namespace JSC {
41
42void ScopeSampleRecord::sample(CodeBlock* codeBlock, Instruction* vPC)
43{
44 if (!m_samples) {
45 m_size = codeBlock->instructions.size();
46 m_samples = static_cast<int*>(calloc(m_size, sizeof(int)));
47 m_codeBlock = codeBlock;
48 }
49
50 ++m_sampleCount;
51
52 unsigned offest = vPC - codeBlock->instructions.begin();
53 // Since we don't read and write codeBlock and vPC atomically, this check
54 // can fail if we sample mid op_call / op_ret.
55 if (offest < m_size) {
56 m_samples[offest]++;
57 m_bytecodeSampleCount++;
58 }
59}
60
61#if PLATFORM(WIN_OS)
62
63static void sleepForMicroseconds(unsigned us)
64{
65 unsigned ms = us / 1000;
66 if (us && !ms)
67 ms = 1;
68 Sleep(ms);
69}
70
71#else
72
73static void sleepForMicroseconds(unsigned us)
74{
75 usleep(us);
76}
77
78#endif
79
80static inline unsigned hertz2us(unsigned hertz)
81{
82 return 1000000 / hertz;
83}
84
85void SamplingTool::run()
86{
87 while (m_running) {
88 sleepForMicroseconds(hertz2us(m_hertz));
89
90 Sample sample(m_sample, m_codeBlock);
91 ++m_sampleCount;
92
93 if (sample.isNull())
94 continue;
95
96 if (!sample.inHostFunction()) {
97 unsigned bytecodeID = m_interpreter->getBytecodeID(sample.vPC()[0].u.bytecode);
98
99 ++m_bytecodeSampleCount;
100 ++m_bytecodeSamples[bytecodeID];
101
102 if (sample.inCTIFunction())
103 m_bytecodeSamplesInCTIFunctions[bytecodeID]++;
104 }
105
106#if ENABLE(CODEBLOCK_SAMPLING)
107 MutexLocker locker(m_scopeSampleMapMutex);
108 ScopeSampleRecord* record = m_scopeSampleMap->get(sample.codeBlock()->ownerNode);
109 ASSERT(record);
110 record->sample(sample.codeBlock(), sample.vPC());
111#endif
112 }
113}
114
115void* SamplingTool::threadStartFunc(void* samplingTool)
116{
117 reinterpret_cast<SamplingTool*>(samplingTool)->run();
118 return 0;
119}
120
121void SamplingTool::notifyOfScope(ScopeNode* scope)
122{
123 MutexLocker locker(m_scopeSampleMapMutex);
124 m_scopeSampleMap->set(scope, new ScopeSampleRecord(scope));
125}
126
127void SamplingTool::start(unsigned hertz)
128{
129 ASSERT(!m_running);
130 m_running = true;
131 m_hertz = hertz;
132
133 m_samplingThread = createThread(threadStartFunc, this, "JavaScriptCore::Sampler");
134}
135
136void SamplingTool::stop()
137{
138 ASSERT(m_running);
139 m_running = false;
140 waitForThreadCompletion(m_samplingThread, 0);
141}
142
143#if ENABLE(BYTECODE_SAMPLING)
144
145struct BytecodeSampleInfo {
146 BytecodeID bytecode;
147 long long count;
148 long long countInCTIFunctions;
149};
150
151struct LineCountInfo {
152 unsigned line;
153 unsigned count;
154};
155
156static int compareLineCountInfoSampling(const void* left, const void* right)
157{
158 const LineCountInfo* leftLineCount = reinterpret_cast<const LineCountInfo*>(left);
159 const LineCountInfo* rightLineCount = reinterpret_cast<const LineCountInfo*>(right);
160
161 return (leftLineCount->line > rightLineCount->line) ? 1 : (leftLineCount->line < rightLineCount->line) ? -1 : 0;
162}
163
164static int compareBytecodeIndicesSampling(const void* left, const void* right)
165{
166 const BytecodeSampleInfo* leftSampleInfo = reinterpret_cast<const BytecodeSampleInfo*>(left);
167 const BytecodeSampleInfo* rightSampleInfo = reinterpret_cast<const BytecodeSampleInfo*>(right);
168
169 return (leftSampleInfo->count < rightSampleInfo->count) ? 1 : (leftSampleInfo->count > rightSampleInfo->count) ? -1 : 0;
170}
171
172static int compareScopeSampleRecords(const void* left, const void* right)
173{
174 const ScopeSampleRecord* const leftValue = *static_cast<const ScopeSampleRecord* const *>(left);
175 const ScopeSampleRecord* const rightValue = *static_cast<const ScopeSampleRecord* const *>(right);
176
177 return (leftValue->m_sampleCount < rightValue->m_sampleCount) ? 1 : (leftValue->m_sampleCount > rightValue->m_sampleCount) ? -1 : 0;
178}
179
180void SamplingTool::dump(ExecState* exec)
181{
182 // Tidies up SunSpider output by removing short scripts - such a small number of samples would likely not be useful anyhow.
183 if (m_sampleCount < 10)
184 return;
185
186 // (1) Build and sort 'bytecodeSampleInfo' array.
187
188 BytecodeSampleInfo bytecodeSampleInfo[numBytecodeIDs];
189 for (int i = 0; i < numBytecodeIDs; ++i) {
190 bytecodeSampleInfo[i].bytecode = static_cast<BytecodeID>(i);
191 bytecodeSampleInfo[i].count = m_bytecodeSamples[i];
192 bytecodeSampleInfo[i].countInCTIFunctions = m_bytecodeSamplesInCTIFunctions[i];
193 }
194
195 qsort(bytecodeSampleInfo, numBytecodeIDs, sizeof(BytecodeSampleInfo), compareBytecodeIndicesSampling);
196
197 // (2) Print Bytecode sampling results.
198
199 printf("\nBytecode samples [*]\n");
200 printf(" sample %% of %% of | cti cti %%\n");
201 printf("bytecode count VM total | count of self\n");
202 printf("------------------------------------------------------- | ----------------\n");
203
204 for (int i = 0; i < numBytecodeIDs; ++i) {
205 long long count = bytecodeSampleInfo[i].count;
206 if (!count)
207 continue;
208
209 BytecodeID bytecode = bytecodeSampleInfo[i].bytecode;
210
211 const char* bytecodeName = bytecodeNames[bytecode];
212 const char* bytecodePadding = padBytecodeName(bytecode, 28);
213 double percentOfVM = (static_cast<double>(count) * 100) / m_bytecodeSampleCount;
214 double percentOfTotal = (static_cast<double>(count) * 100) / m_sampleCount;
215 long long countInCTIFunctions = bytecodeSampleInfo[i].countInCTIFunctions;
216 double percentInCTIFunctions = (static_cast<double>(countInCTIFunctions) * 100) / count;
217 fprintf(stdout, "%s:%s%-6lld %.3f%%\t%.3f%%\t | %-6lld %.3f%%\n", bytecodeName, bytecodePadding, count, percentOfVM, percentOfTotal, countInCTIFunctions, percentInCTIFunctions);
218 }
219
220 printf("\n[*] Samples inside host code are not charged to any Bytecode.\n\n");
221 printf("\tSamples inside VM:\t\t%lld / %lld (%.3f%%)\n", m_bytecodeSampleCount, m_sampleCount, (static_cast<double>(m_bytecodeSampleCount) * 100) / m_sampleCount);
222 printf("\tSamples inside host code:\t%lld / %lld (%.3f%%)\n\n", m_sampleCount - m_bytecodeSampleCount, m_sampleCount, (static_cast<double>(m_sampleCount - m_bytecodeSampleCount) * 100) / m_sampleCount);
223 printf("\tsample count:\tsamples inside this bytecode\n");
224 printf("\t%% of VM:\tsample count / all bytecode samples\n");
225 printf("\t%% of total:\tsample count / all samples\n");
226 printf("\t--------------\n");
227 printf("\tcti count:\tsamples inside a CTI function called by this bytecode\n");
228 printf("\tcti %% of self:\tcti count / sample count\n");
229
230 // (3) Build and sort 'codeBlockSamples' array.
231
232 int scopeCount = m_scopeSampleMap->size();
233 Vector<ScopeSampleRecord*> codeBlockSamples(scopeCount);
234 ScopeSampleRecordMap::iterator iter = m_scopeSampleMap->begin();
235 for (int i = 0; i < scopeCount; ++i, ++iter)
236 codeBlockSamples[i] = iter->second;
237
238 qsort(codeBlockSamples.begin(), scopeCount, sizeof(ScopeSampleRecord*), compareScopeSampleRecords);
239
240 // (4) Print data from 'codeBlockSamples' array.
241
242 printf("\nCodeBlock samples\n\n");
243
244 for (int i = 0; i < scopeCount; ++i) {
245 ScopeSampleRecord* record = codeBlockSamples[i];
246 CodeBlock* codeBlock = record->m_codeBlock;
247
248 double blockPercent = (record->m_sampleCount * 100.0) / m_sampleCount;
249
250 if (blockPercent >= 1) {
251 Instruction* code = codeBlock->instructions.begin();
252 printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_scope->sourceURL().UTF8String().c_str(), codeBlock->lineNumberForVPC(code), record->m_sampleCount, m_sampleCount, blockPercent);
253 if (i < 10) {
254 HashMap<unsigned,unsigned> lineCounts;
255 codeBlock->dump(exec);
256
257 printf(" Bytecode and line number samples [*]\n\n");
258 for (unsigned op = 0; op < record->m_size; ++op) {
259 int count = record->m_samples[op];
260 if (count) {
261 printf(" [% 4d] has sample count: % 4d\n", op, count);
262 unsigned line = codeBlock->lineNumberForVPC(code+op);
263 lineCounts.set(line, (lineCounts.contains(line) ? lineCounts.get(line) : 0) + count);
264 }
265 }
266 printf("\n");
267
268 int linesCount = lineCounts.size();
269 Vector<LineCountInfo> lineCountInfo(linesCount);
270 int lineno = 0;
271 for (HashMap<unsigned,unsigned>::iterator iter = lineCounts.begin(); iter != lineCounts.end(); ++iter, ++lineno) {
272 lineCountInfo[lineno].line = iter->first;
273 lineCountInfo[lineno].count = iter->second;
274 }
275
276 qsort(lineCountInfo.begin(), linesCount, sizeof(LineCountInfo), compareLineCountInfoSampling);
277
278 for (lineno = 0; lineno < linesCount; ++lineno) {
279 printf(" Line #%d has sample count %d.\n", lineCountInfo[lineno].line, lineCountInfo[lineno].count);
280 }
281 printf("\n");
282 printf(" [*] Samples inside host code are charged to the calling Bytecode.\n");
283 printf(" Samples on a call / return boundary are not charged to a specific bytecode or line.\n\n");
284 printf(" Samples on a call / return boundary: %d / %d (%.3f%%)\n\n", record->m_sampleCount - record->m_bytecodeSampleCount, record->m_sampleCount, (static_cast<double>(record->m_sampleCount - record->m_bytecodeSampleCount) * 100) / record->m_sampleCount);
285 }
286 }
287 }
288}
289
290#else
291
292void SamplingTool::dump(ExecState*)
293{
294}
295
296#endif
297
298} // namespace JSC
Note: See TracBrowser for help on using the repository browser.