/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/src/builtins/internal-coverage.tq
40 строк
1 KB
Michaël Zasso
deps: update V8 to 11.8.172.13
10 окт 2023, 09:25
Не верифицирован
10 окт 2023, 09:25
17a74dd
Код
Авторство
О чём код?
// Copyright 2019 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include 'src/builtins/builtins-regexp-gen.h' namespace internal_coverage { extern macro GetCoverageInfo(SharedFunctionInfo): Object; macro GetCoverageInfo(implicit context: Context)(function: JSFunction): CoverageInfo labels IfNoCoverageInfo { const shared: SharedFunctionInfo = function.shared_function_info; const maybeCoverageInfo = GetCoverageInfo(shared); const coverageInfo = Cast<CoverageInfo>(maybeCoverageInfo) otherwise goto IfNoCoverageInfo; return coverageInfo; } macro IncrementBlockCount( implicit context: Context)(coverageInfo: CoverageInfo, slot: Smi): void { dcheck(Convert<int32>(slot) < coverageInfo.slot_count); ++coverageInfo.slots[slot].block_count; } builtin IncBlockCounter( implicit context: Context)(function: JSFunction, coverageArraySlotIndex: Smi): Undefined { // It's quite possible that a function contains IncBlockCounter bytecodes, // but no coverage info exists. This happens e.g. by selecting the // best-effort coverage collection mode, which triggers deletion of all // coverage infos in order to avoid memory leaks. const coverageInfo: CoverageInfo = GetCoverageInfo(function) otherwise return Undefined; IncrementBlockCount(coverageInfo, coverageArraySlotIndex); return Undefined; } } // namespace internal_coverage