Lines Matching defs:this
7 // notice, this list of conditions and the following disclaimer.
9 // copyright notice, this list of conditions and the following
14 // from this software without specific prior written permission.
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 Profile.call(this);
37 this.skipThisFunction = function(name) { return V8Profile.IC_RE.test(name); };
74 LogReader.call(this, {
77 processor: this.processCodeCreation },
79 processor: this.processCodeMove },
81 processor: this.processCodeDelete },
87 processor: this.processSnapshotPosition }});
103 this.profile_ = new V8Profile();
104 this.serializedEntries_ = [];
114 this.profile_.addFuncCode(type, name, start, size, funcAddr, state);
116 this.profile_.addCode(type, name, start, size);
122 this.profile_.moveCode(from, to);
127 this.profile_.deleteCode(start);
132 this.serializedEntries_[pos] = this.profile_.findEntry(addr);
138 this.processLogChunk(contents);
143 var entry = this.serializedEntries_[pos];
158 LogReader.call(this, {
160 processor: this.processSharedLibrary },
163 processor: this.processCodeCreation },
165 processor: this.processCodeMove },
167 processor: this.processCodeDelete },
169 processor: this.processFunctionMove },
171 processor: this.processSnapshotPosition },
175 processor: this.processTick },
177 processor: this.processHeapSampleBegin },
179 processor: this.processHeapSampleEnd },
181 processor: this.advanceDistortion },
183 processor: this.advanceDistortion },
195 this.cppEntriesProvider_ = cppEntriesProvider;
196 this.callGraphSize_ = callGraphSize;
197 this.ignoreUnknown_ = ignoreUnknown;
198 this.stateFilter_ = stateFilter;
199 this.snapshotLogProcessor_ = snapshotLogProcessor;
200 this.sourceMap = sourceMap;
201 this.deserializedEntriesNames_ = [];
202 var ticks = this.ticks_ =
207 this.distortion_per_entry = isNaN(distortion) ? 0 : (distortion / 1000);
208 this.distortion = 0;
213 this.range_start = isNaN(range_start) ? -Infinity : (range_start * 1000);
214 this.range_end = isNaN(range_end) ? Infinity : (range_end * 1000)
228 // otherwise tick balance will be corrupted (this behavior is compatible
237 this.profile_ = new V8Profile(separateIc);
238 this.codeTypes_ = {};
240 this.viewBuilder_ = new ViewBuilder(1);
241 this.lastLogFileName_ = null;
243 this.generation_ = 1;
244 this.currentProducerProfile_ = null;
263 // Otherwise, this is JS-related code. We are not adding it to
280 this.codeTypes_[name] = TickProcessor.CodeTypes[type];
285 return this.codeTypes_[name] == TickProcessor.CodeTypes.SHARED_LIB;
290 return this.codeTypes_[name] == TickProcessor.CodeTypes.CPP;
295 return !(name in this.codeTypes_);
300 this.lastLogFileName_ = fileName;
303 this.processLogLine(line);
310 this.lastLogFileName_ = 'v8.log';
312 this.processLogChunk(contents);
318 var entry = this.profile_.addLibrary(name, startAddr, endAddr);
319 this.setCodeType(entry.getName(), 'SHARED_LIB');
321 var self = this;
322 var libFuncs = this.cppEntriesProvider_.parseVmSymbols(
332 name = this.deserializedEntriesNames_[start] || name;
336 this.profile_.addFuncCode(type, name, start, size, funcAddr, state);
338 this.profile_.addCode(type, name, start, size);
344 this.profile_.moveCode(from, to);
349 this.profile_.deleteCode(start);
354 this.profile_.moveFunc(from, to);
359 if (this.snapshotLogProcessor_) {
360 this.deserializedEntriesNames_[addr] =
361 this.snapshotLogProcessor_.getSerializedEntryName(pos);
367 return this.stateFilter_ == null || this.stateFilter_ == vmState;
376 this.distortion += this.distortion_per_entry;
377 ns_since_start -= this.distortion;
378 if (ns_since_start < this.range_start || ns_since_start > this.range_end) {
381 this.ticks_.total++;
382 if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++;
383 if (!this.includeTick(vmState)) {
384 this.ticks_.excluded++;
397 var funcEntry = this.profile_.findEntry(tos_or_external_callback);
403 this.profile_.recordTick(this.processStack(pc, tos_or_external_callback, stack));
408 this.distortion += this.distortion_per_entry;
414 this.currentProducerProfile_ = new CallTree();
419 if (space != 'Heap' || !this.currentProducerProfile_) return;
421 print('Generation ' + this.generation_ + ':');
422 var tree = this.currentProducerProfile_;
424 var producersView = this.viewBuilder_.buildView(tree);
429 this.printHeavyProfile(producersView.head.children);
431 this.currentProducerProfile_ = null;
432 this.generation_++;
437 print('Statistical profiling result from ' + this.lastLogFileName_ +
438 ', (' + this.ticks_.total +
439 ' ticks, ' + this.ticks_.unaccounted + ' unaccounted, ' +
440 this.ticks_.excluded + ' excluded).');
442 if (this.ticks_.total == 0) return;
444 var flatProfile = this.profile_.getFlatProfile();
445 var flatView = this.viewBuilder_.buildView(flatProfile);
450 var totalTicks = this.ticks_.total;
451 if (this.ignoreUnknown_) {
452 totalTicks -= this.ticks_.unaccounted;
457 var self = this;
460 this.printHeader('Shared libraries');
461 this.printEntries(flatViewNodes, totalTicks, null,
467 this.printHeader('JavaScript');
468 this.printEntries(flatViewNodes, totalTicks, nonLibraryTicks,
473 this.printHeader('C++');
474 this.printEntries(flatViewNodes, totalTicks, nonLibraryTicks,
478 this.printHeader('Summary');
479 this.printLine('JavaScript', jsTicks, totalTicks, nonLibraryTicks);
480 this.printLine('C++', cppTicks, totalTicks, nonLibraryTicks);
481 this.printLine('GC', this.ticks_.gc, totalTicks, nonLibraryTicks);
482 this.printLine('Shared libraries', libraryTicks, totalTicks, null);
483 if (!this.ignoreUnknown_ && this.ticks_.unaccounted > 0) {
484 this.printLine('Unaccounted', this.ticks_.unaccounted,
485 this.ticks_.total, null);
488 this.printHeavyProfHeader();
489 var heavyProfile = this.profile_.getBottomUpProfile();
490 var heavyView = this.viewBuilder_.buildView(heavyProfile);
497 this.printHeavyProfile(heavyView.head.children);
565 return this.sourceMap != null;
570 if (!this.hasSourceMap()) {
573 var lc = this.getLineAndColumn(funcName);
580 var entry = this.sourceMap.findEntry(lineNumber, column);
590 var that = this;
591 this.processProfile(profile, filterP, function (rec) {
601 var self = this;
604 this.processProfile(profile, function() { return true; }, function (rec) {
629 this.loadSymbols(libName);
651 var funcInfo = this.parseNextLine();
679 this.symbols = [];
680 this.parsePos = 0;
681 this.nmExec = nmExec;
682 this.targetRootFS = targetRootFS;
683 this.FUNC_RE = /^([0-9a-fA-F]{8,16}) ([0-9a-fA-F]{8,16} )?[tTwW] (.*)$/;
689 this.parsePos = 0;
690 libName = this.targetRootFS + libName;
692 this.symbols = [
693 os.system(this.nmExec, ['-C', '-n', '-S', libName], -1, -1),
694 os.system(this.nmExec, ['-C', '-n', '-S', '-D', libName], -1, -1)
697 // If the library cannot be found on this system let's not panic.
698 this.symbols = ['', ''];
704 if (this.symbols.length == 0) {
707 var lineEndPos = this.symbols[0].indexOf('\n', this.parsePos);
709 this.symbols.shift();
710 this.parsePos = 0;
711 return this.parseNextLine();
714 var line = this.symbols[0].substring(this.parsePos, lineEndPos);
715 this.parsePos = lineEndPos + 1;
716 var fields = line.match(this.FUNC_RE);
729 UnixCppEntriesProvider.call(this, nmExec, targetRootFS);
731 this.FUNC_RE = /^([0-9a-fA-F]{8,16}) ()[iItT] (.*)$/;
737 this.parsePos = 0;
738 libName = this.targetRootFS + libName;
740 this.symbols = [os.system(this.nmExec, ['-n', '-f', libName], -1, -1), ''];
742 // If the library cannot be found on this system let's not panic.
743 this.symbols = '';
749 this.targetRootFS = targetRootFS;
750 this.symbols = '';
751 this.parsePos = 0;
767 // This is almost a constant on Windows.
772 libName = this.targetRootFS + libName;
776 this.moduleType_ = fileNameFields[2].toLowerCase();
778 this.symbols = read(mapFileName);
781 this.symbols = '';
787 var lineEndPos = this.symbols.indexOf('\r\n', this.parsePos);
792 var line = this.symbols.substring(this.parsePos, lineEndPos);
793 this.parsePos = lineEndPos + 2;
800 if ((this.moduleType_ == 'exe') !=
808 { name: this.unmangleName(fields[1]), start: parseInt(fields[2], 16) } :
832 this.args_ = args;
833 this.result_ = ArgumentsProcessor.DEFAULTS;
835 this.argsDispatch_ = {
871 this.argsDispatch_['--js'] = this.argsDispatch_['-j'];
872 this.argsDispatch_['--gc'] = this.argsDispatch_['-g'];
873 this.argsDispatch_['--compiler'] = this.argsDispatch_['-c'];
874 this.argsDispatch_['--other'] = this.argsDispatch_['-o'];
875 this.argsDispatch_['--external'] = this.argsDispatch_['-e'];
895 while (this.args_.length) {
896 var arg = this.args_[0];
900 this.args_.shift();
907 if (arg in this.argsDispatch_) {
908 var dispatch = this.argsDispatch_[arg];
909 this.result_[dispatch[0]] = userValue == null ? dispatch[1] : userValue;
915 if (this.args_.length >= 1) {
916 this.result_.logFileName = this.args_.shift();
923 return this.result_;
941 for (var arg in this.argsDispatch_) {
943 var dispatch = this.argsDispatch_[arg];
944 for (var synArg in this.argsDispatch_) {
945 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) {
947 delete this.argsDispatch_[synArg];