Lines Matching refs:function

101   explicit CoverageBlockIterator(CoverageFunction* function)
102 : function_(function) {
129 // Initialize the nesting stack with the function range.
189 // function range.
228 void MergeDuplicateRanges(CoverageFunction* function) {
229 CoverageBlockIterator iter(function);
247 void RewritePositionSingletonsToRanges(CoverageFunction* function) {
248 CoverageBlockIterator iter(function);
254 if (block.start >= function->end) {
274 void MergeConsecutiveRanges(CoverageFunction* function) {
275 CoverageBlockIterator iter(function);
292 void MergeNestedRanges(CoverageFunction* function) {
293 CoverageBlockIterator iter(function);
307 void RewriteFunctionScopeCounter(CoverageFunction* function) {
308 // Every function must have at least the top-level function counter.
309 DCHECK(!function->blocks.empty());
311 CoverageBlockIterator iter(function);
318 // If a function-scope block exists, overwrite the function count. It has
321 function->count = block.count;
324 // function-scope block is expected in CoverageFunction, not as a
331 void FilterAliasedSingletons(CoverageFunction* function) {
332 CoverageBlockIterator iter(function);
355 void FilterUncoveredRanges(CoverageFunction* function) {
356 CoverageBlockIterator iter(function);
365 void FilterEmptyRanges(CoverageFunction* function) {
366 CoverageBlockIterator iter(function);
374 void ClampToBinary(CoverageFunction* function) {
375 CoverageBlockIterator iter(function);
414 void CollectBlockCoverageInternal(CoverageFunction* function,
421 if (!function->HasNonEmptySourceRange()) return;
423 function->has_block_coverage = true;
424 function->blocks = GetSortedBlockData(info);
427 if (mode == debug::CoverageMode::kBlockBinary) ClampToBinary(function);
429 // To stay compatible with non-block coverage modes, the function-scope count
431 // This finds the function-scope counter, overwrites CoverageFunction::count,
435 RewriteFunctionScopeCounter(function);
438 if (!function->HasBlocks()) return;
447 FilterAliasedSingletons(function);
451 RewritePositionSingletonsToRanges(function);
456 MergeConsecutiveRanges(function);
458 SortBlockData(function->blocks);
459 MergeDuplicateRanges(function);
460 MergeNestedRanges(function);
462 MergeConsecutiveRanges(function);
466 FilterUncoveredRanges(function);
469 FilterEmptyRanges(function);
472 void CollectBlockCoverage(CoverageFunction* function, SharedFunctionInfo info,
474 CollectBlockCoverageInternal(function, info, mode);
480 void PrintBlockCoverage(const CoverageFunction* function,
485 function->name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
487 "Coverage for function='%s', SFI=%p, has_nonempty_source_range=%d, "
491 i::PrintF("{start: %d, end: %d, count: %d}\n", function->start, function->end,
492 function->count);
493 for (const auto& block : function->blocks) {
554 // We haven't allocated feedback vector, but executed the function
563 // vector wasn't allocated yet and the function's interrupt budget wasn't
566 SharedFunctionInfo shared = it.frame()->function().shared();
631 // Iterate shared function infos of every script and build a mapping
659 // Stack to track nested functions, referring function by index.
662 // Use sorted list to reconstruct function nesting.
669 // Find the correct outer function based on start position.
674 // (e.g. function) in the script is identical to the whole script, e.g.
675 // <script>function foo() {}<script>. The script has its own shared
676 // function info, which has the same source range as the SFI for `foo`.
716 CoverageFunction function(start, end, count, name);
719 CollectBlockCoverage(&function, *info, collectionMode);
722 // Only include a function range if itself or its parent function is
727 bool has_block_coverage = !function.blocks.empty();
733 bool has_nonempty_source_range = function.HasNonEmptySourceRange();
737 functions->emplace_back(function);
741 PrintBlockCoverage(&function, *info, has_nonempty_source_range,
755 // generated for a function, which can interfere with lazy source positions,
768 // following coverage recording (without reloads) will be at function
782 // Remove all optimized function. Optimized and inlined functions do not