summaryrefslogtreecommitdiff
path: root/deps/v8/tools/check-unused-bailouts.sh
blob: 68c2c91548977f795310ef420542b27403fa7dbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# Copyright 2015 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.

v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
bailouts=$(
    grep \
        --only-matching \
        --perl-regexp 'V\(\K(k[^,]*)' \
        -- "$v8_root/src/bailout-reason.h")

# Find bailouts which appear exactly once (in bailout-reason.h)
grep \
    --only-matching \
    --no-filename \
    --recursive \
    --word-regexp \
    --fixed-strings "$bailouts" \
    -- "$v8_root/src" "$v8_root/test/cctest" \
| sort \
| uniq -u \
| sed -e 's/.*/Bailout reason "&" seems to be unused./'

echo "Kthxbye."