Home | History | Annotate | Download | only in tools
      1 #!/bin/bash
      2 # Copyright 2015 the V8 project authors. All rights reserved.
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 
      6 v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
      7 bailouts=$(grep -oP 'V\(\K(k[^,]*)' "$v8_root/src/bailout-reason.h")
      8 
      9 for bailout in $bailouts; do
     10   bailout_uses=$(grep -r $bailout "$v8_root/src" "$v8_root/test/cctest" | wc -l)
     11   if [ $bailout_uses -eq "1" ]; then
     12     echo "Bailout reason \"$bailout\" seems to be unused."
     13   fi
     14 done
     15 
     16 echo "Kthxbye."
     17