xref: /third_party/node/deps/v8/tools/check-unused-bailouts.sh (revision 1cb0ef41)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/deps/v8/tools/
11cb0ef41Sopenharmony_ci#!/bin/bash
21cb0ef41Sopenharmony_ci# Copyright 2015 the V8 project authors. All rights reserved.
31cb0ef41Sopenharmony_ci# Use of this source code is governed by a BSD-style license that can be
41cb0ef41Sopenharmony_ci# found in the LICENSE file.
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_civ8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
71cb0ef41Sopenharmony_cibailouts=$(
81cb0ef41Sopenharmony_ci    grep \
91cb0ef41Sopenharmony_ci        --only-matching \
101cb0ef41Sopenharmony_ci        --perl-regexp 'V\(\K(k[^,]*)' \
111cb0ef41Sopenharmony_ci        -- "$v8_root/src/bailout-reason.h")
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci# Find bailouts which appear exactly once (in bailout-reason.h)
141cb0ef41Sopenharmony_cigrep \
151cb0ef41Sopenharmony_ci    --only-matching \
161cb0ef41Sopenharmony_ci    --no-filename \
171cb0ef41Sopenharmony_ci    --recursive \
181cb0ef41Sopenharmony_ci    --word-regexp \
191cb0ef41Sopenharmony_ci    --fixed-strings "$bailouts" \
201cb0ef41Sopenharmony_ci    -- "$v8_root/src" "$v8_root/test/cctest" \
211cb0ef41Sopenharmony_ci| sort \
221cb0ef41Sopenharmony_ci| uniq -u \
231cb0ef41Sopenharmony_ci| sed -e 's/.*/Bailout reason "&" seems to be unused./'
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ciecho "Kthxbye."
26

Indexes created Thu Nov 07 10:32:03 CST 2024