LCOV - code coverage report
Current view: top level - src - deoptimize-reason.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 6 9 66.7 %
Date: 2019-04-17 Functions: 2 3 66.7 %

          Line data    Source code
       1             : // Copyright 2016 the V8 project authors. All rights reserved.
       2             : // Use of this source code is governed by a BSD-style license that can be
       3             : // found in the LICENSE file.
       4             : 
       5             : #include "src/deoptimize-reason.h"
       6             : 
       7             : namespace v8 {
       8             : namespace internal {
       9             : 
      10          72 : std::ostream& operator<<(std::ostream& os, DeoptimizeReason reason) {
      11          72 :   switch (reason) {
      12             : #define DEOPTIMIZE_REASON(Name, message) \
      13             :   case DeoptimizeReason::k##Name:        \
      14             :     return os << #Name;
      15          72 :     DEOPTIMIZE_REASON_LIST(DEOPTIMIZE_REASON)
      16             : #undef DEOPTIMIZE_REASON
      17             :   }
      18           0 :   UNREACHABLE();
      19             : }
      20             : 
      21           0 : size_t hash_value(DeoptimizeReason reason) {
      22           0 :   return static_cast<uint8_t>(reason);
      23             : }
      24             : 
      25         255 : char const* DeoptimizeReasonToString(DeoptimizeReason reason) {
      26             :   static char const* kDeoptimizeReasonStrings[] = {
      27             : #define DEOPTIMIZE_REASON(Name, message) message,
      28             :       DEOPTIMIZE_REASON_LIST(DEOPTIMIZE_REASON)
      29             : #undef DEOPTIMIZE_REASON
      30             :   };
      31         255 :   size_t const index = static_cast<size_t>(reason);
      32             :   DCHECK_LT(index, arraysize(kDeoptimizeReasonStrings));
      33         255 :   return kDeoptimizeReasonStrings[index];
      34             : }
      35             : 
      36             : }  // namespace internal
      37             : }  // namespace v8

Generated by: LCOV version 1.10